diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ea130cc3949..96a871c219e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,17 +2,17 @@ .github/ @plexoos @veprbl /OnlTools @plexoos @jml985 /StDb @dmarkh -/StDb/idl @akioogawa @dmarkh @fgeurts @iraklic @fisyak -/StRoot/PWGTools @nigmatkulov @zsweger @marrbnl +/StDb/idl @akioogawa @dmarkh @fgeurts @iraklic @fisyak @R-Witt +/StRoot/PWGTools @nigmatkulov @zsweger @marrbnl @lbavinh /StRoot/RTS @akioogawa @jml985 @tonko-lj -/StRoot/StAnalysisMaker @fisyak +/StRoot/StAnalysisMaker @fisyak @R-Witt @iraklic /StRoot/StAnalysisUtilities/StHistUtil* @genevb /StRoot/StAssociationMaker/EMC @kkauder @rkunnawa @Navagyan -/StRoot/StBFChain @genevb @plexoos @klendathu2k @fisyak -/StRoot/StBichsel @fisyak +/StRoot/StBFChain @genevb @plexoos @klendathu2k @fisyak @R-Witt @iraklic +/StRoot/StBichsel @fisyak @R-Witt @iraklic /StRoot/StBTof* @ZaochenYe @fgeurts @starsdong @jdbrice /StRoot/StBbcSimulationMaker @akioogawa -/StRoot/StChain @klendathu2k @perevbnlgov @fisyak +/StRoot/StChain @klendathu2k @perevbnlgov @fisyak @R-Witt @iraklic /StRoot/StDAQMaker @perevbnlgov @akioogawa /StRoot/StDaqLib @jml985 /StRoot/StDaqLib/EEMC @kkauder @rkunnawa @zlchang @@ -25,9 +25,9 @@ /StRoot/StDaqLib/TRG @akioogawa /StRoot/StDataFilterMaker @genevb /StRoot/StDb* @dmarkh -/StRoot/StDbUtilities @fisyak +/StRoot/StDbUtilities @fisyak @R-Witt @iraklic /StRoot/StDbUtilities/StMagUtilities* @genevb -/StRoot/StDetectorDbMaker @dmarkh @fisyak +/StRoot/StDetectorDbMaker @dmarkh @fisyak @R-Witt @iraklic /StRoot/StDetectorDbMaker/StDetectorDbBeamInfo* @genevb /StRoot/StDetectorDbMaker/StDetectorDbGridLeak* @genevb /StRoot/StDetectorDbMaker/StDetectorDbRichScalers* @genevb @@ -49,7 +49,7 @@ /StRoot/StEmbeddingUtilities @zhux97 /StRoot/StEpd* @Femtoscopist /StRoot/StEvent* @klendathu2k -/StRoot/StEvent/StTpc* @fisyak +/StRoot/StEvent/StTpc* @fisyak @R-Witt @iraklic /StRoot/StEventUtilities/StEbyET0* @genevb /StRoot/StEventUtilities/StRedoTracks* @genevb /StRoot/StEventUtilities/StuFixTopoMap* @genevb @@ -60,20 +60,20 @@ /StRoot/StFst* @jdbrice @sunxuhit @yezhenyu2003 @techuan-huang /StRoot/StFtt* @jdbrice /StRoot/StFwd* @jdbrice -/StRoot/StGenericVertexMaker @plexoos @perevbnlgov @akioogawa @klendathu2k @fisyak +/StRoot/StGenericVertexMaker @plexoos @perevbnlgov @akioogawa @klendathu2k @fisyak @R-Witt @iraklic /StRoot/StHbtMaker @JohnTheBlindMilkman @DanielWielanek /StRoot/StHeavyPool @starsdong @fgeurts /StRoot/StIOMaker @plexoos @perevbnlgov /StRoot/StIst* @plexoos @starsdong /StRoot/StJetFinder @zlchang @veprbl /StRoot/StJetMaker @zlchang @veprbl -/StRoot/StLaser* @fisyak +/StRoot/StLaser* @fisyak @R-Witt @iraklic /StRoot/StMCFilter @klendathu2k -/StRoot/StMagF @fisyak +/StRoot/StMagF @fisyak @R-Witt @iraklic /StRoot/StMc* @klendathu2k @perevbnlgov /StRoot/StMcAnalysisMaker @klendathu2k /StRoot/StMcEvent* @klendathu2k -/StRoot/StMiniMc* @klendathu2k @fisyak @zhux97 +/StRoot/StMiniMc* @klendathu2k @fisyak @R-Witt @iraklic @zhux97 /StRoot/StMtd* @marrbnl /StRoot/StMuDSTMaker @jdbrice /StRoot/StMuDSTMaker/EMC @kkauder @rkunnawa @Navagyan @@ -81,72 +81,73 @@ /StRoot/StPass0CalibMaker @genevb @iraklic /StRoot/StPico* @nigmatkulov @marrbnl @plexoos /StRoot/StPxl* @starsdong @GuannanXie +/StRoot/StRefMultCorr @nigmatkulov @zsweger @lbavinh /StRoot/StRHICf* @ggfdsa10 /StRoot/StRTSClient @jml985 @tonko-lj /StRoot/StShadowMaker @genevb /StRoot/StSpinPool @akioogawa @zlchang @veprbl /StRoot/StSsd* @starsdong @plexoos /StRoot/StSst* @starsdong @plexoos -/StRoot/StStarLogger @fisyak -/StRoot/StTableUtilities @fisyak -/StRoot/StTagsMaker @fisyak +/StRoot/StStarLogger @fisyak @R-Witt @iraklic +/StRoot/StTableUtilities @fisyak @R-Witt @iraklic +/StRoot/StTagsMaker @fisyak @R-Witt @iraklic /StRoot/StTof* @jdbrice @fgeurts @starsdong -/StRoot/StTpc* @fisyak +/StRoot/StTpc* @fisyak @R-Witt @iraklic /StRoot/StTreeMaker @perevbnlgov /StRoot/StTriggerDataMaker @akioogawa /StRoot/StTriggerUtilities @zlchang @akioogawa @jml985 -/StRoot/StTrsMaker @fisyak @iraklic +/StRoot/StTrsMaker @fisyak @R-Witt @iraklic /StRoot/StUtilities/StMess* @genevb /StRoot/StUtilities/StMultiH* @genevb /StRoot/StVpd* @ZaochenYe @fgeurts /StRoot/StXTrakMaker @perevbnlgov /StRoot/St_QA_Maker @genevb /StRoot/St_TLA_Maker @perevbnlgov -/StRoot/St_base* @perevbnlgov @fisyak +/StRoot/St_base* @perevbnlgov @fisyak @R-Witt @iraklic /StRoot/St_db_Maker @dmarkh @perevbnlgov -/StRoot/St_geant_Maker @klendathu2k @perevbnlgov @fisyak +/StRoot/St_geant_Maker @klendathu2k @perevbnlgov @fisyak @R-Witt @iraklic /StRoot/St_geant_Maker/Embed @zhux97 /StRoot/St_l3Clufi_Maker @jml985 @tonko-lj /StRoot/St_l3t_Maker @jml985 @tonko-lj -/StRoot/St_tcl_Maker @fisyak @iraklic -/StRoot/Star2Root @perevbnlgov @fisyak +/StRoot/St_tcl_Maker @fisyak @R-Witt @iraklic +/StRoot/Star2Root @perevbnlgov @fisyak @R-Witt @iraklic /StRoot/StarClassLibrary @klendathu2k /StRoot/StarGenerator @klendathu2k @perevbnlgov -/StRoot/StarMagField @fisyak -/StRoot/StarRoot @klendathu2k @perevbnlgov @fisyak -/StRoot/StdEdx* @fisyak -/StRoot/Sti* @klendathu2k @plexoos @starsdong @perevbnlgov @fisyak +/StRoot/StarMagField @fisyak @R-Witt @iraklic +/StRoot/StarRoot @klendathu2k @perevbnlgov @fisyak @R-Witt @iraklic +/StRoot/StdEdx* @fisyak @R-Witt @iraklic +/StRoot/Sti* @klendathu2k @plexoos @starsdong @perevbnlgov @fisyak @R-Witt @iraklic /StRoot/Stl3* @jml985 @tonko-lj /StRoot/Stv* @perevbnlgov /StRoot/StvUtil @klendathu2k @perevbnlgov -/StRoot/TPCCATracker @fisyak -/StRoot/macros @genevb @plexoos @fisyak +/StRoot/TPCCATracker @fisyak @R-Witt @iraklic +/StRoot/macros @genevb @plexoos @fisyak @R-Witt @iraklic /StRoot/macros/embedding @zhux97 /StRoot/macros/mudst @nigmatkulov @plexoos -/StarDb @dmarkh @perevbnlgov @fisyak +/StarDb @dmarkh @perevbnlgov @fisyak @R-Witt @iraklic /StarDb/AgML* @klendathu2k /StarDb/AgiGeometry @klendathu2k /StarDb/Calibrations @genevb /StarDb/Calibrations/emc @kkauder @rkunnawa @Navagyan /StarDb/Calibrations/tof @ZaochenYe @fgeurts -/StarDb/Calibrations/tpc @fisyak @iraklic +/StarDb/Calibrations/tpc @fisyak @R-Witt @iraklic /StarDb/Calibrations/tracker @klendathu2k /StarDb/Geometry @genevb @klendathu2k -/StarDb/Geometry/tpc @fisyak @iraklic +/StarDb/Geometry/tpc @fisyak @R-Witt @iraklic /StarDb/VmcGeometry @klendathu2k /StarDb/emc @kkauder @rkunnawa @Navagyan /StarVMC @klendathu2k -/StarVMC/geant3 @fisyak +/StarVMC/geant3 @fisyak @R-Witt @iraklic /StarVMC/Geometry @klendathu2k /StarVMC/GeoTestMaker @perevbnlgov /StarVMC/minicern @perevbnlgov /StarVMC/StarAgml* @klendathu2k /StarVMC/StarBASE @klendathu2k /StarVMC/StarGeometry @klendathu2k -/StarVMC/StarVMCApplication @fisyak +/StarVMC/StarVMCApplication @fisyak @R-Witt @iraklic /StarVMC/xgeometry @klendathu2k -/mgr @genevb @klendathu2k @fisyak @plexoos -/pams @klendathu2k @fisyak +/mgr @genevb @klendathu2k @fisyak @R-Witt @iraklic @plexoos +/pams @klendathu2k @fisyak @R-Witt @iraklic /pams/sim @akioogawa @klendathu2k /pams/tables @dmarkh /asps @klendathu2k @perevbnlgov diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index de35582787f..d81990ee3a1 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -41,16 +41,17 @@ jobs: name: star-sw-${{ env.STARENV }} path: /tmp/star-sw-${{ env.STARENV }}.tar - ROOT5_test: + test: runs-on: ubuntu-latest needs: build strategy: fail-fast: false matrix: test_id: [10, 11, 22, 23, 24, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 76, 77, 78, 90, 91, 92, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125] - compiler: [gcc485, gcc11] + starenv: [root5, root6] + compiler: [gcc485] env: - STARENV: root5-${{ matrix.compiler }} + STARENV: ${{ matrix.starenv }}-${{ matrix.compiler }} steps: - name: Download artifact uses: actions/download-artifact@v3 @@ -115,26 +116,3 @@ jobs: TEST_CMD="root4star -b -q -l 'StRoot/macros/analysis/find_vertex.C(\"$TEST_FILE\")'" docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ sh -c "set -e; $TEST_CMD 2>&1 | tee log; grep ' StIO:' log" - - ROOT6_test_ignore_fail: - runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - test_id: [50, 52, 54, 90, 91, 92, 119, 120] - env: - STARENV: root6-gcc485 - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: star-sw-${{ env.STARENV }} - path: /tmp - - - run: docker load --input /tmp/star-sw-${{ env.STARENV }}.tar - - run: docker run --name star-test-data --volume /star ghcr.io/star-bnl/star-test-data:v7 - - run: | - TEST_CMD=$(docker run --rm ghcr.io/star-bnl/star-sw-${{ env.STARENV }} tests/executest.py -c ${{ matrix.test_id }}) - docker run --volumes-from star-test-data ghcr.io/star-bnl/star-sw-${{ env.STARENV }} \ - sh -c "MALLOC_CHECK_=3 $TEST_CMD || echo 'Failed with an exit code: '\$?" diff --git a/CHANGELOG.md b/CHANGELOG.md index cfdd4567cf7..3639b7fee91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,52 @@ # Changelog +## SL23d_0 - 2023-06-14 + +## What's Changed + +* Added centrality procedure instructions by @zsweger in ([#513](https://github.com/star-bnl/star-sw/pull/513)) +* Assorted updates in OnlTools/Jevp for 2023 run by @jml985 in ([#515](https://github.com/star-bnl/star-sw/pull/515)) +* Remove unused file StRoot/StEvent/StDetectorId.inc by @plexoos in ([#517](https://github.com/star-bnl/star-sw/pull/517)) +* new RHICf library (only raw data saving part) by @ggfdsa10 in ([#511](https://github.com/star-bnl/star-sw/pull/511)) +* update CODEOWNERS for PWGTools directory by @starsdong in ([#518](https://github.com/star-bnl/star-sw/pull/518)) +* Auau200gev run19 strefmultcorr by @zsweger in ([#514](https://github.com/star-bnl/star-sw/pull/514)) +* added owners for a few subsystems by @starsdong in ([#520](https://github.com/star-bnl/star-sw/pull/520)) +* Summer 2023 updates by @jml985 in ([#516](https://github.com/star-bnl/star-sw/pull/516)) +* Automated run-by-run QA package (version-2) for STAR BES-II dataset QA. by @EllipticFlow in ([#521](https://github.com/star-bnl/star-sw/pull/521)) +* fix: remove ClassDef from StEpdGeom by @plexoos in ([#522](https://github.com/star-bnl/star-sw/pull/522)) +* Additon of StFwdTrack to StEvent, updates to StFwdTrackMaker to accomodate by @jdbrice in ([#492](https://github.com/star-bnl/star-sw/pull/492)) +* RHICf Sub-reconstruction tool (StRHICfPID) by @ggfdsa10 in ([#519](https://github.com/star-bnl/star-sw/pull/519)) +* StNbdFitMaker.cxx: update centrality calculation by @zsweger in ([#512](https://github.com/star-bnl/star-sw/pull/512)) +* New RHICf sub-reconstruction tool (StRHICfRecoPos) by @ggfdsa10 in ([#524](https://github.com/star-bnl/star-sw/pull/524)) +* Update to remove logging from itpc cluster finder by @jml985 in ([#532](https://github.com/star-bnl/star-sw/pull/532)) +* Edited mistake in params file by @zsweger in ([#531](https://github.com/star-bnl/star-sw/pull/531)) +* New RHICf sub-reconstruction tool (StRHICfRecoEnergy) by @ggfdsa10 in ([#527](https://github.com/star-bnl/star-sw/pull/527)) +* Star simulations 2023 ideal timestamp by @klendathu2k in ([#534](https://github.com/star-bnl/star-sw/pull/534)) +* Run23 prep by @genevb in ([#536](https://github.com/star-bnl/star-sw/pull/536)) +* run by run v3 with font removed by @ssedd1123 in ([#526](https://github.com/star-bnl/star-sw/pull/526)) +* Enable default STAR Spack environment by @plexoos in ([#496](https://github.com/star-bnl/star-sw/pull/496)) +* fix(env): clean up previously loaded module before activating new env by @plexoos in ([#542](https://github.com/star-bnl/star-sw/pull/542)) +* Fix for DAQ5k cluster finder dropping outer two RDOs of TPX bug by @jml985 in ([#541](https://github.com/star-bnl/star-sw/pull/541)) +* fix: load libiconv module into envs by @plexoos in ([#543](https://github.com/star-bnl/star-sw/pull/543)) +* Remove some functions in StRHICfFunction by @ggfdsa10 in ([#533](https://github.com/star-bnl/star-sw/pull/533)) +* RHICf Run and Event number added in StRHICfCollection by @ggfdsa10 in ([#544](https://github.com/star-bnl/star-sw/pull/544)) +* Updated default behavior of run-by-run QA according to agreement in QA meeting on 5/19 by @ssedd1123 in ([#545](https://github.com/star-bnl/star-sw/pull/545)) +* Add RHICf Run and Event number address in StRHICfDbMaker by @ggfdsa10 in ([#546](https://github.com/star-bnl/star-sw/pull/546)) +* Add RHICf Run and Event number in StMuRHICfxxx by @ggfdsa10 in ([#548](https://github.com/star-bnl/star-sw/pull/548)) +* Add RHICfRun and Event number in StRHICfRawHitMaker by @ggfdsa10 in ([#551](https://github.com/star-bnl/star-sw/pull/551)) +* Mask counters for production by @YannickSoehngen in ([#550](https://github.com/star-bnl/star-sw/pull/550)) +* Small additions to StFcsWaveformFitMaker and some macros for test level 6 by @dkapukchyan in ([#549](https://github.com/star-bnl/star-sw/pull/549)) + +## New Contributors + +* @zsweger made their first contribution in ([#513](https://github.com/star-bnl/star-sw/pull/513)) +* @ggfdsa10 made their first contribution in ([#511](https://github.com/star-bnl/star-sw/pull/511)) +* @EllipticFlow made their first contribution in ([#521](https://github.com/star-bnl/star-sw/pull/521)) +* @ssedd1123 made their first contribution in ([#526](https://github.com/star-bnl/star-sw/pull/526)) + +**Full Changelog**: https://github.com/star-bnl/star-sw/compare/SL23b_0...SL23d_0 + + ## SL23a_0 - 2023-01-15 ## What's Changed diff --git a/Dockerfile b/Dockerfile index 481b63d2407..5552ecb917b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG starenv=root5 # Pick one from [gcc485, gcc11] ARG compiler=gcc485 -FROM ghcr.io/star-bnl/star-spack:v0.2.3-${starenv}-${compiler} +FROM ghcr.io/star-bnl/star-spack:v0.3.0-${starenv}-${compiler} ARG compiler diff --git a/OnlTools/Jevp/StJevpBuilders/LaserReader.cxx b/OnlTools/Jevp/StJevpBuilders/LaserReader.cxx index 751c050a572..7496382019c 100755 --- a/OnlTools/Jevp/StJevpBuilders/LaserReader.cxx +++ b/OnlTools/Jevp/StJevpBuilders/LaserReader.cxx @@ -81,7 +81,7 @@ float LaserReader::Make(daqReader *rdr) if(s == 16) continue; - daq_dta *dd = rdr->det("tpx")->get("cld",s,6); // only care about padrow 45! + daq_dta *dd = rdr->det("tpx")->get("cld",s); // only care about padrow 45! if(!dd) continue; while(dd->iterate()) { diff --git a/OnlTools/Jevp/StJevpBuilders/fstBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/fstBuilder.cxx index 381f1b72e3b..7ec685200e2 100644 --- a/OnlTools/Jevp/StJevpBuilders/fstBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/fstBuilder.cxx @@ -66,6 +66,7 @@ fstBuilder::fstBuilder(JevpServer *parent):JevpBuilder(parent),evtCt(0),evtCt_no memset( &hEventSumContents, 0, sizeof(hEventSumContents) ); memset( &hMipContents, 0, sizeof(hMipContents) ); memset( &hMaxTimeBinContents, 0, sizeof(hMaxTimeBinContents) ); + memset( &hMaxTimeBinContents_APV, 0, sizeof(hMaxTimeBinContents_APV) ); memset( &hSumContents, 0, sizeof(hSumContents) ); memset( &hCmnTemp, 0, sizeof(hCmnTemp) ); } @@ -80,6 +81,7 @@ fstBuilder::~fstBuilder() int nEventSumHist = sizeof(hEventSumContents) / sizeof(TH1 *); int nMipHist = sizeof(hMipContents) / sizeof(TH1 *); int nMaxTimeBinHist = sizeof(hMaxTimeBinContents) / sizeof(TH1 *); + int nMaxTimeBinHist_APV = sizeof(hMaxTimeBinContents_APV) / sizeof(TH1 *); int nSumHist = sizeof(hSumContents) / sizeof(TH2 *); for ( int i=0; iSetFillColor(kYellow-9); hEventSumContents.hMaxTBfractionVsSection_ZS->SetStats(false); + hEventSumContents.hMaxTBfractionVsAPV_ZS = new TH1F("maxTBfractionVsAPV_ZS", "FST - maxTB fraction vs Global APV Idx (ZS)", totAPV, 0, totAPV); //288 bins + hEventSumContents.hMaxTBfractionVsAPV_ZS->GetXaxis()->SetTitle("Global APV Idx"); + hEventSumContents.hMaxTBfractionVsAPV_ZS->GetYaxis()->SetTitle("N_{0SetFillColor(kYellow-9); + hEventSumContents.hMaxTBfractionVsAPV_ZS->SetStats(false); + + hEventSumContents.hMaxAdc = new TH1I("MaxAdc_nonZS", "FST - Max ADC (non-ZS)", nBins*2, PedMin, PedMax); //100 bins hEventSumContents.hMaxAdc->SetFillColor(kYellow-9); hEventSumContents.hMaxAdc->SetStats(true); @@ -445,6 +456,28 @@ void fstBuilder::initialize(int argc, char *argv[]) hMaxTimeBinContents.maxTimeBinArray[index]->SetStats(true); } + //Max Time Bin, per APV + for(int rdoIdx=1; rdoIdx<=totRdo; rdoIdx++){ + for(int armIdx=0; armIdxGetXaxis()->SetTitle("Time Bin Index"); + hMaxTimeBinContents_APV.maxTimeBinArray_APV[glbElecApvIdx]->SetFillColor(kYellow-9); + hMaxTimeBinContents_APV.maxTimeBinArray_APV[glbElecApvIdx]->SetStats(true); + + } + } + } + + ////////////////// for(int iDisk = 0; iDisk < totDisk; ++iDisk) { @@ -662,7 +695,7 @@ void fstBuilder::initialize(int argc, char *argv[]) } //JEVP plots setting - int totPlots = mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+mEventSumHist+mMipHist+mMaxTimeBinHist+mSumHist; + int totPlots = mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+mEventSumHist+mMipHist+mMaxTimeBinHist+mMaxTimeBinHist_APV+mSumHist; plots = new JevpPlot*[totPlots]; JLine* line1 = new JLine(1536, -100, 1536, 4000); @@ -708,8 +741,11 @@ void fstBuilder::initialize(int argc, char *argv[]) plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+11] = new JevpPlot(hEventSumContents.hMipSIGMAvsSection); plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+12] = new JevpPlot(hEventSumContents.hMipSIGMAvsSection_ZS); plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+13] = new JevpPlot(hEventSumContents.hMaxTBfractionVsSection_ZS); - plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+14] = new JevpPlot(hEventSumContents.hMaxAdc); - plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+15] = new JevpPlot(hEventSumContents.hMaxAdc_ZS); + plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+14] = new JevpPlot(hEventSumContents.hMaxTBfractionVsAPV_ZS); + + plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+15] = new JevpPlot(hEventSumContents.hMaxAdc); + plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+16] = new JevpPlot(hEventSumContents.hMaxAdc_ZS); + plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+6]->logy=true; // plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+6]->setOptStat(10); plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+7]->logy=true; @@ -744,13 +780,18 @@ void fstBuilder::initialize(int argc, char *argv[]) plots[mAdcHist+mMultHist+mHitMapHist+mTbVsAdcHist+mEventSumHist+mMipHist+i] = new JevpPlot(hMaxTimeBinContents.maxTimeBinArray[i]); } + for ( int i=0; idet("fst")->get("zs"); if ( ddZS && ddZS->meta ) { apv_meta_t *meta = (apv_meta_t *) ddZS->meta; + PCP; + for ( int r=1; r<=totRdo; r++ ) { //1--6 ARCs (ARM Readout Controllers) if ( meta->arc[r].present == 0 ) continue ; for ( int arm=0; armarc[r].arm[arm].apv[apv].present == 0 ) continue ; + PCP; + int Tb = meta->arc[r].arm[arm].apv[apv].ntim; + + //LOG("JEFF", "Tb = %d",Tb); + PCP; + if( numTb != 0 && Tb != 0 && numTb != Tb ) { //printf("Different number of timebins in different APV!!! Taking real one!!!\n"); numTb = Tb; } + PCP; hEventSumContents.hSumTB->Fill(numTb); } + PCP; } } } + PCP; + while( ddZS && ddZS->iterate() ) { fgt_adc_t *f_zs = (fgt_adc_t *) ddZS->Void ; evtSize += ddZS->ncontent * sizeof(fgt_adc_t); @@ -1400,6 +1459,8 @@ void fstBuilder::event(daqReader *rdr) } }//end all RDO, ARM, APV loops + PCP; + if(ddZS) { hEventSumContents.hEventSize->Fill(short(evtSize/1024)); evtSize = 0; @@ -1437,6 +1498,7 @@ void fstBuilder::event(daqReader *rdr) hEventSumContents.hMaxTimeBin_ZS->Fill(maxTimeBin_zs[geoIdx]); hEventSumContents.hMaxAdc_ZS->Fill(maxAdc_zs[geoIdx]); hMaxTimeBinContents.maxTimeBinArray[glbSecIdx]->Fill(maxTimeBin_zs[geoIdx]); + hMaxTimeBinContents_APV.maxTimeBinArray_APV[glbElecApvIdx]->Fill(maxTimeBin_zs[geoIdx]); hSumContents.hSignal_zs[diskIdx-1]->Fill(geoIdx-(diskIdx-1)*ChPerDisk, short(maxAdc_zs[geoIdx]+0.5)); } hSumContents.hHitMapVsAPV_ZS[diskIdx-1]->Fill(moduleIdx, lclApvIdx); @@ -1486,6 +1548,7 @@ void fstBuilder::event(daqReader *rdr) evtCt_ZS++; } + PCP; // non-ZS data stream daq_dta *dd = rdr->det("fst")->get("adc"); @@ -1606,6 +1669,8 @@ void fstBuilder::event(daqReader *rdr) } } //end current APV chip loops + PCP; + //calculate dynamical common mode noise for current event for(int iRstrip = 0; iRstrip < 4; ++iRstrip) { @@ -1685,6 +1750,8 @@ void fstBuilder::event(daqReader *rdr) } } //end current APV chip loops + PCP; + // zero out hits less than 2 TBs for(int i=0;iSetBinContent(j+1, short(sigmaMIP_ZS+0.5)); } + for(int rdoIdx=1; rdoIdx<=totRdo; rdoIdx++){ + for(int armIdx=0; armIdxGetEntries()>0){ + entriesTB_123 = hMaxTimeBinContents_APV.maxTimeBinArray_APV[glbElecApvIdx]->Integral(2, numTb-1); + entriesTB_all = hMaxTimeBinContents_APV.maxTimeBinArray_APV[glbElecApvIdx]->Integral(1, numTb); + fraction = entriesTB_123/entriesTB_all; + } + hEventSumContents.hMaxTBfractionVsAPV_ZS->SetBinContent(glbElecApvIdx, fraction); + } + } + } + + + hEventSumContents.hMipMPVvsSection->GetYaxis()->SetRangeUser(0, 800); hEventSumContents.hMipSIGMAvsSection->GetYaxis()->SetRangeUser(0, 200); hEventSumContents.hMipMPVvsSection_ZS->GetYaxis()->SetRangeUser(0, 800); diff --git a/OnlTools/Jevp/StJevpBuilders/fstBuilder.h b/OnlTools/Jevp/StJevpBuilders/fstBuilder.h index 6bd73437cf5..38e778ca0bb 100644 --- a/OnlTools/Jevp/StJevpBuilders/fstBuilder.h +++ b/OnlTools/Jevp/StJevpBuilders/fstBuilder.h @@ -91,7 +91,7 @@ class fstBuilder : public JevpBuilder { static const int ApvRoPerPort = 12; // APV RO number same as IST static const int ApvRoPerArm = 24; // APV RO number same as IST - static const int numTimeBin = 3; // to be decided + static const int numTimeBin = 9; // to be decided static const int goodChCut = 64; // to be decided static const int minPedVal = 200; // to be decided static const int maxPedVal = 3000; // to be decided @@ -360,6 +360,7 @@ class fstBuilder : public JevpBuilder { TH1* hMipSIGMAvsSection; //FST Sigma of MIP per section (non-ZS) => per module? TH1* hMipSIGMAvsSection_ZS; //FST Sigma of MIP per section (ZS) => per module? TH1* hMaxTBfractionVsSection_ZS; //max time bin fraction in 1,2,3 over all time bins vs section ID + TH1* hMaxTBfractionVsAPV_ZS; //max time bin fraction in 1,2,3 over all time bins vs APV ID TH1* hMaxAdc; //max ADC TH1* hMaxAdc_ZS; //max ADC (ZS) }; @@ -592,6 +593,300 @@ class fstBuilder : public JevpBuilder { TH1* hMaxTBDisk3Sec24; }; } hMaxTimeBinContents; + + union { + TH1 *maxTimeBinArray_APV[1]; //MaxTimeBin per APV + struct { // 3 disks * 12 modules * 2 sections + TH1* hMaxTBRdo1Arm0Port0Apv0; + TH1* hMaxTBRdo1Arm0Port0Apv1; + TH1* hMaxTBRdo1Arm0Port0Apv2; + TH1* hMaxTBRdo1Arm0Port0Apv3; + TH1* hMaxTBRdo1Arm0Port0Apv4; + TH1* hMaxTBRdo1Arm0Port0Apv5; + TH1* hMaxTBRdo1Arm0Port0Apv6; + TH1* hMaxTBRdo1Arm0Port0Apv7; + TH1* hMaxTBRdo1Arm0Port1Apv0; + TH1* hMaxTBRdo1Arm0Port1Apv1; + TH1* hMaxTBRdo1Arm0Port1Apv2; + TH1* hMaxTBRdo1Arm0Port1Apv3; + TH1* hMaxTBRdo1Arm0Port1Apv4; + TH1* hMaxTBRdo1Arm0Port1Apv5; + TH1* hMaxTBRdo1Arm0Port1Apv6; + TH1* hMaxTBRdo1Arm0Port1Apv7; + TH1* hMaxTBRdo1Arm1Port0Apv0; + TH1* hMaxTBRdo1Arm1Port0Apv1; + TH1* hMaxTBRdo1Arm1Port0Apv2; + TH1* hMaxTBRdo1Arm1Port0Apv3; + TH1* hMaxTBRdo1Arm1Port0Apv4; + TH1* hMaxTBRdo1Arm1Port0Apv5; + TH1* hMaxTBRdo1Arm1Port0Apv6; + TH1* hMaxTBRdo1Arm1Port0Apv7; + TH1* hMaxTBRdo1Arm1Port1Apv0; + TH1* hMaxTBRdo1Arm1Port1Apv1; + TH1* hMaxTBRdo1Arm1Port1Apv2; + TH1* hMaxTBRdo1Arm1Port1Apv3; + TH1* hMaxTBRdo1Arm1Port1Apv4; + TH1* hMaxTBRdo1Arm1Port1Apv5; + TH1* hMaxTBRdo1Arm1Port1Apv6; + TH1* hMaxTBRdo1Arm1Port1Apv7; + TH1* hMaxTBRdo1Arm2Port0Apv0; + TH1* hMaxTBRdo1Arm2Port0Apv1; + TH1* hMaxTBRdo1Arm2Port0Apv2; + TH1* hMaxTBRdo1Arm2Port0Apv3; + TH1* hMaxTBRdo1Arm2Port0Apv4; + TH1* hMaxTBRdo1Arm2Port0Apv5; + TH1* hMaxTBRdo1Arm2Port0Apv6; + TH1* hMaxTBRdo1Arm2Port0Apv7; + TH1* hMaxTBRdo1Arm2Port1Apv0; + TH1* hMaxTBRdo1Arm2Port1Apv1; + TH1* hMaxTBRdo1Arm2Port1Apv2; + TH1* hMaxTBRdo1Arm2Port1Apv3; + TH1* hMaxTBRdo1Arm2Port1Apv4; + TH1* hMaxTBRdo1Arm2Port1Apv5; + TH1* hMaxTBRdo1Arm2Port1Apv6; + TH1* hMaxTBRdo1Arm2Port1Apv7; + TH1* hMaxTBRdo2Arm0Port0Apv0; + TH1* hMaxTBRdo2Arm0Port0Apv1; + TH1* hMaxTBRdo2Arm0Port0Apv2; + TH1* hMaxTBRdo2Arm0Port0Apv3; + TH1* hMaxTBRdo2Arm0Port0Apv4; + TH1* hMaxTBRdo2Arm0Port0Apv5; + TH1* hMaxTBRdo2Arm0Port0Apv6; + TH1* hMaxTBRdo2Arm0Port0Apv7; + TH1* hMaxTBRdo2Arm0Port1Apv0; + TH1* hMaxTBRdo2Arm0Port1Apv1; + TH1* hMaxTBRdo2Arm0Port1Apv2; + TH1* hMaxTBRdo2Arm0Port1Apv3; + TH1* hMaxTBRdo2Arm0Port1Apv4; + TH1* hMaxTBRdo2Arm0Port1Apv5; + TH1* hMaxTBRdo2Arm0Port1Apv6; + TH1* hMaxTBRdo2Arm0Port1Apv7; + TH1* hMaxTBRdo2Arm1Port0Apv0; + TH1* hMaxTBRdo2Arm1Port0Apv1; + TH1* hMaxTBRdo2Arm1Port0Apv2; + TH1* hMaxTBRdo2Arm1Port0Apv3; + TH1* hMaxTBRdo2Arm1Port0Apv4; + TH1* hMaxTBRdo2Arm1Port0Apv5; + TH1* hMaxTBRdo2Arm1Port0Apv6; + TH1* hMaxTBRdo2Arm1Port0Apv7; + TH1* hMaxTBRdo2Arm1Port1Apv0; + TH1* hMaxTBRdo2Arm1Port1Apv1; + TH1* hMaxTBRdo2Arm1Port1Apv2; + TH1* hMaxTBRdo2Arm1Port1Apv3; + TH1* hMaxTBRdo2Arm1Port1Apv4; + TH1* hMaxTBRdo2Arm1Port1Apv5; + TH1* hMaxTBRdo2Arm1Port1Apv6; + TH1* hMaxTBRdo2Arm1Port1Apv7; + TH1* hMaxTBRdo2Arm2Port0Apv0; + TH1* hMaxTBRdo2Arm2Port0Apv1; + TH1* hMaxTBRdo2Arm2Port0Apv2; + TH1* hMaxTBRdo2Arm2Port0Apv3; + TH1* hMaxTBRdo2Arm2Port0Apv4; + TH1* hMaxTBRdo2Arm2Port0Apv5; + TH1* hMaxTBRdo2Arm2Port0Apv6; + TH1* hMaxTBRdo2Arm2Port0Apv7; + TH1* hMaxTBRdo2Arm2Port1Apv0; + TH1* hMaxTBRdo2Arm2Port1Apv1; + TH1* hMaxTBRdo2Arm2Port1Apv2; + TH1* hMaxTBRdo2Arm2Port1Apv3; + TH1* hMaxTBRdo2Arm2Port1Apv4; + TH1* hMaxTBRdo2Arm2Port1Apv5; + TH1* hMaxTBRdo2Arm2Port1Apv6; + TH1* hMaxTBRdo2Arm2Port1Apv7; + TH1* hMaxTBRdo3Arm0Port0Apv0; + TH1* hMaxTBRdo3Arm0Port0Apv1; + TH1* hMaxTBRdo3Arm0Port0Apv2; + TH1* hMaxTBRdo3Arm0Port0Apv3; + TH1* hMaxTBRdo3Arm0Port0Apv4; + TH1* hMaxTBRdo3Arm0Port0Apv5; + TH1* hMaxTBRdo3Arm0Port0Apv6; + TH1* hMaxTBRdo3Arm0Port0Apv7; + TH1* hMaxTBRdo3Arm0Port1Apv0; + TH1* hMaxTBRdo3Arm0Port1Apv1; + TH1* hMaxTBRdo3Arm0Port1Apv2; + TH1* hMaxTBRdo3Arm0Port1Apv3; + TH1* hMaxTBRdo3Arm0Port1Apv4; + TH1* hMaxTBRdo3Arm0Port1Apv5; + TH1* hMaxTBRdo3Arm0Port1Apv6; + TH1* hMaxTBRdo3Arm0Port1Apv7; + TH1* hMaxTBRdo3Arm1Port0Apv0; + TH1* hMaxTBRdo3Arm1Port0Apv1; + TH1* hMaxTBRdo3Arm1Port0Apv2; + TH1* hMaxTBRdo3Arm1Port0Apv3; + TH1* hMaxTBRdo3Arm1Port0Apv4; + TH1* hMaxTBRdo3Arm1Port0Apv5; + TH1* hMaxTBRdo3Arm1Port0Apv6; + TH1* hMaxTBRdo3Arm1Port0Apv7; + TH1* hMaxTBRdo3Arm1Port1Apv0; + TH1* hMaxTBRdo3Arm1Port1Apv1; + TH1* hMaxTBRdo3Arm1Port1Apv2; + TH1* hMaxTBRdo3Arm1Port1Apv3; + TH1* hMaxTBRdo3Arm1Port1Apv4; + TH1* hMaxTBRdo3Arm1Port1Apv5; + TH1* hMaxTBRdo3Arm1Port1Apv6; + TH1* hMaxTBRdo3Arm1Port1Apv7; + TH1* hMaxTBRdo3Arm2Port0Apv0; + TH1* hMaxTBRdo3Arm2Port0Apv1; + TH1* hMaxTBRdo3Arm2Port0Apv2; + TH1* hMaxTBRdo3Arm2Port0Apv3; + TH1* hMaxTBRdo3Arm2Port0Apv4; + TH1* hMaxTBRdo3Arm2Port0Apv5; + TH1* hMaxTBRdo3Arm2Port0Apv6; + TH1* hMaxTBRdo3Arm2Port0Apv7; + TH1* hMaxTBRdo3Arm2Port1Apv0; + TH1* hMaxTBRdo3Arm2Port1Apv1; + TH1* hMaxTBRdo3Arm2Port1Apv2; + TH1* hMaxTBRdo3Arm2Port1Apv3; + TH1* hMaxTBRdo3Arm2Port1Apv4; + TH1* hMaxTBRdo3Arm2Port1Apv5; + TH1* hMaxTBRdo3Arm2Port1Apv6; + TH1* hMaxTBRdo3Arm2Port1Apv7; + TH1* hMaxTBRdo4Arm0Port0Apv0; + TH1* hMaxTBRdo4Arm0Port0Apv1; + TH1* hMaxTBRdo4Arm0Port0Apv2; + TH1* hMaxTBRdo4Arm0Port0Apv3; + TH1* hMaxTBRdo4Arm0Port0Apv4; + TH1* hMaxTBRdo4Arm0Port0Apv5; + TH1* hMaxTBRdo4Arm0Port0Apv6; + TH1* hMaxTBRdo4Arm0Port0Apv7; + TH1* hMaxTBRdo4Arm0Port1Apv0; + TH1* hMaxTBRdo4Arm0Port1Apv1; + TH1* hMaxTBRdo4Arm0Port1Apv2; + TH1* hMaxTBRdo4Arm0Port1Apv3; + TH1* hMaxTBRdo4Arm0Port1Apv4; + TH1* hMaxTBRdo4Arm0Port1Apv5; + TH1* hMaxTBRdo4Arm0Port1Apv6; + TH1* hMaxTBRdo4Arm0Port1Apv7; + TH1* hMaxTBRdo4Arm1Port0Apv0; + TH1* hMaxTBRdo4Arm1Port0Apv1; + TH1* hMaxTBRdo4Arm1Port0Apv2; + TH1* hMaxTBRdo4Arm1Port0Apv3; + TH1* hMaxTBRdo4Arm1Port0Apv4; + TH1* hMaxTBRdo4Arm1Port0Apv5; + TH1* hMaxTBRdo4Arm1Port0Apv6; + TH1* hMaxTBRdo4Arm1Port0Apv7; + TH1* hMaxTBRdo4Arm1Port1Apv0; + TH1* hMaxTBRdo4Arm1Port1Apv1; + TH1* hMaxTBRdo4Arm1Port1Apv2; + TH1* hMaxTBRdo4Arm1Port1Apv3; + TH1* hMaxTBRdo4Arm1Port1Apv4; + TH1* hMaxTBRdo4Arm1Port1Apv5; + TH1* hMaxTBRdo4Arm1Port1Apv6; + TH1* hMaxTBRdo4Arm1Port1Apv7; + TH1* hMaxTBRdo4Arm2Port0Apv0; + TH1* hMaxTBRdo4Arm2Port0Apv1; + TH1* hMaxTBRdo4Arm2Port0Apv2; + TH1* hMaxTBRdo4Arm2Port0Apv3; + TH1* hMaxTBRdo4Arm2Port0Apv4; + TH1* hMaxTBRdo4Arm2Port0Apv5; + TH1* hMaxTBRdo4Arm2Port0Apv6; + TH1* hMaxTBRdo4Arm2Port0Apv7; + TH1* hMaxTBRdo4Arm2Port1Apv0; + TH1* hMaxTBRdo4Arm2Port1Apv1; + TH1* hMaxTBRdo4Arm2Port1Apv2; + TH1* hMaxTBRdo4Arm2Port1Apv3; + TH1* hMaxTBRdo4Arm2Port1Apv4; + TH1* hMaxTBRdo4Arm2Port1Apv5; + TH1* hMaxTBRdo4Arm2Port1Apv6; + TH1* hMaxTBRdo4Arm2Port1Apv7; + TH1* hMaxTBRdo5Arm0Port0Apv0; + TH1* hMaxTBRdo5Arm0Port0Apv1; + TH1* hMaxTBRdo5Arm0Port0Apv2; + TH1* hMaxTBRdo5Arm0Port0Apv3; + TH1* hMaxTBRdo5Arm0Port0Apv4; + TH1* hMaxTBRdo5Arm0Port0Apv5; + TH1* hMaxTBRdo5Arm0Port0Apv6; + TH1* hMaxTBRdo5Arm0Port0Apv7; + TH1* hMaxTBRdo5Arm0Port1Apv0; + TH1* hMaxTBRdo5Arm0Port1Apv1; + TH1* hMaxTBRdo5Arm0Port1Apv2; + TH1* hMaxTBRdo5Arm0Port1Apv3; + TH1* hMaxTBRdo5Arm0Port1Apv4; + TH1* hMaxTBRdo5Arm0Port1Apv5; + TH1* hMaxTBRdo5Arm0Port1Apv6; + TH1* hMaxTBRdo5Arm0Port1Apv7; + TH1* hMaxTBRdo5Arm1Port0Apv0; + TH1* hMaxTBRdo5Arm1Port0Apv1; + TH1* hMaxTBRdo5Arm1Port0Apv2; + TH1* hMaxTBRdo5Arm1Port0Apv3; + TH1* hMaxTBRdo5Arm1Port0Apv4; + TH1* hMaxTBRdo5Arm1Port0Apv5; + TH1* hMaxTBRdo5Arm1Port0Apv6; + TH1* hMaxTBRdo5Arm1Port0Apv7; + TH1* hMaxTBRdo5Arm1Port1Apv0; + TH1* hMaxTBRdo5Arm1Port1Apv1; + TH1* hMaxTBRdo5Arm1Port1Apv2; + TH1* hMaxTBRdo5Arm1Port1Apv3; + TH1* hMaxTBRdo5Arm1Port1Apv4; + TH1* hMaxTBRdo5Arm1Port1Apv5; + TH1* hMaxTBRdo5Arm1Port1Apv6; + TH1* hMaxTBRdo5Arm1Port1Apv7; + TH1* hMaxTBRdo5Arm2Port0Apv0; + TH1* hMaxTBRdo5Arm2Port0Apv1; + TH1* hMaxTBRdo5Arm2Port0Apv2; + TH1* hMaxTBRdo5Arm2Port0Apv3; + TH1* hMaxTBRdo5Arm2Port0Apv4; + TH1* hMaxTBRdo5Arm2Port0Apv5; + TH1* hMaxTBRdo5Arm2Port0Apv6; + TH1* hMaxTBRdo5Arm2Port0Apv7; + TH1* hMaxTBRdo5Arm2Port1Apv0; + TH1* hMaxTBRdo5Arm2Port1Apv1; + TH1* hMaxTBRdo5Arm2Port1Apv2; + TH1* hMaxTBRdo5Arm2Port1Apv3; + TH1* hMaxTBRdo5Arm2Port1Apv4; + TH1* hMaxTBRdo5Arm2Port1Apv5; + TH1* hMaxTBRdo5Arm2Port1Apv6; + TH1* hMaxTBRdo5Arm2Port1Apv7; + TH1* hMaxTBRdo6Arm0Port0Apv0; + TH1* hMaxTBRdo6Arm0Port0Apv1; + TH1* hMaxTBRdo6Arm0Port0Apv2; + TH1* hMaxTBRdo6Arm0Port0Apv3; + TH1* hMaxTBRdo6Arm0Port0Apv4; + TH1* hMaxTBRdo6Arm0Port0Apv5; + TH1* hMaxTBRdo6Arm0Port0Apv6; + TH1* hMaxTBRdo6Arm0Port0Apv7; + TH1* hMaxTBRdo6Arm0Port1Apv0; + TH1* hMaxTBRdo6Arm0Port1Apv1; + TH1* hMaxTBRdo6Arm0Port1Apv2; + TH1* hMaxTBRdo6Arm0Port1Apv3; + TH1* hMaxTBRdo6Arm0Port1Apv4; + TH1* hMaxTBRdo6Arm0Port1Apv5; + TH1* hMaxTBRdo6Arm0Port1Apv6; + TH1* hMaxTBRdo6Arm0Port1Apv7; + TH1* hMaxTBRdo6Arm1Port0Apv0; + TH1* hMaxTBRdo6Arm1Port0Apv1; + TH1* hMaxTBRdo6Arm1Port0Apv2; + TH1* hMaxTBRdo6Arm1Port0Apv3; + TH1* hMaxTBRdo6Arm1Port0Apv4; + TH1* hMaxTBRdo6Arm1Port0Apv5; + TH1* hMaxTBRdo6Arm1Port0Apv6; + TH1* hMaxTBRdo6Arm1Port0Apv7; + TH1* hMaxTBRdo6Arm1Port1Apv0; + TH1* hMaxTBRdo6Arm1Port1Apv1; + TH1* hMaxTBRdo6Arm1Port1Apv2; + TH1* hMaxTBRdo6Arm1Port1Apv3; + TH1* hMaxTBRdo6Arm1Port1Apv4; + TH1* hMaxTBRdo6Arm1Port1Apv5; + TH1* hMaxTBRdo6Arm1Port1Apv6; + TH1* hMaxTBRdo6Arm1Port1Apv7; + TH1* hMaxTBRdo6Arm2Port0Apv0; + TH1* hMaxTBRdo6Arm2Port0Apv1; + TH1* hMaxTBRdo6Arm2Port0Apv2; + TH1* hMaxTBRdo6Arm2Port0Apv3; + TH1* hMaxTBRdo6Arm2Port0Apv4; + TH1* hMaxTBRdo6Arm2Port0Apv5; + TH1* hMaxTBRdo6Arm2Port0Apv6; + TH1* hMaxTBRdo6Arm2Port0Apv7; + TH1* hMaxTBRdo6Arm2Port1Apv0; + TH1* hMaxTBRdo6Arm2Port1Apv1; + TH1* hMaxTBRdo6Arm2Port1Apv2; + TH1* hMaxTBRdo6Arm2Port1Apv3; + TH1* hMaxTBRdo6Arm2Port1Apv4; + TH1* hMaxTBRdo6Arm2Port1Apv5; + TH1* hMaxTBRdo6Arm2Port1Apv6; + TH1* hMaxTBRdo6Arm2Port1Apv7; + }; + } hMaxTimeBinContents_APV; union { TH2 *sumArray[1]; @@ -632,6 +927,7 @@ class fstBuilder : public JevpBuilder { int mEventSumHist; int mMipHist; int mMaxTimeBinHist; + int mMaxTimeBinHist_APV; int mSumHist; JevpPlot** plots; diff --git a/OnlTools/Jevp/StJevpBuilders/fttBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/fttBuilder.cxx index f3376670907..53a62bb71a9 100644 --- a/OnlTools/Jevp/StJevpBuilders/fttBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/fttBuilder.cxx @@ -52,7 +52,7 @@ void fttBuilder::initialize(int argc, char *argv[]) { // Control draw/visiblity options - std::vector setLogy = { "hitsPerTb", "chargePerPlane0", "chargePerPlane1", "chargePerPlane2", "chargePerPlane3", "hitsTbPerPlane0", "hitsTbPerPlane1", "hitsTbPerPlane2", "hitsTbPerPlane3", "hitsPerPlane", "hitsPerQuad", "hitsPerFob", "hitsPerVMM", "hitsVMMPerPlane0", "hitsVMMPerPlane1", "hitsVMMPerPlane2", "hitsVMMPerPlane3", "nStripsFired" }; + std::vector setLogy = { "hitsPerTb", "chargePerPlane0", "chargePerPlane1", "chargePerPlane2", "chargePerPlane3", "hitsTbPerPlane0", "hitsTbPerPlane1", "hitsTbPerPlane2", "hitsTbPerPlane3", "hitsPerPlane", "hitsPerQuad", "hitsPerFob", "hitsPerVMM", "hitsVMMPerPlane0", "hitsVMMPerPlane1", "hitsVMMPerPlane2", "hitsVMMPerPlane3", "nStripsFired", "nStripsFiredAll", "nStripsFiredOutOfTime" }; std::vector setLogz = { "hitsPerPlaneQuad", "hitsFobQuadPerPlane0", "hitsFobQuadPerPlane1", "hitsFobQuadPerPlane2", "hitsFobQuadPerPlane3" }; std::vector showStats = { "hitsPerTb400", "hitsPerTb100", "nStripsFired" }; std::vector drawOutline = {}; @@ -62,7 +62,9 @@ void fttBuilder::initialize(int argc, char *argv[]) { //////////////////////////////////////////////////////////////////////// // General //////////////////////////////////////////////////////////////////////// - contents.nStripsFired = new TH1D( "nStripsFired", "sTGC; nStripsFired; counts", 100, 0, 6000 ); + contents.nStripsFired = new TH1D( "nStripsFired", "sTGC; nStripsFired (-40 < tb < 300); counts", 300, 0, 15000 ); + contents.nStripsFiredAll = new TH1D( "nStripsFiredAll", "sTGC; nStripsFired (all tb); counts", 300, 0, 15000 ); + contents.nStripsFiredOutOfTime = new TH1D( "nStripsFiredOutOfTime", "sTGC; nStripsFiredOutOfTime (tb < -40 | tb > 300); counts", 200, 0, 10000 ); //////////////////////////////////////////////////////////////////////// // hits and adc @@ -72,7 +74,7 @@ void fttBuilder::initialize(int argc, char *argv[]) { contents.hitsPerFob = new TH1D( "hitsPerFob", "sTGC (hits / Fob); Fob; counts (hits)", nFob,0.5, nFob + 0.5 ); contents.hitsPerVMM = new TH1D( "hitsPerVMM", "sTGC (hits / VMM); VMM Index (96VMM / Plane); counts (hits)", nVMM,0.5, nVMM + 0.5 ); contents.hitsPerTb = new TH1D( "hitsPerTb", "sTGC (hits / Timebin); Tb; counts (hits)", 338, minTb, maxTb ); - contents.hitsPerTb400 = new TH1D( "hitsPerTb400", "sTGC (hits / Timebin); Tb; counts (hits)", 400, -400, 400 ); + contents.hitsPerTb400 = new TH1D( "hitsPerTb400", "sTGC (hits / Timebin); Tb; counts (hits)", 400, -200, 600 ); contents.hitsPerTb100 = new TH1D( "hitsPerTb100", "sTGC (hits / Timebin); Tb; counts (hits)", 150, -100, 50 ); contents.hitsPerPlaneQuad = new TH2D( "hitsPerPlaneQuad", "sTGC (hits / Quadrant); Plane; Quadrant", nPlane,0.5, nPlane + 0.5, nQuadPerPlane, 0.5, nQuadPerPlane + 0.5); contents.hitsPerVMMPlane = new TH2D( "hitsPerVMMPlane", "sTGC (hits / VMM / Plane); VMM index; Plane", nVMMPerPlane, 0.5, nVMMPerPlane+0.5, nPlane,0.5, nPlane + 0.5); @@ -645,9 +647,12 @@ void fttBuilder::processVMMHit( int iPlane, VMMHardwareMap::Quadrant quad, stgc_ contents.bcidVMM->Fill( iVMMPerFtt+1, rawVMM.bcid ); - if ( rawVMM.tb < 30 && rawVMM.tb > -80 ){ + nStripsFiredAll++; + if ( rawVMM.tb < 300 && rawVMM.tb > -40 ){ // global counter on strips fired nStripsFired++; + } else { + nStripsFiredOutOfTime++; } @@ -694,6 +699,8 @@ void fttBuilder::processVMM(daqReader *rdr) { dd = rdr->det("stgc")->get("vmm"); nStripsFired = 0; + nStripsFiredOutOfTime = 0; + nStripsFiredAll = 0; bool vmm_found = false; while(dd && dd->iterate()) { @@ -711,7 +718,10 @@ void fttBuilder::processVMM(daqReader *rdr) { } // iterate dd // printf( "nStripsFired = %d\n", nStripsFired ); + // printf( "nStripsFiredAll = %d\n", nStripsFiredAll ); contents.nStripsFired->Fill( nStripsFired ); + contents.nStripsFiredAll->Fill( nStripsFiredAll ); + contents.nStripsFiredOutOfTime->Fill( nStripsFiredOutOfTime ); } // processVMM void fttBuilder::event(daqReader *rdr) { diff --git a/OnlTools/Jevp/StJevpBuilders/fttBuilder.h b/OnlTools/Jevp/StJevpBuilders/fttBuilder.h index b491ab0eb97..7a249c31ecf 100644 --- a/OnlTools/Jevp/StJevpBuilders/fttBuilder.h +++ b/OnlTools/Jevp/StJevpBuilders/fttBuilder.h @@ -242,8 +242,8 @@ class fttBuilder : public JevpBuilder { static const size_t maxADC = 1024 + 1; // 10 bits; static const size_t maxBCID = 4096 + 1; // 12 bits; - static const int minTb = -32768 - 1000; // get the under and overflow - static const int maxTb = 32768 + 1000; + static const int minTb = -3000; // get the under and overflow + static const int maxTb = 3000; static const std::string quadLabels[4]; static const std::string dirLabels[4]; @@ -288,6 +288,8 @@ class fttBuilder : public JevpBuilder { TH1 *chargePerFob[nFob]; TH1 *nStripsFired; + TH1 *nStripsFiredAll; + TH1 *nStripsFiredOutOfTime; }; } contents; @@ -335,7 +337,9 @@ class fttBuilder : public JevpBuilder { #endif - int nStripsFired; + size_t nStripsFired; + size_t nStripsFiredOutOfTime; + size_t nStripsFiredAll; ClassDef(fttBuilder, 1); }; diff --git a/OnlTools/Jevp/StJevpBuilders/l4Builder.cxx b/OnlTools/Jevp/StJevpBuilders/l4Builder.cxx index 33515348ee1..f5d5bdf1461 100644 --- a/OnlTools/Jevp/StJevpBuilders/l4Builder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/l4Builder.cxx @@ -3204,7 +3204,7 @@ void l4Builder::defineFixedTargetPlots() FixedTargetPlots[index]->addHisto(ph); index++; //2 - hFixedTarget_VertexZ = new TH1D("FixedTarget_VertexZ","FixedTarget_VertexZ",400, 190.,210.); + hFixedTarget_VertexZ = new TH1D("FixedTarget_VertexZ","FixedTarget_VertexZ",400, -190.,-170.); ph = new PlotHisto(); ph->histo = hFixedTarget_VertexZ; FixedTargetPlots[index]->addHisto(ph); @@ -3223,7 +3223,7 @@ void l4Builder::defineFixedTargetPlots() index++; //5 hFixedTargetVertexYZ = new TH2D("FixedTarget_VertexYZ", "FixedTarget_VertexYZ;vertex Z [cm];vertex Y [cm]", - 400, 190, 210, 200, -5, 5); + 400, -190, -170, 200, -5, 5); ph = new PlotHisto(); ph->histo = hFixedTargetVertexYZ; FixedTargetPlots[index]->addHisto(ph); @@ -3278,7 +3278,7 @@ void l4Builder::defineFixedTargetMonitorPlots() index++; //2 hFixedTargetMonitor_VertexZ = new TH1D("FixedTargetMonitor_VertexZ","FixedTargetMonitor_VertexZ", - 400, 160, 240); + 400, -210, -150); ph = new PlotHisto(); ph->histo = hFixedTargetMonitor_VertexZ; FixedTargetMonitorPlots[index]->addHisto(ph); @@ -3300,7 +3300,7 @@ void l4Builder::defineFixedTargetMonitorPlots() index++; //5 hFixedTargetMonitorVertexYZ = new TH2D("FixedTargetMonitor_VertexYZ", "FixedTargetMonitor_VertexYZ;vertex Z [cm];vertex Y [cm]", - 400, 160, 240, 200, -5, 5); + 400, -210, -150, 200, -5, 5); ph = new PlotHisto(); ph->histo = hFixedTargetMonitorVertexYZ; FixedTargetMonitorPlots[index]->addHisto(ph); diff --git a/OnlTools/Jevp/StJevpBuilders/laserBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/laserBuilder.cxx index 53d54effa4c..97512476408 100644 --- a/OnlTools/Jevp/StJevpBuilders/laserBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/laserBuilder.cxx @@ -78,7 +78,7 @@ laserBuilder::~laserBuilder() { } void laserBuilder::initialize(int argc, char *argv[]) { - contents.h_tpc_drift_vel = new TH1D("h_tpc_drift_vel", "TPC Drift Velocity (cm/us)",400,5.4,5.8); + contents.h_tpc_drift_vel = new TH1D("h_tpc_drift_vel", "TPC Drift Velocity (cm/us)",400,5.0,5.8); PCP; // Add root histograms to Plots @@ -131,7 +131,7 @@ void laserBuilder::event(daqReader *rdr) LOG("JEFF","Laser Event Processed: run=%d evt=%d vDrift=%lf total_tpc_evts=%d",run, rdr->event_number, vDrift, numberOfEventsRun); - if((vDrift > 5.4) && (vDrift < 5.8)) { + if((vDrift > 5.0) && (vDrift < 5.8)) { nlasers++; contents.h_tpc_drift_vel->Fill(vDrift); } diff --git a/OnlTools/Jevp/StJevpBuilders/tpcBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/tpcBuilder.cxx index 04582de0202..70bb6fbec1c 100644 --- a/OnlTools/Jevp/StJevpBuilders/tpcBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/tpcBuilder.cxx @@ -490,104 +490,104 @@ void tpcBuilder::initialize(int argc, char *argv[]) { int pl_qs_idx = n+1; plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s1); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s1); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s1); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s2); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s2); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s2); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s3); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s3); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s3); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s4); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s4); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s4); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s5); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s5); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s5); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s6); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s6); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s6); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s7); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s7); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s7); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s8); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s8); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s8); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s9); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s9); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s9); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s10); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s10); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s10); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s11); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s11); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s11); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s12); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s12); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s12); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s13); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s13); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s13); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s14); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s14); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s14); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s15); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s15); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s15); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s16); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s16); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s16); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s17); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s17); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s17); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s18); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s18); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s18); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s19); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s19); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s19); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s20); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s20); - // plots[n]->logy = 1; + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s20); + // plots[n]->logy = 1; plots[n]->logy = 1; plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s21); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s21); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s21); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s22); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s22); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s22); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s23); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s23); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s23); plots[++n] = new JevpPlot(contents.h_itpc_chargeStep_s24); - plots[n]->addHisto(extras.cl_itpc_chargeStep_s24); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_itpc_chargeStep_s24); int pl_qs_idx_tpx = n+1; plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s1); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s1); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s1); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s2); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s2); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s2); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s3); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s3); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s3); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s4); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s4); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s4); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s5); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s5); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s5); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s6); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s6); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s6); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s7); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s7); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s7); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s8); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s8); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s8); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s9); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s9); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s9); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s10); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s10); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s10); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s11); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s11); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s11); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s12); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s12); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s12); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s13); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s13); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s13); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s14); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s14); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s14); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s15); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s15); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s15); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s16); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s16); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s16); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s17); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s17); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s17); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s18); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s18); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s18); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s19); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s19); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s19); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s20); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s20); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s20); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s21); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s21); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s21); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s22); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s22); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s22); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s23); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s23); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s23); plots[++n] = new JevpPlot(contents.h_tpx_chargeStep_s24); - plots[n]->addHisto(extras.cl_tpx_chargeStep_s24); + plots[n]->logy = 1; plots[n]->addHisto(extras.cl_tpx_chargeStep_s24); //plots[++n] = new JevpPlot(contents.h_tpc_drift_vel); diff --git a/OnlTools/Jevp/StJevpBuilders/trgBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/trgBuilder.cxx index 563465913b1..64b97208c29 100644 --- a/OnlTools/Jevp/StJevpBuilders/trgBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/trgBuilder.cxx @@ -9,6 +9,7 @@ #include "L2UpsilonResult.h" #include "Jevp/StJevpPlot/RunStatus.h" #include "StEvent/StTriggerData.h" +#include #include #include @@ -216,7 +217,10 @@ void trgBuilder::initialize(int argc, char *argv[]) { contents.eq3_board_occ_h->Sumw2(); contents.eq3_readout_time_h = new TH1D("eq3_readout_time_h", "EQ3 Readout Time", 100, 0, 1000); - + contents.BlueByTrigger_h = new TH1F("BlueBeamByTrigger_h", "Blue Beam By Trigger", 64,0,64); + contents.YellowByTrigger_h= new TH1F("YellowBeamByTrigger_h","Yellow Beam By Trigger", 64,0,64); + + // Add root histograms to Plots int np = sizeof(contents) / sizeof(TH1 *); @@ -523,7 +527,25 @@ void trgBuilder::initialize(int argc, char *argv[]) { plots[++n] = new JevpPlot(contents.eq3_readout_time_h); plots[n]->getHisto(0)->histo->GetXaxis()->SetTitle("Readout Time (usec)"); - + plots[++n] = new JevpPlot(contents.BlueByTrigger_h); + plots[n]->setDrawOpts("hist"); + for(int i=0;i<64;i+=10) { + contents.BlueByTrigger_h->GetXaxis()->SetBinLabel(i+1, Form("%d", i)); + } + contents.BlueByTrigger_h->GetXaxis()->SetTitle("Trigger Index"); + contents.BlueByTrigger_h->GetYaxis()->SetTitle("Average Blue Sync Set"); + contents.BlueByTrigger_h->SetFillColor(4); + + plots[++n] = new JevpPlot(contents.YellowByTrigger_h); + plots[n]->setDrawOpts("hist"); + for(int i=0;i<64;i+=10) { + contents.YellowByTrigger_h->GetXaxis()->SetBinLabel(i+1, Form("%d", i)); + } + contents.YellowByTrigger_h->GetXaxis()->SetTitle("Trigger Index"); + contents.YellowByTrigger_h->GetYaxis()->SetTitle("Average Yellow Sync Set"); + contents.YellowByTrigger_h->SetFillColor(5); + + // Add Plots to plot set... for(int i=0;i<=n;i++) { LOG(NOTE, "Adding plot %d",i); @@ -535,6 +557,12 @@ void trgBuilder::startrun(daqReader *rdr) { LOG(DBG, "TriggerPlotBuilder starting run #%d",rdr->run); resetAllPlots(); first_event = 0; + + for(int i=0;i<64;i++) { + nBlueByTrigger[i] = 0; + nYellowByTrigger[i] = 0; + nTrigger[i] = 0; + } } void trgBuilder::fillQtHisto(int conf_num, TriggerDataBlk *trg, TH1D *sz, TH1D *usec, TProfile *board_occ) { @@ -694,18 +722,52 @@ void trgBuilder::event(daqReader *rdr) //Spin Bits // int ispinb = trgd->spinBit(); - if(trgd->spinBitYellowFilled()) contents.h442_bunch_yellow_fill->Fill(bunch7bit); + bool blueFilled = false; + bool yellowFilled = false; + if(trgd->spinBitYellowFilled()) { + contents.h442_bunch_yellow_fill->Fill(bunch7bit); + yellowFilled = true; + } + /* if(trgd->spinBitYellowUp()) contents.h443_bunch_yellow_up->Fill(bunch7bit); if(trgd->spinBitYellowDown()) contents.h444_bunch_yellow_down->Fill(bunch7bit); if(trgd->spinBitYellowUnpol()) contents.h445_bunch_yellow_unpol->Fill(bunch7bit); */ - if(trgd->spinBitBlueFilled()) contents.h446_bunch_blue_fill->Fill(bunch7bit); + if(trgd->spinBitBlueFilled()) { + contents.h446_bunch_blue_fill->Fill(bunch7bit); + blueFilled = true; + } /* if(trgd->spinBitBlueUp()) contents.h447_bunch_blue_up->Fill(bunch7bit); if(trgd->spinBitBlueDown()) contents.h448_bunch_blue_down->Fill(bunch7bit); if(trgd->spinBitBlueUnpol()) contents.h449_bunch_blue_unpol->Fill(bunch7bit); */ + + for(int i=0;i<64;i++) { + + + + if(rdr->daqbits64 & (1ll << i)) { + if(blueFilled) nBlueByTrigger[i]++; + if(yellowFilled) nYellowByTrigger[i]++; + nTrigger[i]++; + } + float bval = 0; + if(nTrigger[i] > 0) { + bval = nBlueByTrigger[i]; + bval /= nTrigger[i]; + } + contents.BlueByTrigger_h->SetBinContent(i+1, bval); + //if(bval > 0) printf("[%d] bval=%f\n",i, bval); + float yval = 0; + if(nTrigger[i] > 0) { + yval = nYellowByTrigger[i]; + yval /= nTrigger[i]; + } + contents.YellowByTrigger_h->SetBinContent(i+1, yval); + //if(bval > 0) printf("[%d] bval=%f\n",i, yval); + } // zdcsmd... TH1 *zdcsmd[12]; diff --git a/OnlTools/Jevp/StJevpBuilders/trgBuilder.h b/OnlTools/Jevp/StJevpBuilders/trgBuilder.h index 39074483b4d..286f48de8e1 100644 --- a/OnlTools/Jevp/StJevpBuilders/trgBuilder.h +++ b/OnlTools/Jevp/StJevpBuilders/trgBuilder.h @@ -181,12 +181,17 @@ class trgBuilder : public JevpBuilder { TH1* eq3_board_occ_h; TH1* eq3_readout_time_h; - + TH1* BlueByTrigger_h; + TH1* YellowByTrigger_h; }; } contents; int mNumberOfHotTowers; int mHotTowerChanges; - + + int nBlueByTrigger[64]; + int nYellowByTrigger[64]; + int nTrigger[64]; + ClassDef(trgBuilder, 1); }; diff --git a/OnlTools/Jevp/StJevpBuilders/vpdBuilder.cxx b/OnlTools/Jevp/StJevpBuilders/vpdBuilder.cxx index 8c5aeaf6b05..e81fe1be3f3 100644 --- a/OnlTools/Jevp/StJevpBuilders/vpdBuilder.cxx +++ b/OnlTools/Jevp/StJevpBuilders/vpdBuilder.cxx @@ -4,7 +4,8 @@ #include "JevpBuilder.h" #include "DAQ_READER/daqReader.h" #include "Jevp/StJevpPlot/RunStatus.h" -#include "StEvent/StTriggerData2016.h" +//#include "StEvent/StTriggerData.h" +#include "StEvent/StTriggerData.h" #include #include @@ -23,6 +24,9 @@ // It has no plots (currently) // +#define VHRBIN2PS 24.4140625 // Very High resolution mode, pico-second per bin +#include "PhysicalConstants.h" +#include "phys_constants.h" ClassImp(vpdBuilder); @@ -61,7 +65,7 @@ void vpdBuilder::initialize(int argc, char *argv[]) { contents.cdb[3]->SetYTitle("Low-Th TAC (west)"); sprintf(tmp,"vpd_tac_east_vs_tac_west"); - contents.tac_east_vs_tac_west = new TH2D(tmp,"VPD-vtx TAC East vs. TAC West", 256, -1.5, 4094.5, 256, -1.5, 4094.5); + contents.tac_east_vs_tac_west = new TH2D(tmp,"VPD-vtx BBQ maxTAC East vs. TAC West", 256, -1.5, 4094.5, 256, -1.5, 4094.5); contents.tac_east_vs_tac_west->SetXTitle("TAC West"); contents.tac_east_vs_tac_west->SetYTitle("TAC East"); @@ -126,6 +130,8 @@ void vpdBuilder::initialize(int argc, char *argv[]) { // sprintf(tmp,"vtx_TAC_diff"); // contents.vtx_TAC_diff = new TH1D( tmp, "TAC Diff; - ", 200, -100, 100 ); + sprintf(tmp,"h1_VpdVz_BBQ"); + contents.h1_VpdVz_BBQ = new TH1D( tmp, "VpdVz from BBQ maxTAC(East-West) (cm)", 200, -200., 200. ); //sprintf(tmp,"vpd_hi_vertex_vs_l3_vertex"); @@ -166,6 +172,7 @@ void vpdBuilder::initialize(int argc, char *argv[]) { plots[++n] = new JevpPlot(contents.hi_cdb[3]); plots[++n] = new JevpPlot(contents.hi_tac_east_vs_tac_west); //plots[++n] = new JevpPlot(contents.hi_vertex_vs_l3_vertex); + plots[++n] = new JevpPlot(contents.h1_VpdVz_BBQ); plots[++n] = new JevpPlot(contents.hi_earliestTAC_vs_eastchan); plots[++n] = new JevpPlot(contents.hi_earliestTAC_vs_westchan); @@ -201,14 +208,25 @@ void vpdBuilder::stoprun(daqReader *rdr) { void vpdBuilder::event(daqReader *rdr) { LOG(DBG, "event #%d",rdr->seq); - StTriggerData2016 *trgd = (StTriggerData2016*)getStTriggerData(rdr); + StTriggerData *trgd = (StTriggerData*)getStTriggerData(rdr); if(!trgd) { LOG(DBG, "No trigger data"); return; } -// int maxTacEast = trgd->vpdEarliestTDC((StBeamDirection)0); -// int maxTacWest = trgd->vpdEarliestTDC((StBeamDirection)1); + // int maxTacEast = trgd->vpdEarliestTDC((StBeamDirection)0); + // int maxTacWest = trgd->vpdEarliestTDC((StBeamDirection)1); + + //Zaochen test + //BBQ DATA + int maxTacEast_VPD_BBQ = trgd->vpdEarliestTDC((StBeamDirection)east); + int maxTacWest_VPD_BBQ = trgd->vpdEarliestTDC((StBeamDirection)west); + //MXQ DATA + int maxTacEast_VPD_MXQ = trgd->vpdEarliestTDCHighThr((StBeamDirection)east); + int maxTacWest_VPD_MXQ = trgd->vpdEarliestTDCHighThr((StBeamDirection)west); + + const double test_unit_const = VHRBIN2PS/1000.; + const double VpdVz_BBQ = test_unit_const*(maxTacEast_VPD_BBQ - maxTacWest_VPD_BBQ)/2.*(C_C_LIGHT/1.e9); // EAST = 0 // WEST = 1 @@ -245,6 +263,7 @@ void vpdBuilder::event(daqReader *rdr) { } } + if ( goodHit( adc_lo, tdc_lo ) ){ contents.cdb[2*side+0]->Fill(ich, adc_lo); contents.cdb[2*side+1]->Fill(ich, tdc_lo); @@ -252,7 +271,9 @@ void vpdBuilder::event(daqReader *rdr) { } } - contents.tac_east_vs_tac_west->Fill(sumTAC[0] / (float)nHit[0], sumTAC[1] / (float)nHit[1]); + //Zaochen test + contents.tac_east_vs_tac_west->Fill(maxTacWest_VPD_BBQ*1.0, maxTacEast_VPD_BBQ*1.0); + //contents.tac_east_vs_tac_west->Fill(sumTAC[0] / (float)nHit[0], sumTAC[1] / (float)nHit[1]); if (maxTAC[0]>200){ contents.earliestTAC_vs_eastchan->Fill(earliestChan[0],maxTAC[0]); @@ -269,7 +290,13 @@ void vpdBuilder::event(daqReader *rdr) { int On_sumTacWest = trgd->bbcVP101( 7 ); int On_sumAdcWest = (trgd->bbcVP101( 6 )&0xfff); int On_nHitsWest = (trgd->bbcVP101( 6 )>>12); - + + if(maxTacEast_VPD_BBQ>180&&maxTacEast_VPD_BBQ<3000 && maxTacWest_VPD_BBQ>180&&maxTacWest_VPD_BBQ<3000 + ) + { + contents.h1_VpdVz_BBQ ->Fill( VpdVz_BBQ ) ; + } + // contents.vtx_TAC_diff->Fill( (sumTAC[1] / (float)nHit[1]) - (sumTAC[0] / (float)nHit[0]) ); // if ( On_nHitsWest > 0 && On_nHitsEast > 0 ) // contents.vtx_TAC_diff->Fill( (On_sumTacWest / On_nHitsWest) - (On_sumTacEast / On_nHitsEast) ); @@ -365,7 +392,11 @@ void vpdBuilder::event(daqReader *rdr) { } } } + + //Zaochen test + //contents.hi_tac_east_vs_tac_west->Fill(maxTacWest_VPD_MXQ, maxTacEast_VPD_MXQ); contents.hi_tac_east_vs_tac_west->Fill(maxTacWestHigh, maxTacEastHigh); + if (maxTacEastHigh>200){ contents.hi_earliestTAC_vs_eastchan->Fill(earliestchan_east_hi,maxTacEastHigh); } @@ -520,7 +551,7 @@ void vpdBuilder::ReadConfig(){ } -int vpdBuilder::correctedTAC( StTriggerData2016 * td, int side, int channel ){ +int vpdBuilder::correctedTAC( StTriggerData * td, int side, int channel ){ diff --git a/OnlTools/Jevp/StJevpBuilders/vpdBuilder.h b/OnlTools/Jevp/StJevpBuilders/vpdBuilder.h index 2095377a559..7e15f21cfcd 100644 --- a/OnlTools/Jevp/StJevpBuilders/vpdBuilder.h +++ b/OnlTools/Jevp/StJevpBuilders/vpdBuilder.h @@ -5,7 +5,7 @@ class daqReader; //#include "RunStatus.h" -class StTriggerData2016; +class StTriggerData; #include #include @@ -55,7 +55,7 @@ class vpdBuilder : public JevpBuilder { return true; } - int correctedTAC( StTriggerData2016 * td, int side, int channel ); + int correctedTAC( StTriggerData * td, int side, int channel ); vector expected_pulser_means_east; //= { 1054, 1328, 1294, 1040 }; vector expected_pulser_means_west; //= { 1422, 1317, 1233, 1166}; @@ -97,6 +97,7 @@ class vpdBuilder : public JevpBuilder { // TH1 *pulser_west[4]; // TH1 *vtx_TAC_diff; + TH1* h1_VpdVz_BBQ; }; } contents; diff --git a/OnlTools/Jevp/StJevpData/HistoDefs.txt b/OnlTools/Jevp/StJevpData/HistoDefs.txt index 25926ba01dd..06a5180110d 100644 --- a/OnlTools/Jevp/StJevpData/HistoDefs.txt +++ b/OnlTools/Jevp/StJevpData/HistoDefs.txt @@ -165,7 +165,7 @@ bbc_h204_bbc_tac_difference_e-w - tof_upvpd_eastT_vs_westT + h1_VpdVz_BBQ trg_h146_zdc_Vertex_cm diff --git a/OnlTools/Jevp/StJevpViewer/TGTab2.cxx b/OnlTools/Jevp/StJevpViewer/TGTab2.cxx index 1b29dedbde9..1e75a889296 100644 --- a/OnlTools/Jevp/StJevpViewer/TGTab2.cxx +++ b/OnlTools/Jevp/StJevpViewer/TGTab2.cxx @@ -42,6 +42,7 @@ #include "Riostream.h" #include "TClass.h" #include "TGPicture.h" +#include "TVirtualX.h" const TGFont *TGTab2::fgDefaultFont = 0; const TGGC *TGTab2::fgDefaultGC = 0; diff --git a/OnlTools/Jevp/level.source b/OnlTools/Jevp/level.source index ff95b379f3e..5d6ad67bccd 100644 --- a/OnlTools/Jevp/level.source +++ b/OnlTools/Jevp/level.source @@ -1,4 +1,4 @@ # STAR LEVEL for EVP code -stardev +starver SL23b #starver SL21b diff --git a/StDb/idl/StvHitErrs.idl b/StDb/idl/StvHitErrs.idl deleted file mode 100644 index 4c9791101c8..00000000000 --- a/StDb/idl/StvHitErrs.idl +++ /dev/null @@ -1,16 +0,0 @@ -/* HitError.idl -* -* Table: StvHitErrs -* Description: Simplest parameters used to calculate hit errors -* Typical case some pixel detector. X axis supposed to be orthogonal -* to hit plane. Errors provided only for Y,Z coordinates in a local frame -* - yErr => Y resolution **2 in local frame - zErr => Z resolution **2 in local frame -*/ - -struct StvHitErrs -{ -double yErr ; /* Y resolution **2 in local frame */ -double zErr ; /* Z resolution **2 in local frame */ -}; diff --git a/StDb/idl/StvKonst.idl b/StDb/idl/StvKonst.idl deleted file mode 100644 index f4696393856..00000000000 --- a/StDb/idl/StvKonst.idl +++ /dev/null @@ -1,52 +0,0 @@ -/* Stv constants */ - -struct StvKonst { - float mXi2Hit; /*Xi2 to accept new hit*/ - float mXi2Vtx; /*Xi2 to accept vertex */ - float mXi2Joi; /*Xi2 in Refit join left & right subtrack*/ - float mXi2Trk; /*Xi2 for track */ - float mXi2Hlx; /*Xi2 in Helix */ - float mDca2dZeroXY; /*max 2d dca to X=Y=0 for primary track*/ - float mDca3dVertex; /*max 3d dca to vertex for primary track*/ - float mMaxCurv; /*Maximal allowed curvature*/ - float mMinP2; /*Minimal allowed momentum**2 for Geant3*/ - float mMaxPti; /*Maximal allowed 1/pt */ - float mMaxRes; /*Maximal allowed residual */ - float mCoeWindow; /*Error coeficient for searching window*/ - float mMaxWindow; /*Maximal window to search hits*/ - - long mMinSeedHits; /*Min number of seed hits allowed MidEta*/ - long mMaxSeedHits; /*Max number of seed hits allowed MidEta*/ - - long mMinHits; /*Min number of hits allowed MidEta*/ - long mNorHits; /*Normal number of hits allowed MidEta*/ - long mGoodHits; /*Min umber of Good hits in track MidEta*/ - - long mMinTotHits; /*Min number hits per track*/ - long mMinGoodHits; /*Min number good hits for track*/ - long mMinContHits; /*Min length of good hit sequence*/ - long mMaxContNits; /*Max length of acceptable non hit sequence*/ - long mMaxTotNits; /*Max number of acceptable non hits*/ - float mRxyMax; /*Max radius for tracking*/ - float mZMax; /*Max Z for tracking*/ - - - long mMinSeedHitsFw; /*Min number of seed hits allowed MidEta*/ - long mMaxSeedHitsFw; /*Max number of seed hits allowed MidEta*/ - - long mMinHitsFw; /*Min number of hits allowed forwEta*/ - long mNorHitsFw; /*Normal number of hits allowed forwEta*/ - long mGoodHitsFw; /*Min umber of Good hits in track forwEta*/ - - long mMinTotHitsFw; /*Min number hits per track forwEta*/ - long mMinGoodHitsFw; /*Min number good hits for track forwEta*/ - long mMinContHitsFw; /*Min length of good hit sequence forwEta*/ - long mMaxContNitsFw; /*Max length of acceptable non hit sequence forwEta*/ - long mMaxTotNitsFw; /*Max number of acceptable non hits*/ - float mRxyMaxFw; /*Max radius for tracking*/ - float mZMaxFw; /*Max Z for tracking*/ - - -}; - - diff --git a/StDb/idl/StvTpcHitErrs.idl b/StDb/idl/StvTpcHitErrs.idl deleted file mode 100644 index 0d6e1d43a85..00000000000 --- a/StDb/idl/StvTpcHitErrs.idl +++ /dev/null @@ -1,39 +0,0 @@ -/* StvTpcHitErrs.idl -* -* Table: StvTpcHitErrs -* Description: Collection of parameters used to calculate hit errors. -* There should be one such parameter set for each detector. Some detectors, such -* as the TPC may have more. -* - yErr => Intrinsic resolution, padrow or Y direction - zErr => Intrinsic resolution, Z direction - thkDet=> Effective detector thickness , not fitted - yyDiff=> Diffusion in XY direction - zzDiff=> Diffusion in Z direction - yFact=> Error factor in Y-direction (supposed to be <1 but life is hard) - zFact=> Error factor in Z-direction (supposed to be <1 but life is hard) - zAB2 => Constant member in Z direction (a*b)**2 - - = thkDet/12 - = (tP2*thkDet/12 +yyDiff/cP2)*yFact**2 +yErr - = (tL2/cP2*(thkDet/12 + yyDiff) +zAB2/180/cP2 + zzDiff)*zFact**2+zErr - - = tP * thkDet/12 *yFact - = tL/cP*(thkDet/12)*zFact - = (tP*tL)/cP*((thkDet/12 + yyDiff/yFact))*yFact*zFact - - - -*/ - -struct StvTpcHitErrs -{ -double yErr ; /* Intrinsic resolution, padrow or Y direction */ -double zErr ; /* Intrinsic resolution, z direction */ -double thkDet; /* detector thickness , not fitted */ -double yyDiff; /* Diffusion in XY direction */ -double zzDiff; /* Diffusion in Z direction */ -double yFact ; /* Error factor in Y-direction */ -double zFact ; /* Error factor in Z-direction */ -double zAB2 ; /* Constant member in Z direction (a*b)**2 */ -}; diff --git a/StDb/idl/pidCorrection.idl b/StDb/idl/pidCorrection.idl new file mode 100644 index 00000000000..5dfd9de8831 --- /dev/null +++ b/StDb/idl/pidCorrection.idl @@ -0,0 +1,26 @@ +//:Description: Drift Distance depended correction +//:Synonyms:::: +//:Source: +//:Update: +//:Update frequncy: +//:Reminder: +//:Recall frequency: +//:Size of Data: +//:Pointer to data: pidCorrection.time: +struct pidCorrection { + long idx; // row index > 0 if it is real + long nrows; // total no. of real rows in the table; For Db interface (where nrows = 50) + long type; // type = 0 polymonical fit, use only [min,max] + long var; // fit variable: 0 => pmomL10, 1 => bgL10, + long particle; // from StEvent/StPidParticleDefinition.h : kUndef = -1, kPidElectron = 0, Proton = 1, Kaon = 2, Pion = 3, Muon = 4, Deuteron = 5, Triton = 6, + // He3 = 7, Alpha = 8, He6 = 9, Li5 = 10, Li6,= 11, Li7 = 12, Be7 = 13, Be9 = 14, Be10 = 15, B11 = 16 + long charge; // +/-1, 0 does not matter + long pull; // != 0 calculated pull correction, == 0 to value + long det; // from StdEdxY2Maker/StTrackPiD.h : kUndef = 0, kI70 = 1, kI70U = 2, kFit = 3, kFitU = 4, kdNdx = 5, kdNdxU = 6, kBTof -7 , kETof = 8, kMtd = 9, kBEmc = 10 + long npar; // npar < 0, X = exp(x) paramterization; abs(npar) >= 100 cut on range [min.max] + double OffSet; // for future use + double min; // fit range + double max; // + double a[10]; // a[npar] + char comment[32]; +}; diff --git a/StDb/idl/tpcExtraGainCorrection.idl b/StDb/idl/tpcExtraGainCorrection.idl index 389e7bcd0ad..0464da5bb7e 100644 --- a/StDb/idl/tpcExtraGainCorrection.idl +++ b/StDb/idl/tpcExtraGainCorrection.idl @@ -5,15 +5,15 @@ * description: list of pad with bad pulser data */ struct tpcExtraGainCorrection { - octet idx; // active line number >= 1 - octet nrows;// total no. of active rows; + short idx; // active line number >= 1 + short nrows;// total no. of active rows; long runMin; long runMax; - octet sector; - octet row; + short sector; + short row; short padMin; short padMax; - octet RDO; - octet FEE; // if positive reactivate intire FEE else if negative use row and [padMin,padMax] range - octet status; // 0 => dead, 1 => Alive + short RDO; + short FEE; // if positive reactivate intire FEE else if negative use row and [padMin,padMax] range + short status; // 0 => dead, 1 => Alive }; diff --git a/StRoot/PWGTools/BadRunQA/QA.py b/StRoot/PWGTools/BadRunQA/QA.py index bf3fcbe05bc..fdd1f579dd4 100644 --- a/StRoot/PWGTools/BadRunQA/QA.py +++ b/StRoot/PWGTools/BadRunQA/QA.py @@ -4,6 +4,7 @@ from plotRejection import plotOutlier, appendRunInfo import plotRejection as pr +import sys import matplotlib.pyplot as plt import argparse import numpy as np @@ -14,8 +15,9 @@ def segmentAndReject(runs, x, xerr, pen=1, min_size=10, gamma=None, stdRange=5, maxIter=100, useJMLR=False, useMAD=False, weights=None, segmentOnce=False, - merge=False, reCalculateNormal=False, legacy=False, globalRejection=False, - quadRange=False, **kwargs): + merge=False, reCalculateNormal=False, legacy=False, globalRejection=None, + quadRange=False, grVarID=None, **kwargs): + if useJMLR: print('Execution with JMLR') else: @@ -29,9 +31,20 @@ def segmentAndReject(runs, x, xerr, pen=1, min_size=10, gamma=None, stdRange=5, edgeRuns = [] i = 0 - runRj, reasonRj, mean, std = outlierDetector(runs_copy, x_copy, xerr_copy, edgeRuns, stdRange=stdRange, + + + if globalRejection is None: + globalRejection = np.inf + + if grVarID is not None: + grStdRange=np.full(x_copy.shape[1], np.inf, dtype=float) + grStdRange[grVarID] = globalRejection + else: + grStdRange=np.full(x_copy.shape[1], globalRejection, dtype=float) + + runRj, reasonRj, mean, std = outlierDetector(runs_copy, x_copy, xerr_copy, edgeRuns, stdRange=grStdRange, useMAD=useMAD, weights=weights, legacy=legacy, seqRej=False, quadRange=quadRange) - if globalRejection and runRj.shape[0] > 0: + if globalRejection is not None and runRj.shape[0] > 0: runsRejected.append(runRj) reasonsRejected.append(reasonRj) @@ -102,7 +115,7 @@ def printBanner(): print(pyfiglet.figlet_format('RUN BY RUN QA')) print(u'\u2500' * 100) print('Run-by-Run QA script for STAR data analysis') - print('Version 3.0') + print('Version 3.1.1') print('Contact: , , ') print(u'\u2500' * 100) @@ -119,7 +132,7 @@ def printBanner(): parser.add_argument('-i', '--input', required=True, help='ROOT files that contains all the QA TProfile') parser.add_argument('-o', '--output', required=True, help='Filename for the output text file with all the bad runs') parser.add_argument('-bo', '--breakptOutput', default='breakpt.txt', help='Filename for the output text file with the break points.') - parser.add_argument('-v', '--varNames', help='Txt files with all the variable names for QA. If it is not set, it will read ALL TProfiles in the ROOT file.') + parser.add_argument('-v', '--varNames', required=True, help='Txt files with all the variable names for QA. If it is not set, it will read ALL TProfiles in the ROOT file.') parser.add_argument('-e', '--element', default='??+??', help='Element of your reaction') parser.add_argument('-s', '--sNN', default='??', help='Beam energy') parser.add_argument('-rr', '--rejectionRange', type=float, default=5, help='The factor of SD range beyon which a run is rejected (default: %(default)s)') @@ -143,12 +156,24 @@ def printBanner(): parser.add_argument('-ei', '--excludeInvalid', action='store_true', help='Do not load any runs where uncertainty of any observables is zero from the get go, don\'t even count towards total number of runs.') parser.add_argument('-rn', '--reCalculateNormal', action='store_false', help='mean and standard deviation of data set is re-calculated in each iteration. (default: %(default)s)') parser.add_argument('-mi', '--mergeID', action='store_true', help='Merge nearby segments if their means are too close to each other, like within 5 SDs.') - parser.add_argument('-g', '--globalRejection', action='store_false', help='Run outliner rejection once before segmentation iteration. (default: %(default)s)') + parser.add_argument('-g', '--globalRejection', type=float, help='SD factor for global rejection range.') + parser.add_argument('-gv', '--globalRejectionVariable', help='Filename of txt file that contains observable that needs global rejection. Without it, global rejection is done on all observable.') parser.add_argument('-q', '--quadRange', action='store_false', help='Reject runs by adding uncertainty in quaduature instead of absolute value. (default: %(default)s)') parser.add_argument('-lg', '--legacy', action='store_true', help='Use legacy mode to emulate run-by-run v2') - args = parser.parse_args() + if args.globalRejection is None or args.globalRejectionVariable is None: + errMessage = """ +Update 6/26/2023: You are seeing this error because some optional arguments are now mandatory. +You are now REQUIRED to manally provide names of observables where global rejection is performed and the range of global rejection. + +Try: python QA.py ...... -g -gv + +Generally speaking, should containt name of TProfile for refmult. +It is recommended to perform global rejection ONLY on refmult. +Abort! +""" + raise TypeError(errMessage) if args.JMLR: print('Using JMLR to determine segmentation penality. Only use 1 core') args.cores = 1 @@ -167,8 +192,10 @@ def printBanner(): args.excludeInvalid = False args.reCalculateNormal = True args.mergeID = True - args.globalRejection = False + + args.globalRejection = None args.quadRange = True + args.globalRejectionVariable = None # read data from file print('Reading TProfile from %s' % (args.input)) @@ -183,6 +210,17 @@ def printBanner(): else: print('Those are the names of TProfiles in %s' % args.varNames) print('*'*100) + + print('*'*100) + if args.globalRejectionVariable is not None: + grVar = getVarNames(args.globalRejectionVariable) + else: + grVar = varNames + print('Observable used in global rejection:') + print('\n'.join(grVar)) + print('*'*100) + grVarID = [i for i, name in enumerate(varNames) if name in grVar] + runs, x, xerr, counts = readFromROOT(args.input, varNames, args.mapping, args.legacy) if args.excludeInvalid: id = np.all(xerr > 0, axis=1) @@ -215,7 +253,7 @@ def printBanner(): # run different penalty setting on different cores for ruj, rej, me, st, ed, pe, i in pool.imap(partial(segmentAndReject, runs, x, xerr, useJMLR=args.JMLR, useMAD=args.MAD, min_size=args.minSize, stdRange=args.rejectionRange, maxIter=args.maxIter, - weights=weights, segmentOnce=args.segmentOnce, merge=args.mergeID, + weights=weights, segmentOnce=args.segmentOnce, merge=args.mergeID, grVarID=grVarID, reCalculateNormal=args.reCalculateNormal, legacy=args.legacy, globalRejection=args.globalRejection, quadRange=args.quadRange), args.pen): # choose penalty that rejectes the most number of runs diff --git a/StRoot/PWGTools/BadRunQA/README.md b/StRoot/PWGTools/BadRunQA/README.md index a9b3693f803..c4fdce5372d 100644 --- a/StRoot/PWGTools/BadRunQA/README.md +++ b/StRoot/PWGTools/BadRunQA/README.md @@ -40,8 +40,9 @@ If you are using "conda" or any other virtual environment, you can replace all " To use the software, follow these steps: 1. Prepare a ROOT file with one or more TProfiles in it. -2. (Optional, skip if you use all TProfiles in the ROOT file) Prepare a text file with names of TProfiles you want to use. Use line breaks to separate the names. -3. Run the following command `python3 QA.py -i -v -o badrun.list` +2. Prepare a text file with names of TProfiles you want to use. Use line breaks to separate the names. +3. (New 6/26/2023) Prepare a text file with names of TProfile to which global rejection is performed. You can reuse txt file from step 2. +4. Run the following command `python3 QA.py -i -v -o badrun.list -g -gv ` QA plots will appear for review. Close all the windows and it will generate `badrun.list`. It shows outlier runs and the reasons for their rejections. @@ -104,4 +105,7 @@ Check `python3 plotRejection.py -h` when in doubt. You need to tell it what's the reaction system and beam energy. Run with `python3 QA.py -i -v -o badrun.list `**`-e Au+Au -s 9.8`** (assuming you are doing QA on Au + Au at sqrt(s_NN) = 9.8 GeV) +### You only want global rejection on some observables. + +Prepare a text file with the names of the TProfiles where global rejection is needed. Run `python3 QA.py -i -v -o badrun.list -gv ` diff --git a/StRoot/PWGTools/BadRunQA/runLog/UI.py b/StRoot/PWGTools/BadRunQA/runLog/UI.py index 4ffdbc7a6ac..25611d0b838 100644 --- a/StRoot/PWGTools/BadRunQA/runLog/UI.py +++ b/StRoot/PWGTools/BadRunQA/runLog/UI.py @@ -7,6 +7,7 @@ from prompt_toolkit.widgets import Box, Button, Frame, Label, TextArea from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl from prompt_toolkit.key_binding.bindings.page_navigation import scroll_one_line_up, scroll_one_line_down +from prompt_toolkit.filters import has_focus from enum import Enum import shiftLogByShift as sl @@ -25,12 +26,15 @@ SUMMARYHIGHLIGHT = None INTROTEXT = "Control with (up, down, left, right), Pg Up, Pg Down and Enter keys. Shortcut: q is good-run, w is bad-run and tab is go back." REASONS = None # Reason for each run to be here. Should be list of string +RUNMEMO = None # text - -def on_change(): +def on_change(prev_id): + global RUNMEMO GoBackButton.text = 'Go Back' ExitButton.text = 'Exit %d/%d' % (CURRID+1, len(KEYS)) + RUNMEMO[prev_id] = memo_area.text if CURRID < len(KEYS): + memo_area.text = RUNMEMO[CURRID] text_reason.text = 'Current run = %s for reason %s' % (KEYS[CURRID], REASONS[CURRID]) if SUMMARYHIGHLIGHT is None: summary_sentement_label.text = '' @@ -78,7 +82,7 @@ def good_clicked(): left_clicked() CURRID = CURRID + 1 MULTABLE = True - on_change() + on_change(CURRID - 1) def bad_clicked(): global RESULT, IDSTATUS, CURRID, KEYS, MULTABLE @@ -88,7 +92,7 @@ def bad_clicked(): IDSTATUS[CURRID] = STATUS.BAD CURRID = CURRID + 1 MULTABLE = True - on_change() + on_change(CURRID - 1) def back_clicked(): @@ -96,14 +100,14 @@ def back_clicked(): if ExitButton.text == 'Confirm Exit': # abort exit. Go back to previous run MULTABLE = True - on_change() + on_change(CURRID) return if CURRID < 0: return if CURRID > 0: CURRID = CURRID - 1 MULTABLE = True - on_change() + on_change(CURRID + 1) def exit_clicked(): @@ -189,6 +193,9 @@ def get_summary_style() -> str: return 'class:indicator-bad' return 'class:indicator-good' +memo_area = TextArea(prompt='Run memo>>>', text='Anthing written here will be saved in the selected bad run list.', multiline=True, wrap_lines=True, focusable=True, style='class:input-field') + + # Combine all the widgets in a UI. # The `Box` object ensures that padding will be inserted around the containing # widget. It adapts automatically, unless an explicit `padding` amount is given. @@ -201,7 +208,7 @@ def get_summary_style() -> str: [ Box( body=HSplit([GoodRunButton, BadRunButton, GoBackButton, ExitButton, - Box(body=TextArea(focusable=False), style='class:left-pane'), + Frame(memo_area, style='class:input-field'), Box(body=entry_sentement_label, style=get_entry_style, height=1), Box(body=history_sentement_label, style=get_history_style, height=1), Box(body=summary_sentement_label, style=get_summary_style, height=1)], padding=1, width=25), @@ -227,11 +234,23 @@ def get_summary_style() -> str: @kb.add("left") def _(event): - left_clicked() + if event.app.layout.has_focus(memo_area): + #"Move back a character." + buff = event.current_buffer + buff.cursor_position += buff.document.get_cursor_left_position(count=event.arg) + else: + left_clicked() + @kb.add("right") def _(event): - right_clicked() + if event.app.layout.has_focus(memo_area): + #"Move back a character." + buff = event.current_buffer + buff.cursor_position += buff.document.get_cursor_right_position(count=event.arg) + else: + right_clicked() + @kb.add("pageup") def _(event): @@ -249,18 +268,27 @@ def _(event): @kb.add("w") def _(event): - event.app.layout.focus(BadRunButton) - bad_clicked() + if event.app.layout.has_focus(memo_area): + event.app.current_buffer.insert_text("w") + else: + event.app.layout.focus(BadRunButton) + bad_clicked() @kb.add("q") def _(event): - event.app.layout.focus(GoodRunButton) - good_clicked() + if event.app.layout.has_focus(memo_area): + event.app.current_buffer.insert_text("q") + else: + event.app.layout.focus(GoodRunButton) + good_clicked() @kb.add('tab') def _(event): - event.app.layout.focus(GoBackButton) - back_clicked() + if event.app.layout.has_focus(memo_area): + event.app.current_buffer.insert_text("\t") + else: + event.app.layout.focus(GoBackButton) + back_clicked() @@ -276,6 +304,7 @@ def _(event): ("button focused", "bg:#ff0000"), ("text-area focused", "bg:#ff0000"), ("label", "bg:#000000"), + ("input-field", "bg:#000000 #ffffff") ] ) @@ -285,7 +314,7 @@ def _(event): def main(result, reasons, badKeys=None, badHistory=None, badSummary=None, intro=''): - global RESULT, IDSTATUS, CURRID, KEYS, TEXTTYPE, HIGHLIGHT, REASONS, SUMMARYHIGHLIGHT, HISTORYHIGHLIGHT + global RESULT, IDSTATUS, CURRID, KEYS, TEXTTYPE, HIGHLIGHT, REASONS, SUMMARYHIGHLIGHT, HISTORYHIGHLIGHT, RUNMEMO # remove empty entry KEYS = [] RESULT = {} @@ -300,6 +329,7 @@ def main(result, reasons, badKeys=None, badHistory=None, badSummary=None, intro= history_sentement_label.text = "" entry_sentement_label.text = "" TEXTTYPE = TEXT.HISTORY # the prompt is initialized by an automatic left click, so starts at center for the automatic left-click to be registered + RUNMEMO = [] # hash table is more efficient for lookup if badKeys is not None: @@ -314,6 +344,7 @@ def main(result, reasons, badKeys=None, badHistory=None, badSummary=None, intro= for key, content in result.items(): KEYS.append(key) + RUNMEMO.append('') if badKeys is not None: if key in badKeys: HIGHLIGHT.append(True) @@ -344,14 +375,16 @@ def main(result, reasons, badKeys=None, badHistory=None, badSummary=None, intro= application.run() pos = {} neg = {} - for status, key in zip(IDSTATUS, KEYS): + memo = {} + for status, key, m in zip(IDSTATUS, KEYS, RUNMEMO): + memo[key] = m if status == STATUS.GOOD: pos[key] = result[key] elif status == STATUS.BAD: neg[key] = result[key] else: raise RuntimeError('Selection incomplete. This should not have happened.') - return pos, neg + return pos, neg, memo if __name__ == "__main__": diff --git a/StRoot/PWGTools/BadRunQA/runLog/pageCache.py b/StRoot/PWGTools/BadRunQA/runLog/pageCache.py index 0afb7c74ecd..669cc181578 100644 --- a/StRoot/PWGTools/BadRunQA/runLog/pageCache.py +++ b/StRoot/PWGTools/BadRunQA/runLog/pageCache.py @@ -43,7 +43,7 @@ def getUrl(self, url, driver, timeout, expected_title): if 'error' in driver.title.lower() or 'unauthorize' in driver.title.lower(): raise RuntimeError('Cannot load shift log') - with open(os.path.join(self._dir, filename + '.html'), 'w') as f: + with open(os.path.join(self._dir, filename + '.html'), 'w', encoding='utf-8') as f: f.write('\n' + driver.page_source) time.sleep(self._timeSep) return driver.page_source diff --git a/StRoot/PWGTools/BadRunQA/runLog/shiftLog.py b/StRoot/PWGTools/BadRunQA/runLog/shiftLog.py index b697eb92f4e..37275eb8948 100644 --- a/StRoot/PWGTools/BadRunQA/runLog/shiftLog.py +++ b/StRoot/PWGTools/BadRunQA/runLog/shiftLog.py @@ -102,19 +102,27 @@ def main(input, timeStep, allOutput, badrun, posOutput, negOutput, useAI, thresh print('Saving human-readable shiftLog to %s' % allOutput) with open(allOutput, 'w') as f: f.write(printBriefDict(result)) - badRuns = None - badHistory = None - badSummary = None + badRuns = [] + badHistory = [] + badSummary = [] if useAI: - AIbadRuns, AIbadHistory, AIbadSummary= sentiment(result, useAI, threshold=threshold) - badRuns = junkID + AIbadRuns - badHistory = junkID + AIbadHistory - badSummary = junkID + AIbadSummary - intro = 'AI thinks that %d runLog entries out of a total of %d are bad runs.\nBackground color will turn for red for those runs that are considered bad.' % (len(AIbadRuns), len(result)) + badRuns, badHistory, badSummary= sentiment(result, useAI, threshold=threshold) + intro = 'AI thinks that %d runLog entries out of a total of %d are bad runs.\nBackground color will turn for red for those runs that are considered bad.' % (len(badRuns), len(result)) else: intro = 'There are %d runs to go through' % len(result) import UI - pos, neg = UI.main(result, reasons, badRuns, badHistory, badSummary, intro=intro) + pos, neg, memo = UI.main(result, reasons, badRuns + junkID if useAI else None, + badHistory + junkID if useAI else None, + badSummary + junkID if useAI else None, intro=intro) + for run in junkID: + memo[run] = 'MarkedJunk ' + memo[run] + if useAI: + for run in badRuns: + memo[run] = 'BadEntry ' + memo[run] + for run in badHistory: + memo[run] = 'BadHistory ' + memo[run] + for run in badSummary: + memo[run] = 'BadSummary ' + memo[run] for runID, content in neg.items(): neg[runID] = content if posOutput is not None: @@ -124,7 +132,7 @@ def main(input, timeStep, allOutput, badrun, posOutput, negOutput, useAI, thresh with open(negOutput, 'w') as f: f.write(printBriefDict(neg)) with open(badrun, 'w') as f: - f.write('\n'.join(neg.keys())) + f.write('\n'.join(['%s %s' % (id_, memo[id_]) for id_ in neg.keys()])) def printBanner(): diff --git a/StRoot/RTS/include/rtsLog.h b/StRoot/RTS/include/rtsLog.h index be8b087ab84..c93e3cd42bb 100755 --- a/StRoot/RTS/include/rtsLog.h +++ b/StRoot/RTS/include/rtsLog.h @@ -93,41 +93,14 @@ void rtsLogAddJmlFile (char *fname); -/*Tonko: not used Special (mis)handling for STAR Offline Code -#ifdef __ROOT__ -#define RTS_DISABLE_LOG -#endif -*/ -#ifdef RTS_DISABLE_LOG - -#define RTS_ASSERT(expr) assert(expr) - - - #define LOG(SEV,STRING,ARGS...) \ - do { \ - const char *const yada = SEV ; \ - if((*yada == 'E')) { \ - fprintf(stderr,"" ANSI_RED "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'C')) { \ - fprintf(stderr,"" ANSI_RED "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'I')) { \ - fprintf(stderr,"" ANSI_BLUE "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'T')) { \ - fprintf(stderr,"" ANSI_GREEN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'W')) { \ - fprintf(stderr,"" ANSI_CYAN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - else if((*yada == 'O')) { \ - fprintf(stderr,"" ANSI_BLUE "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\ - } \ - } while(0) \ +#ifndef RTS_ENABLE_LOG +#define RTS_ASSERT(expr) assert(expr) +#define LOG(SEV,STRING,ARGS...) +#define rtsLogUnix_v(str, ...) +#define rtsLogAddCmd(x) // the following become noops... @@ -136,7 +109,7 @@ void rtsLogAddJmlFile (char *fname); #define rtsLogLevelInt(x) #define rtsLogOutput(x) -#else /* RTS_DISABLE_LOG */ +#else /* RTS_ENABLE_LOG */ #ifdef __GNUC__ @@ -270,12 +243,12 @@ INLINE_HACK void rtsLogLevel(const char *level) -#endif +#endif /* RTS_LOG_COLORED */ -#endif +#endif /* __vxworks */ -#endif /* RTS_DISABLE_LOG */ +#endif /* RTS_ENABLE_LOG */ #ifdef __cplusplus } diff --git a/StRoot/RTS/src/DAQ_BSMD/daq_bsmd.cxx b/StRoot/RTS/src/DAQ_BSMD/daq_bsmd.cxx index 9482ac69b0b..61f6ac820b4 100644 --- a/StRoot/RTS/src/DAQ_BSMD/daq_bsmd.cxx +++ b/StRoot/RTS/src/DAQ_BSMD/daq_bsmd.cxx @@ -805,9 +805,12 @@ int daq_bsmd::get_l2(char *buff, int words, struct daq_trg_word *trg, int rdo) if(crc != crc_in_data) { LOG(ERR,"RDO %d: CRC in data 0x%08X, CRC calculated 0x%08X",rdo,crc_in_data,crc) ; - bad |= 1 ; + //bad |= 1 ; } } + else { +// LOG(WARN,"RDO %d: no CRC in data",rdo) ; + } LOG(DBG,"RDO %d: CRC in data 0x%08X, CRC calculated 0x%08X",rdo,crc_in_data,crc) ; #endif diff --git a/StRoot/RTS/src/DAQ_FCS/fcs_data_c.cxx b/StRoot/RTS/src/DAQ_FCS/fcs_data_c.cxx index d11add5c51a..6ce48b1ee93 100644 --- a/StRoot/RTS/src/DAQ_FCS/fcs_data_c.cxx +++ b/StRoot/RTS/src/DAQ_FCS/fcs_data_c.cxx @@ -2261,7 +2261,8 @@ int fcs_data_c::load_sc_map(const char *fname) // FPRE is special: Akio marked unused channels with non-0 if(dd==2) { - if(sipm!=0) { + //if(sipm!=0) { + if(sipm>=2) { // new for FY23 EPD use //LOG(TERR,"%d %d %d = %d",s,r,c,sipm) ; sipm = 0xFF ; } diff --git a/StRoot/RTS/src/DAQ_ITPC/daq_itpc.cxx b/StRoot/RTS/src/DAQ_ITPC/daq_itpc.cxx index 3ebf6cff80b..53ac60448bb 100644 --- a/StRoot/RTS/src/DAQ_ITPC/daq_itpc.cxx +++ b/StRoot/RTS/src/DAQ_ITPC/daq_itpc.cxx @@ -75,6 +75,8 @@ daq_itpc::daq_itpc(daqReader *rts_caller) it = new itpcInterpreter ; it23 = 0 ; // assume we won't use it + online = 0 ; + // it23 = new itpc23 ; // it23->no_cld = 1 ; // it23->log_level = 2 ; @@ -83,6 +85,8 @@ daq_itpc::daq_itpc(daqReader *rts_caller) fcf_det_type = 1 ; // ITPC fcf_det_orient = 1 ; // normal + + LOG(DBG,"%s: constructor: caller %p",name,rts_caller) ; return ; } @@ -527,7 +531,7 @@ daq_dta *daq_itpc::handle_sampa(int sec, int rdo, int in_adc) if(rdo_fmt>22) { if(it23==0) { it23 = new itpc23 ; - it23->online = 0 ; + it23->online = online ; // 0 ; it23->run_type = 3 ; // NO CLUSTER FINDER PLEASE it23->no_cld = 1 ; it23->log_level = 0 ; diff --git a/StRoot/RTS/src/DAQ_ITPC/daq_itpc.h b/StRoot/RTS/src/DAQ_ITPC/daq_itpc.h index 78e27aa80f4..5175a3a1907 100644 --- a/StRoot/RTS/src/DAQ_ITPC/daq_itpc.h +++ b/StRoot/RTS/src/DAQ_ITPC/daq_itpc.h @@ -73,6 +73,7 @@ class daq_itpc : public daq_det { static int no_sw16 ; + int online ; int rdo_fmt ; } ; diff --git a/StRoot/RTS/src/DAQ_ITPC/itpcInterpreter.cxx b/StRoot/RTS/src/DAQ_ITPC/itpcInterpreter.cxx index bb3937928f0..892008be455 100644 --- a/StRoot/RTS/src/DAQ_ITPC/itpcInterpreter.cxx +++ b/StRoot/RTS/src/DAQ_ITPC/itpcInterpreter.cxx @@ -52,7 +52,8 @@ int itpcInterpreter::itpc_fee_map[24][4][16] = { {//S5 checked {49,52,46, 0, 0, 54,0,47, 0,50, 0,55,48, 0,51,53}, {36,32,40,43,37,33, 0,41, 0,44,38,34,42,45,39,35}, - { 7, 1,17,12,24,19,13, 8,28, 2, 0,20,29,25,21, 3}, +// { 7, 1,17,12,24,19,13, 8,28, 2, 0,20,29,25,21, 3}, + { 7, 1,17,12,24,19,13, 8,28, 2, 3,20,29,25,21, 0}, { 9, 4,26,14,15,10,30,22,27, 5,31,23,18,16,11, 6} }, diff --git a/StRoot/RTS/src/DAQ_STGC/daq_stgc.cxx b/StRoot/RTS/src/DAQ_STGC/daq_stgc.cxx index 10d46c3b63b..221c25d68d5 100644 --- a/StRoot/RTS/src/DAQ_STGC/daq_stgc.cxx +++ b/StRoot/RTS/src/DAQ_STGC/daq_stgc.cxx @@ -534,7 +534,7 @@ daq_dta *daq_stgc::handle_vmm(int sec) stgc_d->xing_min = xing_min ; stgc_d->xing_max = xing_max ; -// LOG(WARN,"xing_min %d, xing_max %d",stgc_d->xing_min,stgc_d->xing_max) ; + LOG(NOTE,"xing_min %d, xing_max %d",stgc_d->xing_min,stgc_d->xing_max) ; // calc total bytes tot_bytes = 0 ; @@ -613,7 +613,7 @@ daq_dta *daq_stgc::handle_vmm(int sec) // fixed bug if(hits >= vmm_max) { - //LOG(ERR,"S%d:%d -- too many hits %d/%d",obj[i].sec,obj[i].rb,hits,vmm_max) ; + LOG(NOTE,"ERROR: S%d:%d -- too many hits %d/%d",obj[i].sec,obj[i].rb,hits,vmm_max) ; //break ; } else { diff --git a/StRoot/RTS/src/DAQ_TPC23/Makefile b/StRoot/RTS/src/DAQ_TPC23/Makefile index f54987d85ce..01eeaf19a75 100644 --- a/StRoot/RTS/src/DAQ_TPC23/Makefile +++ b/StRoot/RTS/src/DAQ_TPC23/Makefile @@ -79,7 +79,14 @@ tpx23.o: ../../../../StRoot/RTS/include/TPX/tpx_rdo.h tpx23.o: ../DAQ_TPX/tpxPed.h tpx23.o: ../DAQ_TPX/tpxCore.h tpx23.o: ../DAQ_TPX/tpxGain.h +tpx23.o: ../DAQ_ITPC/itpcPed.h tpx23.o: tpx23.h +tpx23.o: ../DAQ_READER/daq_dta.h +tpx23.o: ../../../../StRoot/RTS/include/rts.h +tpx23.o: ../DAQ_READER/daq_dta_structs.h tpx23.o: tpc23_base.h itpc23.o: tpc23_base.h +tpx23.o: ../DAQ_READER/daq_dta.h +tpx23.o: ../../../../StRoot/RTS/include/rts.h +tpx23.o: ../DAQ_READER/daq_dta_structs.h tpx23.o: tpc23_base.h diff --git a/StRoot/RTS/src/DAQ_TPC23/itpc23.cxx b/StRoot/RTS/src/DAQ_TPC23/itpc23.cxx index c455af360d2..66ebfc5e071 100644 --- a/StRoot/RTS/src/DAQ_TPC23/itpc23.cxx +++ b/StRoot/RTS/src/DAQ_TPC23/itpc23.cxx @@ -34,7 +34,7 @@ static inline u_int sw16(u_int d) return d ; } -inline void itpc23::set_rdo(int sec, int rdo) +inline u_int itpc23::set_rdo(int sec, int rdo) { // LOG(TERR,"set_rdo %d: S%02d:%d",id,sec,rdo) ; @@ -42,6 +42,8 @@ inline void itpc23::set_rdo(int sec, int rdo) rdo1 = rdo ; fee_mask = get_ifee_mask(sector1,rdo1) ; + + return fee_mask ; } ; // Change the data format from the old FY22 version to the new @@ -51,11 +53,13 @@ int itpc23::from22to23(char *c_dta, int words) int n_words = words ; u_int *data = (u_int *)c_dta ; - u_int *d_use = (u_int *)malloc(words*4) ; // allocate sotrage + u_int *d_use = (u_int *)malloc(words*4+1024) ; // allocate sotrage u_int *data_end = data + words ; u_int *data_start = data ; + err = 0 ; // in class + // this is wrong! I need to get it from the data!! fee_mask = get_ifee_mask(sector1,rdo1) ; @@ -90,7 +94,8 @@ int itpc23::from22to23(char *c_dta, int words) if((data[0]&0xFFFF000F) != 0x98000004) { run_errors++ ; - if(run_errors<5) LOG(ERR,"start 0 0x98 = 0x%08X",data[0]) ; + if(run_errors<5 && online) LOG(ERR,"start 0 0x98 = 0x%08X",data[0]) ; + err |= 0x10000000 ; } // LOG(TERR,"wds 0x%08X 0x%08X; data end 0x%08X",data[0],data[1],data_end[0]) ; @@ -135,6 +140,7 @@ int itpc23::from22to23(char *c_dta, int words) if(!found) { run_errors++ ; + err |= 0x20000000 ; if(run_errors<5) LOG(ERR,"%d: can't find data_end!",rdo1) ; } @@ -155,6 +161,7 @@ int itpc23::from22to23(char *c_dta, int words) if(!found) { run_errors++ ; + err |= 0x20000000 ; if(run_errors<5) LOG(ERR,"%d: data_end 0x98 not found = 0x%08X",rdo1,data_end[0]) ; } @@ -189,8 +196,11 @@ int itpc23::from22to23(char *c_dta, int words) if(online) { if(l_fee_mask != fee_mask) { + err |= 0x40000000 ; run_errors++ ; if(run_errors<5) LOG(ERR,"%d: FEE mask 0x%X, expect 0x%X, words %d/%d",rdo1,l_fee_mask,fee_mask,words,n_words) ; + free(d_use) ; + return 0 ; } } @@ -243,6 +253,7 @@ int itpc23::from22to23(char *c_dta, int words) if(ix>(n_words)) { run_errors++ ; + err |= 0x80000000 ; if(run_errors<5) LOG(ERR,"%d: words %d, ix %d",rdo1,n_words,ix) ; free(d_use) ; return 0 ; @@ -258,12 +269,16 @@ int itpc23::from22to23(char *c_dta, int words) if(ix>(n_words)) { run_errors++ ; if(run_errors<5) LOG(ERR,"%d: words %d, ix %d",rdo1,n_words,ix) ; + err |= 0x80000000 ; + free(d_use) ; + return 0 ; } } if(n_words<12) { run_errors++ ; if(run_errors<5) LOG(ERR,"%d: n_words %d",rdo1,n_words) ; + err |= 0x80000000 ; free(d_use) ; return 0 ; } @@ -341,7 +356,7 @@ u_int *itpc23::ch_scan(u_int *start) if(unlikely(words10==1023)) { // channel skipped because of prog-full! prog_fulls++ ; - LOG(ERR,"%d: ch_scan %d:%d: SAMPA%d:%d -- prog-full",rdo1,fee_ix,ch_ix,sampa_id,sampa_ch) ; + if(online) LOG(ERR,"%d: ch_scan %d:%d: SAMPA%d:%d -- prog-full",rdo1,fee_ix,ch_ix,sampa_id,sampa_ch) ; words10 = 0 ; } @@ -448,7 +463,7 @@ u_int *itpc23::ch_scan(u_int *start) if(unlikely(tb_cou>500)) { fee_errs++ ; - if(fee_errs<10) LOG(ERR,"%d: tb_cou %d [0x%08X,%d]",rdo1,tb_cou,d[i],i) ; + if(fee_errs<10) LOG(ERR,"%d: rp %d:%d: tb_cou %d [0x%08X,%d]",rdo1,row,pad,tb_cou,d[i],i) ; } ix = 1 ; break ; @@ -457,7 +472,7 @@ u_int *itpc23::ch_scan(u_int *start) *dd++ = tb_start ; if(seq_ix>=(SEQ_MAX-1)) { - LOG(ERR,"too many seqs %d",seq_ix) ; + if(online) LOG(ERR,"too many seqs %d",seq_ix) ; goto done_ch ; } @@ -478,7 +493,7 @@ u_int *itpc23::ch_scan(u_int *start) if(unlikely(tb_start<=tb_last)) { fee_errs++ ; - if(fee_errs<10) LOG(ERR,"tb_start %d, tb_last %d",tb_start,tb_last) ; + if(fee_errs<10) LOG(ERR,"%d: rp %d:%d: tb_start %d, tb_last %d",rdo1,row,pad,tb_start,tb_last) ; } @@ -486,7 +501,7 @@ u_int *itpc23::ch_scan(u_int *start) tb_last = tb_start + tb_cou ; if(unlikely(tb_last>500)) { fee_errs++ ; - if(fee_errs<10) LOG(ERR,"%d: tb_last %d [0x%08X,%d]",rdo1,tb_last,d[i],i) ; + if(fee_errs<10) LOG(ERR,"%d: rp %d:%d: tb_last %d [0x%08X,%d]",rdo1,row,pad,tb_last,d[i],i) ; } @@ -609,11 +624,11 @@ u_int *itpc23::lane_scan(u_int *start) // should be at start of lane 0xB.... if((d[0]&0xF0000000)!=0xB0000000) { // start of lane err |= 0x100000 ; - LOG(ERR,"%d: lane_scan %d:%d: unknown start 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; + if(online) LOG(ERR,"%d: lane_scan %d:%d: unknown start 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; } else if((d[0]>>26)&0x3) { // SAMPA FIFOs overwritten! err |= 0x200000 ; - LOG(ERR,"%d: lane_scan %d:%d: SAMPA FIFO overwritten 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; + if(online) LOG(ERR,"%d: lane_scan %d:%d: SAMPA FIFO overwritten 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; } d++ ; // skip 0xB.... @@ -628,7 +643,7 @@ u_int *itpc23::lane_scan(u_int *start) // should be at end of lane 0x7.... if((d[0]&0xF0000000)!=0x70000000) { // end of lane err |= 0x400000 ; - LOG(ERR,"%d: lane_scan %d:%d: unknown end 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; + if(online) LOG(ERR,"%d: lane_scan %d:%d: unknown end 0x%08X",rdo1,fee_ix,lane_ix,d[0]) ; } d++ ; // skip 0x7... @@ -643,7 +658,7 @@ u_int *itpc23::fee_non_trgd(u_int *start) int fee_words = 0 ; if(fee_evt_type != 0x02) { // no clue - LOG(ERR,"%d: fee_non_trgd %d: evt_type 0x%02X",rdo1,fee_ix,fee_evt_type) ; + if(online) LOG(ERR,"%d: fee_non_trgd %d: evt_type 0x%02X",rdo1,fee_ix,fee_evt_type) ; while(d=1) LOG(TERR,"%d: evt %d: fee_mask expected 0x%04X",rdo1,evt,fee_mask) ; // should be at the FEE start: 0xF000_mmmm + // THIS IS THE CANONICAL MASK AS SET BY THE RDO DURING RUNNING + // AND SHOULD BE USED OFFLINE if(((*d>>28)!=0xF)||((*d&0xFFFF)!=fee_mask)) { - LOG(ERR,"%d: evt %d: Bad FEE_START 0x%08X",rdo1,evt,*d) ; + if(online) LOG(ERR,"%d: evt %d: Bad FEE_START 0x%08X, expect 0x%08X",rdo1,evt,*d,0xF0000000|fee_mask) ; err |= 0x20 ; goto done ; } @@ -1052,7 +1089,7 @@ int itpc23::rdo_scan(char *c_addr, int iwords) if(err||prog_fulls) { - LOG(ERR,"%d: evt %d/%d: T %d,%d,%d: error 0x%08X, prog_fulls %d: words %d, %d us",rdo1,evt_trgd,evt, + if(online) LOG(ERR,"%d: evt %d/%d: T %d,%d,%d: error 0x%08X, prog_fulls %d: words %d, %d us",rdo1,evt_trgd,evt, token,trg_cmd,daq_cmd, err, prog_fulls, @@ -1259,6 +1296,7 @@ itpc23::itpc23() data_c = 0 ; + fee_errs = 0 ; // just in case fmt = 0 ; @@ -1340,7 +1378,7 @@ static int itpc_fee_map[24][4][16] = { {//S5 checked {49,52,46, 0, 0, 54,0,47, 0,50, 0,55,48, 0,51,53}, {36,32,40,43,37,33, 0,41, 0,44,38,34,42,45,39,35}, - { 7, 1,17,12,24,19,13, 8,28, 2, 0,20,29,25,21, 3}, + { 7, 1,17,12,24,19,13, 8,28, 2, 3,20,29,25,21, 0}, // 17May23: moved 16 to 11 { 9, 4,26,14,15,10,30,22,27, 5,31,23,18,16,11, 6} }, diff --git a/StRoot/RTS/src/DAQ_TPC23/itpc23.h b/StRoot/RTS/src/DAQ_TPC23/itpc23.h index b9d562a67a6..5e3e61d9609 100644 --- a/StRoot/RTS/src/DAQ_TPC23/itpc23.h +++ b/StRoot/RTS/src/DAQ_TPC23/itpc23.h @@ -30,12 +30,12 @@ class itpc23 : public tpc23_base { int fee_evt_type ; int prog_fulls ; - int fee_errs ; +// int fee_errs ; int rdo_scan(char *c_addr, int words) ; int from22to23(char *dta, int words) ; u_int get_token_s(char *c_addr, int words) ; - void set_rdo(int s, int r) ; + u_int set_rdo(int s, int r) ; int init(daq_dta *gain) ; diff --git a/StRoot/RTS/src/DAQ_TPC23/tpc23_base.cxx b/StRoot/RTS/src/DAQ_TPC23/tpc23_base.cxx index d3bd25c514c..2e857ee015a 100644 --- a/StRoot/RTS/src/DAQ_TPC23/tpc23_base.cxx +++ b/StRoot/RTS/src/DAQ_TPC23/tpc23_base.cxx @@ -31,8 +31,8 @@ //tpc23_base::row_pad_t (*tpc23_base::rp_gain_tpx)[ROW_MAX+1][PAD_MAX+1] ; //tpc23_base::row_pad_t (*tpc23_base::rp_gain_itpc)[ROW_MAX+1][PAD_MAX+1] ; -short tpc23_base::bad_fee_cou[24][6] ; -short tpc23_base::bad_fee[24][6][36] ; +short tpc23_base::bad_fee_cou[24][46] ; +short tpc23_base::bad_fee[24][46][36] ; //int tpc23_base::rowlen[ROW_MAX+1] ; //int tpc23_base::row_min ; @@ -943,7 +943,8 @@ int tpc23_base::row_stage1(int row) { int got_one = 0 ; int p_max ; - + int odd_errs = 0 ; + blob_cou = 1 ; int blob_merges = 0 ; @@ -951,8 +952,13 @@ int tpc23_base::row_stage1(int row) #ifdef DBG_PRINT printf("ROW %2d: STAGE1, rowlen %2d\n",row,p_max) ; #endif + for(int pad=1;padt_hi) ; @@ -980,8 +986,15 @@ int tpc23_base::row_stage1(int row) u_int tr_lo = seq_r->t_lo ; int br = seq_r->blob_id ; - if(tr_hi>=512 || tr_lo>=512) LOG(ERR,"tr_hi %d, tr_lo %d: row %d, pad %d", - tr_hi,tr_lo,row,pad) ; + if(tr_hi>=512 || tr_lo>=512) { + odd_errs++ ; + if(odd_errs<5) { + LOG(ERR,"S%d: tr_hi %d, tr_lo %d: row %d, pad %d",sector1, + tr_hi,tr_lo,row,pad+1) ; + } + seq_r->t_hi = -1 ; + continue ; + } //printf("tr_hi %d, tr_lo %d: row %d, pad %d\n", tr_hi,tr_lo,row,pad) ; @@ -1156,7 +1169,7 @@ int tpc23_base::row_stage1(int row) } - +// error_retry:; #ifdef DBG_PRINT printf("ROW %2d: STAGE1: %d blobs, blob_merges %d\n",row,blob_cou-1,blob_merges) ; @@ -1212,7 +1225,7 @@ int tpc23_base::evt_stop() if((s2_dta-s2_start)>(s2_max_words-1000)) { LOG(ERR,"T %d: row %d: lots of CLD words %d vs %d, sequences %d -- skipping the rest",token,row, - s2_dta-s2_start, s2_max_words, + s2_dta-s2_start, s2_max_words-1000, sequence_cou) ; break ; @@ -1327,7 +1340,7 @@ int tpc23_base::run_start() s1_bytes = (ROW_MAX*PAD_MAX)*512*2 ; } - LOG(INFO,"%d: allocing %d s1_bytes, s1_t %d, blobs %d",id,s1_bytes,sizeof(s1),sizeof(blob)) ; + if(online) LOG(INFO,"%d: allocing %d s1_bytes, s1_t %d, blobs %d",id,s1_bytes,sizeof(s1),sizeof(blob)) ; s1_dta = (u_short *) malloc(s1_bytes) ; } @@ -1340,6 +1353,7 @@ int tpc23_base::run_start() evt_trgd = 0 ; run_errors = 0 ; + fee_errs = 0 ; return 0 ; @@ -1349,7 +1363,7 @@ int tpc23_base::run_start() // Called at run-stop: generally dumps statistics int tpc23_base::run_stop() { - LOG(TERR,"%d: run_stop: %d/%d events, run_errors %d",id,evt_trgd,evt,run_errors) ; +// LOG(TERR,"%d: run_stop: %d/%d events, run_errors %d",id,evt_trgd,evt,run_errors) ; return 0 ; } @@ -1462,7 +1476,7 @@ int tpc23_base::gains_from_cache(const char *fname) }}} for(int s=0;s<24;s++) { - for(int r=0;r<6;r++) { + for(int r=0;r<46;r++) { bad_fee_cou[s][r] = 0 ; }} @@ -1538,6 +1552,12 @@ int tpc23_base::gains_from_cache(const char *fname) #ifdef DBG_PRINT //printf("gain %d %d %d = %f %f\n",sec,row,pad,g,t) ; #endif + int flags = rp_gain[sec-1][row][pad].flags ; + + if(log_level>0) { + printf("gain %d %d %d = %f %f; %d\n",sec,row,pad,g,t,flags) ; + } + rp_gain[sec-1][row][pad].gain = g ; rp_gain[sec-1][row][pad].t0 = t ; @@ -1548,6 +1568,12 @@ int tpc23_base::gains_from_cache(const char *fname) if(p1<1) p1 = 1 ; if(p2>rowlen[row]) p2 = rowlen[row] ; + + if(log_level>0) printf("dead edge row %d, pad %d %d %d: %d %d %d\n",row,pad,p1,p2, + rp_gain[sec-1][row][pad].flags, + rp_gain[sec-1][row][p1].flags, + rp_gain[sec-1][row][p2].flags) ; + rp_gain[sec-1][row][pad].flags |= FCF_DEAD_EDGE ; rp_gain[sec-1][row][p1].flags |= FCF_DEAD_EDGE ; rp_gain[sec-1][row][p2].flags |= FCF_DEAD_EDGE ; diff --git a/StRoot/RTS/src/DAQ_TPC23/tpc23_base.h b/StRoot/RTS/src/DAQ_TPC23/tpc23_base.h index 8c56bd18ff9..61862750698 100644 --- a/StRoot/RTS/src/DAQ_TPC23/tpc23_base.h +++ b/StRoot/RTS/src/DAQ_TPC23/tpc23_base.h @@ -12,7 +12,7 @@ class tpc23_base { virtual ~tpc23_base() ; static const int ROW_MAX = 45 ; - static const int PAD_MAX = 144 ; + static const int PAD_MAX = 182 ; static const int SEQ_MAX = 64 ; static const int SIM_FIFOS = 64 ; @@ -24,7 +24,9 @@ class tpc23_base { virtual int rdo_scan(char *mem, int words) ; virtual int from22to23(char *dta, int words) ; // rewrite the old FY22 raw data foramt to FY23 - + + int fee_errs ; + u_char rts_id ; // tpx, itpc u_char fmt ; // 22: old data format, 23: FY23 data format u_char online ; // 1:running online, 0:offline with quality and track_id stuff @@ -71,8 +73,8 @@ class tpc23_base { } ; - static short bad_fee_cou[24][6] ; - static short bad_fee[24][6][36] ; + static short bad_fee_cou[24][46] ; + static short bad_fee[24][46][36] ; struct row_pad_t (*rp_gain)[ROW_MAX+1][PAD_MAX+1] ; // max for both dets; all sectors @@ -94,7 +96,7 @@ class tpc23_base { } sim_dta[SIM_FIFOS] ; int load_replay(const char *fname, int sec_soft) ; - virtual inline void set_rdo(int sec, int rdo) { return ; } ; + virtual u_int set_rdo(int sec, int rdo) { return 0 ; } ; // simulation diff --git a/StRoot/RTS/src/DAQ_TPC23/tpx23.cxx b/StRoot/RTS/src/DAQ_TPC23/tpx23.cxx index 872fe1d9f8d..61c46c559b4 100644 --- a/StRoot/RTS/src/DAQ_TPC23/tpx23.cxx +++ b/StRoot/RTS/src/DAQ_TPC23/tpx23.cxx @@ -19,6 +19,19 @@ #include #include +#include // only for itpcData! + +#ifdef THREAD_DBG_USE + +#include + +#else + +#define TLOG() +#define TLOGX(x) + +#endif + #include "tpx23.h" @@ -32,20 +45,26 @@ int tpx23::from22to23(char *c_addr, int words) return words ; } -inline void tpx23::set_rdo(int s, int r) +inline u_int tpx23::set_rdo(int s, int r) { sector1 = s ; rdo1 = r ; + + return 0 ; // should be fee_mask } -u_int *tpx23::fee_scan() +int tpx23::fee_scan() { u_int *h ; - int fee_wds ; + err = 0 ; // in class +// u_char altro_present[256][16] ; + + get_token((char *)d_start,words) ; + TLOG() ; if(run_type==1 || run_type==5) { int r0_logical = tpx36_from_real(subdet_id,sector1,rdo1) - 1 ; @@ -67,31 +86,15 @@ u_int *tpx23::fee_scan() h = d_end ; +// memset(altro_present,0,sizeof(altro_present)) ; if(hdr_version) { -#if 0 - fee_wds = (d_end+1) - (d_start+2) ; - - LOG(WARN,"Evt %d: S%02d:%d: T %d, trg %d, daq %d: fee words %d vs %d",evt_trgd, - sector1,rdo1, - token,trg_cmd,daq_cmd, - fee_wds,words) ; - LOG(WARN," first altro words 0x%08X last, 0x%08X before last",h[0],h[-1]) ; -#if 0 - u_int *d = (u_int *)d_start ; -// printf("first h words: 0x%08X last, 0x%08X before-last\n",h[0],h[-1]) ; - for(int i=0;i0) LOG(TERR,"%d: fee_scan",rdo1) ; // NOTE: ALTRO scans from the end!!! while(h>(d_start+2)) { @@ -100,12 +103,17 @@ u_int *tpx23::fee_scan() lo = *h-- ; hi = *h-- ; + // for intermediate hdr version + lo &= 0xFFFFF ; + hi &= 0xFFFFF ; + int wc = ((hi&0x3F)<<4)|((lo&0xF0000)>>16) ; // altro's word count if(wc==0) continue ; int id = (lo&0xFF0) >> 4 ; // altro id int ch = lo & 0xF ; + TLOGX(id) ; for(int i=0;i22) { -// LOG(TERR,"%d: A%03d:%02d: words %d",rdo1,id,ch,wc) ; -// } - - while(wc%4) wc++ ; - // this now needs to go into the canonical format! int row ; int pad ; @@ -139,23 +141,61 @@ u_int *tpx23::fee_scan() // get row,pad & flags and skip the pad if there are flags int flags = flags_row_pad(id,ch,row,pad) ; + // max wc in pedestal runs is 437 + if(wc>437) { // garbage in the event... and now what??? + run_errors++ ; + if(run_errors<10) { + if(online) LOG(ERR,"S%02d:%d: rp %d:%d (aid %d:%d) : wc %d",sector1,rdo1,row,pad,id,ch,wc) ; + } + //err |= 0x10000 ; // signal an error because I am breaking out + break ; + } + + while(wc%4) wc++ ; + // if this is a physics run: skip pads which have flags // hmm... is this right? if(flags && run_type==3) { + if(log_level>0) { + LOG(TERR,"%d: rp %d:%d, flags 0x%X",rdo1,row,pad,flags) ; + } + h -= wc/2 ; + continue ; + } + +#if 0 + // fixing a bug in fee_23a FY23 version! + altro_present[id][ch]++ ; + + if(altro_present[id][ch]>1) { + run_errors++ ; + if(run_errors<20) { + if(online) LOG(ERR,"S%02:%d: AID %d:%d already present %d",sector1,rdo1,id,ch,altro_present[id][ch]) ; + } h -= wc/2 ; continue ; } +#endif u_short *d = s1_dta + last_ix ; // this is where the raw data goes... //u_short d[512] ; -// LOG(TERR,"%d: rp %d:%d; last_ix %d %p",rdo1,row,pad,last_ix,d) ; + if(log_level>0) { + LOG(TERR,"%d: rp %d:%d; last_ix %d %p",rdo1,row,pad,last_ix,d) ; + } int ix = 0 ; + + //TLOGX(row) ; + + for(int i=0;i440 || t_hi>440 || t_lo>440) { + run_errors++ ; + if(run_errors<20) { + if(online) LOG(ERR,"S%02d:%d: rp %d:%d (aid %d:%d), t_len %d, t_lo %d, t_hi %d",sector1,rdo1,row,pad, + id,ch, + t_len,t_lo,t_hi) ; + } + if(t_len>510 || t_hi>510 || t_lo>510) { + //err |= 0x20000 ; + break ; + } + + //if(t_hi>510) break ; + //if(t_lo>510) break ; + } + //printf("rp %d:%d: seq %d: t_len %d, t_lo:hi %d:%d\n",row,pad,seq_ix,t_len,t_lo,t_hi) ; sseq[seq_ix].t_lo = t_lo ; sseq[seq_ix].t_hi = t_hi ; //sseq[seq_ix].dta_p = (dd-d) ; // I'm at the data now + for(int i=0;isector = sector1 ; + tpx_d->rdo = rdo1 ; + tpx_d->row = row ; + tpx_d->pad = pad ; + tpx_d->altro = id ; + + //LOG(TERR,"%d:%d %d:%d %d:%d",sector1,rdo1,row,pad,id,ch) ; + + tpx_d->ch_start(ch) ; // sets tpx_d->ch within + + for(int i=(seq_ix-1);i>=0;i--) { + int t_len = sseq[i].t_hi - sseq[i].t_lo + 1 ; + + int ii = 0 ; + for(int j=(t_len-1);j>=0;j--) { + int adc = sseq[i].d[j] ; + int tb ; + + + //a.adc[aix] = adc ; + + tb = sseq[i].t_lo + ii ; + //a.tb[aix] = sseq[i].t_lo + ii ; + ii++ ; + //aix++ ; + + tpx_d->accum(tb,adc) ; + } + + } + + tpx_d->ch_done() ; + } + //LOG(TERR,"Here 2") ; int s_cou = 0 ; dd = d ; @@ -290,6 +387,8 @@ u_int *tpx23::fee_scan() s_cou++ ; } + //TLOG() ; + ix = dd - d ; // seq[s_cou].t_hi = -1 ; // sentinel; marker @@ -322,13 +421,13 @@ u_int *tpx23::fee_scan() } + + done:; -// if(run_type==1 || run_type==5) { -// pthread_mutex_unlock(&peds_mutex) ; -// } + TLOG() ; - return 0 ; + return err ; } /* @@ -347,6 +446,7 @@ u_int tpx23::get_token_s(char *c_addr, int wds) trg = 0 ; daq = 0 ; + TLOGX(rdo1) ; int type = (d[0]>>0)&0xF ; int hdr_type = (d[0]>>24)&0xF ; //0: pre-FY23 headers, 1:FY23 headers @@ -371,6 +471,7 @@ u_int tpx23::get_token_s(char *c_addr, int wds) // LOG(TERR,"%2d = 0x%08X",i,d[i]) ; // } + TLOGX(wds) ; d += wds ; d-- ; // at the last datum @@ -387,7 +488,7 @@ u_int tpx23::get_token_s(char *c_addr, int wds) } // here we are with the old, pre-FY23 header format - + TLOGX(rdo1) ; d -= 2 ; // skip 2 words trailer @@ -399,6 +500,8 @@ u_int tpx23::get_token_s(char *c_addr, int wds) trg_d = (struct trg_data *)d ; + TLOGX(trg_cou) ; + for(int i=0;i20) cou = 20 ; else cou = wds ; - LOG(ERR,"evt_err %d:%d: 0x%08X: 0x%08X, wds %u",evt,rdo1,d_first[0],evt_err,wds) ; - for(int i=0;i [%d LOG] Unprintable character 0x%02X? -- powercycle",rdo,tmpbuff[j]) ; - LOG(WARN,"But ignored for FY22") ; - //err_status |= DET_ERR_OPER_PS ; + LOG(WARN,"---> [%d LOG] Unprintable character 0x%02X? -- powercycle",rdo,(u_char)tmpbuff[j]) ; + //LOG(ERR,"But ignored for FY22") ; + err_status |= 1; err = -1 ; tmpbuff[j] = '?' ; } @@ -621,6 +745,32 @@ int tpx23::log_dump(char *c_addr, int wds) } +#if 1 + if(strstr(tmpbuff+st,"RHIC clock: ")) { + if(strstr(tmpbuff+st,"EXTERNAL")) { + rhic_clock = 1 ; + } + else { + rhic_clock = 0 ; // internal + } + } + + if(strstr(tmpbuff+st,"JTAG dev ")) { + int ret, dev ; + u_int dev_id, user ; + + dev = -1 ; + +// LOG(WARN,"[S%02d:%d LOG]: JTAG:",s_real,r_real,tmpbuff+st) ; + + ret = sscanf(tmpbuff+st,"JTAG dev %d: ID 0x%X, USERcode 0x%X",&dev,&dev_id,&user) ; + LOG(WARN,"JTAG: ret %d, dev %d, dev_id 0x%08X, user 0x%08X",ret, dev, dev_id,user) ; + + if(ret==3 && dev>=0 && dev<5) { + fpga_usercode[dev] = user ; + } + } +#endif if(strstr(tmpbuff+st,"SPECIAL_0 code")) { LOG(ERR,"---> SPECIAL code: RDO %d",rdo) ; @@ -632,7 +782,7 @@ int tpx23::log_dump(char *c_addr, int wds) LOG(WARN,"[S%02d:%d LOG]: contains ERR \"%s\"",s_real,r_real,tmpbuff+st) ; } else { - err = -1 ; + //err = -1 ; //LOG(ERR,"[S%02d:%d LOG]: contains ERR \"%s\"",s_real,r_real,tmpbuff+st) ; } } @@ -647,20 +797,21 @@ int tpx23::log_dump(char *c_addr, int wds) if(strstr(tmpbuff+st,"FEE power BAD")) { //err_status |= DET_ERR_OPER_PS ; - LOG(WARN,"---> [S%d:%d LOG] FEE power BAD -- powercycle (ignored)",s_real,r_real) ; + LOG(ERR,"---> [S%d:%d LOG] FEE power BAD -- powercycle (ignored)",s_real,r_real) ; //err = -1 ; } } if(strstr(tmpbuff+st,"SRAM check failed")) { - err = -1 ; - LOG(WARN,"---> [%d LOG] SRAM check failed -- powercycle",rdo) ; + err = -1 ; + err_status |= 2 ; + LOG(ERR,"---> [%d LOG] SRAM check failed -- powercycle",rdo) ; } if(strstr(tmpbuff+st,"CPLD claims error")) { err = -1 ; - LOG(WARN,"---> [%d LOG] CPLD claims error -- reconfig 0x300",rdo) ; + LOG(ERR,"---> [%d LOG] CPLD claims error -- reconfig 0x300",rdo) ; } if(strstr(tmpbuff+st,"can't configure RDO!")) { @@ -671,34 +822,34 @@ int tpx23::log_dump(char *c_addr, int wds) // mostly run related if(strstr(tmpbuff+st,"lost RHIC")) { - LOG(WARN,"---> [%d LOG] \"lost RHIC\" -- restart run",rdo) ; + LOG(ERR,"---> [%d LOG] \"lost RHIC\" -- restart run",rdo) ; err = -1 ; } if(strstr(tmpbuff+st,"NO RHIC CLOCK")) { - LOG(WARN,"---> [%d LOG] \"NO RHIC CLOCK\" -- restart run",rdo) ; + LOG(ERR,"---> [%d LOG] \"NO RHIC CLOCK\" -- restart run",rdo) ; err = -1 ; } if(strstr(tmpbuff+st,"DRIFT")) { - LOG(WARN,"---> [%d LOG] \"DRIFT/clock problems\" -- restart run",rdo) ; + LOG(ERR,"---> [%d LOG] \"DRIFT/clock problems\" -- restart run",rdo) ; err = -1 ; } if(strstr(tmpbuff+st,"CRIT")) { err = -1 ; - LOG(WARN,"---> [%d LOG] CRIT string in log -- restart run",rdo) ; + LOG(ERR,"---> [%d LOG] CRIT string in log -- restart run",rdo) ; } if(strstr(tmpbuff+st,"altro error")) { err = -1 ; - LOG(WARN,"---> [%d LOG] altro error -- restart run",rdo) ; + LOG(ERR,"---> [%d LOG] altro error -- restart run",rdo) ; } if(strstr(tmpbuff+st,"ERR ALTRO")) { - err = -1 ; - LOG(WARN,"---> [%d LOG] ERR ALTRO -- CHECK THIS",rdo) ; + //err = -1 ; + //LOG(WARN,"---> [%d LOG] ERR ALTRO -- CHECK THIS",rdo) ; } @@ -706,6 +857,7 @@ int tpx23::log_dump(char *c_addr, int wds) if(err<0) { LOG(ERR,"[S%02d:%d %d]: %s",s_real,r_real,evt,tmpbuff+st) ; + log_is_error = 1 ; } else if(do_log) { LOG(INFO,"[S%02d:%d %d]: %s",s_real,r_real,evt,tmpbuff+st) ; @@ -774,6 +926,8 @@ int tpx23::log_dump(char *c_addr, int wds) int tpx23::rdo_scan(char *c_addr, int wds) { + int ret = 0 ; + u_int *d = (u_int *)c_addr ; @@ -808,11 +962,14 @@ int tpx23::rdo_scan(char *c_addr, int wds) } + TLOG() ; + switch(type) { case DDL_TYPE_LOG : - err = log_dump(c_addr,wds) ; - + TLOG() ; + ret = log_dump(c_addr,wds) ; + TLOG() ; break ; case DDL_TYPE_MSC : if(subtype==2) { // heartbeat; ignore @@ -821,17 +978,18 @@ int tpx23::rdo_scan(char *c_addr, int wds) LOG(WARN,"%d: MSC: event %d: S%02d:%d: type %d:%d, words %d",rdo1,d[1],sec,rdo,type,subtype,words) ; - msc_dump(c_addr, wds) ; + ret = msc_dump(c_addr, wds) ; break ; default : // ALTRO data -- and we're off evt_trgd++ ; - fee_scan() ; - + TLOG() ; + ret = fee_scan() ; + TLOG() ; break ; } - return 0 ; + return ret ; // should be ret } @@ -868,7 +1026,10 @@ tpx23::tpx23() for(int row=1;row<=45;row++) rowlen[row] = tpc_rowlen[row] ; hdr_version = 0 ; // 0:pre FY23 - + + memset(fpga_usercode,0,sizeof(fpga_usercode)) ; + + tpx_d = 0 ; } @@ -876,6 +1037,11 @@ tpx23::tpx23() u_char tpx23::flags_row_pad(int asic, int channel, int &row, int &pad) { + row = 255 ; + pad = 255 ; + + if(rdo1<1||rdo1>6) return 0xFF ; + // I will rewrite this to make it super-fast tpx_from_altro(rdo1-1,asic,channel,row,pad) ; // from tpxCore! @@ -887,3 +1053,14 @@ u_char tpx23::flags_row_pad(int asic, int channel, int &row, int &pad) return rp_gain[sector1-1][row][pad].flags ; } +#if 0 +int tpx23::run_start() +{ +// LOG(WARN,"TPX23 run_start") ; + + rhic_clock = -1 ; // unknown + log_is_error = 0 ; + + return 0 ; +} +#endif diff --git a/StRoot/RTS/src/DAQ_TPC23/tpx23.h b/StRoot/RTS/src/DAQ_TPC23/tpx23.h index b8a31f6a0ed..5b4a622351b 100644 --- a/StRoot/RTS/src/DAQ_TPC23/tpx23.h +++ b/StRoot/RTS/src/DAQ_TPC23/tpx23.h @@ -1,22 +1,62 @@ #ifndef _TPX23_H_ #define _TPX23_H_ +//#include +#include + #include "tpc23_base.h" class tpxPed ; struct daq_dta ; + +class tpx23Data { +public: + tpx23Data() {;} ; + ~tpx23Data() {;} ; + + int sector ; + int rdo ; + int row ; + int pad ; + int altro ; + int ch ; + int tb_cou ; + + daq_dta *dta ; + daq_adc_tb *at ; + + void ch_start(int c) { + ch = c ; + tb_cou = 0 ; + + at = (daq_adc_tb *)dta->request(512) ; + } + + void accum(int tb, int adc) { + at[tb_cou].adc = adc; + at[tb_cou].tb = tb ; + tb_cou++ ; + } + + void ch_done() { + dta->finalize(tb_cou,sector,row,pad) ; + } +} ; + + class tpx23 : public tpc23_base { public: tpx23() ; ~tpx23() { return ; } ; +// int run_start() ; int rdo_scan(char *c_addr, int words) ; int from22to23(char *c_addr, int words) ; u_int get_token_s(char *c_addr, int words) ; - void set_rdo(int s, int r) ; + u_int set_rdo(int s, int r) ; static class tpxPed *peds ; @@ -31,9 +71,14 @@ class tpx23 : public tpc23_base { u_char hdr_version ; + u_int fpga_usercode[5] ; + u_char log_is_error ; + u_char rhic_clock ; + + class tpx23Data *tpx_d ; private: - u_int *fee_scan() ; + int fee_scan() ; int log_dump(char *c_addr, int wds) ; int msc_dump(char *c_addr, int wds) ; diff --git a/StRoot/RTS/src/DAQ_TPX/daq_tpx.cxx b/StRoot/RTS/src/DAQ_TPX/daq_tpx.cxx index 03ee0510850..77028f52d96 100644 --- a/StRoot/RTS/src/DAQ_TPX/daq_tpx.cxx +++ b/StRoot/RTS/src/DAQ_TPX/daq_tpx.cxx @@ -27,7 +27,7 @@ #include "tpxFCF_2D.h" #include "tpxStat.h" - +#include class daq_det_tpx_factory : public daq_det_factory @@ -132,6 +132,8 @@ daq_tpx::daq_tpx(daqReader *rts_caller) cld23 = 0 ; + t23 = 0 ; + LOG(DBG,"%s: constructor: caller %p",name, caller) ; return ; } @@ -879,6 +881,7 @@ daq_dta *daq_tpx::handle_ped(int sec) daq_dta *daq_tpx::handle_adc(int sec, int rdo) { + class tpx23Data tpx_d ; int min_sec, max_sec ; int min_rdo, max_rdo ; @@ -913,6 +916,8 @@ daq_dta *daq_tpx::handle_adc(int sec, int rdo) } } + tpx_d.dta = adc ; + // guess the byte size... int guess_bytes = rdos * 1152 * (sizeof(daq_store) + 10*sizeof(daq_adc_tb)) ; @@ -928,6 +933,7 @@ daq_dta *daq_tpx::handle_adc(int sec, int rdo) struct tpx_rdo_event rdo ; struct tpx_altro_struct a ; int rdo_words ; + int token ; LOG(NOTE,"Calling handle_raw for %d:%d",s,r) ; rdo_dta = handle_raw(s, r) ; // bring the raw data in, RDO-by_RDO! @@ -949,50 +955,100 @@ daq_dta *daq_tpx::handle_adc(int sec, int rdo) rdo_ptr = (char *)rdo_dta->Byte ; rdo_words = rdo_dta->ncontent / 4 ; - int token = tpx_get_start(rdo_ptr, rdo_words, &rdo, 0) ; + // check header version here + u_int *hdr_version = (u_int *)rdo_ptr ; + + int t23_started = 0 ; - if(token <= 0) { - LOG(ERR,"horrible error, token is %d?",token) ; - continue ; - } + if((hdr_version[0]>>24)&0xF) { + // handle_adc + //altro_c.dta = adc ; + //altro_c.in_adc = 1 ; - if(rdo.rdo != r) { - LOG(ERR,"RDO mismatch: in data %d, expect %d",rdo.rdo,r) ; - } - u_int *data_end = rdo.data_end ; + if(t23==0) { + t23 = new tpx23 ; + t23->online = 0 ; + t23->run_type = 3 ; + t23->no_cld = 1 ; + t23->log_level = 0 ; - a.rdo = rdo.rdo -1 ; - a.t = token ; - a.what = TPX_ALTRO_DO_ADC ; - a.log_err = 0 ; - a.sector = s ; + t23->data_c = 0 ; // &altro_c ; + t23->tpx_d = 0 ; + } - do { - data_end = tpx_scan_to_next(data_end, rdo.data_start, &a) ; - if(a.count == 0) continue ; // no data for this guy... + t23->tpx_d = &tpx_d ; - // unallowed rows, pads... - if((a.row>45) || (a.pad==0) || (a.pad>182)) { - LOG(ERR,"TPX: S%02d:RDO%d: row %d, pad %d",a.sector,rdo.rdo,a.row,a.pad) ; + t23->run_start() ; + t23->evt_start() ; + t23_started = 1 ; + + tpx_d.sector = s ; + tpx_d.rdo = r ; + + + t23->set_rdo(s,r) ; + ret = t23->rdo_scan((char *)rdo_ptr,rdo_words) ; + token = t23->token ; + + u_int *dd = (u_int *)rdo_ptr+rdo_words ; + + if(dd[-2]&0xFF000000) { + LOG(NOTE,"Token %d, bad event 0x%08X",token,dd[-2]) ; } + LOG(NOTE,"FMT23: handle_adc(%d,%d), token %d, ret 0x%X, status 0x%X",s,r,token,ret,dd[-2]) ; + } + else { - daq_adc_tb *at = (daq_adc_tb *) adc->request(a.count) ; - - //LOG(DBG,"%d: %d:%d %d",adc->obj_cou,a.row,a.pad,a.count) ; + token = tpx_get_start(rdo_ptr, rdo_words, &rdo, 0) ; - for(u_int i=0 ; i < a.count ; i++) { - at[i].adc = a.adc[i] ; - at[i].tb = a.tb[i] ; + if(token <= 0) { + LOG(ERR,"horrible error, token is %d?",token) ; + continue ; + } + if(rdo.rdo != r) { + LOG(ERR,"RDO mismatch: in data %d, expect %d",rdo.rdo,r) ; } - adc->finalize(a.count, s, a.row, a.pad) ; + u_int *data_end = rdo.data_end ; + + a.rdo = rdo.rdo -1 ; + a.t = token ; + a.what = TPX_ALTRO_DO_ADC ; + a.log_err = 0 ; + a.sector = s ; + + do { + data_end = tpx_scan_to_next(data_end, rdo.data_start, &a) ; + + if(a.count == 0) continue ; // no data for this guy... + + // unallowed rows, pads... + if((a.row>45) || (a.pad==0) || (a.pad>182)) { + LOG(ERR,"TPX: S%02d:RDO%d: row %d, pad %d",a.sector,rdo.rdo,a.row,a.pad) ; + } + + daq_adc_tb *at = (daq_adc_tb *) adc->request(a.count) ; + + //LOG(DBG,"%d: %d:%d %d",adc->obj_cou,a.row,a.pad,a.count) ; - } while(data_end && (data_end > rdo.data_start)) ; + for(u_int i=0 ; i < a.count ; i++) { + at[i].adc = a.adc[i] ; + at[i].tb = a.tb[i] ; + } + + adc->finalize(a.count, s, a.row, a.pad) ; + + } while(data_end && (data_end > rdo.data_start)) ; + } + if(t23_started) { + t23->evt_stop() ; + t23->run_stop() ; + } } } @@ -1051,7 +1107,7 @@ daq_dta *daq_tpx::handle_altro(int sec, int rdo) for(int s=min_sec;s<=max_sec;s++) { for(int r=min_rdo;r<=max_rdo;r++) { daq_dta *rdo_dta ; - + int token ; char *rdo_ptr ; struct tpx_rdo_event rdo ; @@ -1062,6 +1118,8 @@ daq_dta *daq_tpx::handle_altro(int sec, int rdo) rdo_dta = handle_raw(s, r) ; // bring the raw data in, RDO-by_RDO! + int t23_started = 0 ; + if(rdo_dta == 0) { LOG(WARN,"rdo_dta NULL?") ; continue ; // sorry, not found... @@ -1078,52 +1136,97 @@ daq_dta *daq_tpx::handle_altro(int sec, int rdo) rdo_ptr = (char *)rdo_dta->Byte ; rdo_words = rdo_dta->ncontent / 4 ; - int token = tpx_get_start(rdo_ptr, rdo_words, &rdo, 0) ; - if(token <= 0) { - LOG(ERR,"horrible error, token is %d?",token) ; - continue ; + // check header version here + u_int *hdr_version = (u_int *)rdo_ptr ; + + rdo_fmt = 0 ; + if((hdr_version[0]>>24)&0xF) { + LOG(NOTE,"FMT23: handle_altro(%d,%d): version 0x%X",s,r,hdr_version[0]) ; + rdo_fmt = 23 ; } - if(rdo.rdo != r) { - LOG(ERR,"RDO mismatch: in data %d, expect %d",rdo.rdo,r) ; - } + if(rdo_fmt>22) { + if(t23==0) { // class member + t23 = new tpx23 ; + t23->online = 0 ; + t23->run_type = 3 ; + t23->no_cld = 1 ; + t23->log_level = 0 ; - u_int *data_end = rdo.data_end ; + t23->data_c = 0 ; // &altro_c ; + + } - a.rdo = rdo.rdo -1 ; - a.t = token ; - a.what = TPX_ALTRO_DO_ADC ; - a.log_err = 0 ; - a.sector = s ; + t23->tpx_d = 0 ; - do { - data_end = tpx_scan_to_next(data_end, rdo.data_start, &a) ; + if(t23_started==0) { + t23->run_start() ; + t23->evt_start() ; + t23_started = 1 ; + } + } - if(a.count == 0) continue ; // no data for this guy... + if(rdo_fmt>22) { + // handle_altro + t23->set_rdo(s,r) ; + ret = t23->rdo_scan((char *)rdo_ptr,rdo_words) ; + token = t23->token ; - // unallowed rows, pads... - //if((a.row>45) || (a.pad==0) || (a.pad>182)) { - // LOG(ERR,"TPX: S%02d:RDO%d: row %d, pad %d",a.sector,rdo.rdo,a.row,a.pad) ; - //} + //LOG(TERR,"FMT23 token %d",token) ; + } + else { - daq_adc_tb *at = (daq_adc_tb *) altro->request(a.count) ; - - //LOG(DBG,"%d: %d:%d %d",altro->obj_cou,a.row,a.pad,a.count) ; + token = tpx_get_start(rdo_ptr, rdo_words, &rdo, 0) ; - for(u_int i=0 ; i < a.count ; i++) { - at[i].adc = a.adc[i] ; - at[i].tb = a.tb[i] ; + if(token <= 0) { + LOG(ERR,"horrible error, token is %d?",token) ; + continue ; + } + if(rdo.rdo != r) { + LOG(ERR,"RDO mismatch: in data %d, expect %d",rdo.rdo,r) ; } - altro->finalize(a.count, s, a.id, a.ch) ; + u_int *data_end = rdo.data_end ; - } while(data_end && (data_end > rdo.data_start)) ; + a.rdo = rdo.rdo -1 ; + a.t = token ; + a.what = TPX_ALTRO_DO_ADC ; + a.log_err = 0 ; + a.sector = s ; + do { + data_end = tpx_scan_to_next(data_end, rdo.data_start, &a) ; - } - } + if(a.count == 0) continue ; // no data for this guy... + + // unallowed rows, pads... + //if((a.row>45) || (a.pad==0) || (a.pad>182)) { + // LOG(ERR,"TPX: S%02d:RDO%d: row %d, pad %d",a.sector,rdo.rdo,a.row,a.pad) ; + //} + + daq_adc_tb *at = (daq_adc_tb *) altro->request(a.count) ; + + //LOG(DBG,"%d: %d:%d %d",altro->obj_cou,a.row,a.pad,a.count) ; + + for(u_int i=0 ; i < a.count ; i++) { + at[i].adc = a.adc[i] ; + at[i].tb = a.tb[i] ; + } + + altro->finalize(a.count, s, a.id, a.ch) ; + + } while(data_end && (data_end > rdo.data_start)) ; + } + + if(t23_started) { + t23->evt_stop() ; + t23->run_stop() ; + } + + } // loop over RDOs + } // loop over sectors altro->rewind() ; // wind data pointers to the beginning so that they can be used @@ -1194,6 +1297,7 @@ daq_dta *daq_tpx::handle_raw(int sec, int rdo) if(full_name==0) continue ; + } diff --git a/StRoot/RTS/src/DAQ_TPX/daq_tpx.h b/StRoot/RTS/src/DAQ_TPX/daq_tpx.h index 23d7e729122..c0376570886 100644 --- a/StRoot/RTS/src/DAQ_TPX/daq_tpx.h +++ b/StRoot/RTS/src/DAQ_TPX/daq_tpx.h @@ -13,6 +13,8 @@ class tpxStat ; class daqReader; class tpxFCF_2D ; +class tpx23 ; + class daq_tpx : public daq_det { private: class daq_dta *handle_raw(int sec, int rdo) ; @@ -73,6 +75,10 @@ class daq_tpx : public daq_det { int cld23 ; + int rdo_fmt ; + + tpx23 *t23 ; + protected: public: diff --git a/StRoot/RTS/src/DAQ_TPX/tpxPed.cxx b/StRoot/RTS/src/DAQ_TPX/tpxPed.cxx index 13620f8e172..6c2f5f27ed3 100644 --- a/StRoot/RTS/src/DAQ_TPX/tpxPed.cxx +++ b/StRoot/RTS/src/DAQ_TPX/tpxPed.cxx @@ -964,7 +964,7 @@ int tpxPed::special_setup(int run_type, int sub_type) } -void tpxPed::smooth() +void tpxPed::smooth(int mode) { int r, p, t ; @@ -1046,6 +1046,18 @@ void tpxPed::smooth() // finally, we need to round off correctly! for(t=0;t<512;t++) { ped->ped[t] = (double) ((u_short) (smoother[t]+0.5)) ; + if(mode==1) { // new in May2023, kills GG pickup + if(t>=18 && t<=20) { + ped->ped[t] = 1023.0 ; + } + } + else if(mode==2) { // slight increase + if(t>=18 && t<=20) { + ped->ped[t] += 5.0 ; + if(ped->ped[t]>1023.0) ped->ped[t] = 1023.0 ; + } + + } } @@ -1055,7 +1067,7 @@ void tpxPed::smooth() } } - LOG(TERR,"Pedestals smoothed: sector %2d",sector) ; + LOG(TERR,"Pedestals smoothed: sector %2d, mode %d",sector,mode) ; smoothed = 1 ; return ; diff --git a/StRoot/RTS/src/DAQ_TPX/tpxPed.h b/StRoot/RTS/src/DAQ_TPX/tpxPed.h index 48ee9740c05..d6adcb91848 100644 --- a/StRoot/RTS/src/DAQ_TPX/tpxPed.h +++ b/StRoot/RTS/src/DAQ_TPX/tpxPed.h @@ -39,7 +39,7 @@ class tpxPed { int kill_bad(int r0_logical,int row, int pad) ; // kills this specific pad in ped_store - void smooth() ; // from ped_store to ped_store + void smooth(int mode=0) ; // from ped_store to ped_store int max_events ; // max events allowed in the calculation diff --git a/StRoot/RTS/src/LOG/Makefile b/StRoot/RTS/src/LOG/Makefile index 8107ebe358f..c1447ead38a 100755 --- a/StRoot/RTS/src/LOG/Makefile +++ b/StRoot/RTS/src/LOG/Makefile @@ -2,6 +2,7 @@ include ../rtsmakefile.def include ../rtsplus.def + # zap LDLIBS LDLIBS = @@ -28,7 +29,7 @@ rtsLog.o : rtsLog.C rtsLog: rtsLog.o rtsLogUnix.o $(CXX) $(CXXFLAGS) rtsLogUnix.o rtsLog.o -o rtsLog - + #operDisplay.sh: diff --git a/StRoot/RTS/src/LOG/rtsLog.C b/StRoot/RTS/src/LOG/rtsLog.C index 481ebdfe1b6..b9aa11ed557 100644 --- a/StRoot/RTS/src/LOG/rtsLog.C +++ b/StRoot/RTS/src/LOG/rtsLog.C @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) use_stdin = 0 ; rtsLogLevel(DBG) ; - rtsLogOutput(RTS_LOG_NET) ; + //rtsLogOutput(RTS_LOG_NET) ; memset(logstr,0,sizeof(logstr)) ; diff --git a/StRoot/RTS/src/LOG/rtsLogUnix.c b/StRoot/RTS/src/LOG/rtsLogUnix.c index 7e65ca77188..6d63e49c7ea 100755 --- a/StRoot/RTS/src/LOG/rtsLogUnix.c +++ b/StRoot/RTS/src/LOG/rtsLogUnix.c @@ -29,6 +29,30 @@ extern "C" { volatile int tonkoLogLevel = 2 ; + + + + +#ifdef RTS_ENABLE_LOG +#warning "DAQ logging is enabled" +#ifdef RTS_LOG_DEFAULT_NET +#warning "DAQ logging defaults to daqman" +#else +#warning "DAQ logging defaults to STDERR" +#endif /* RTS_LOG_DEFAULT_NET */ +#else +#warning "DAQ logging is disabled" +#endif /* RTS_ENABLE_LOG */ + + +#ifdef RTS_ENABLE_LOG + +#ifdef RTS_LOG_DEFAULT_NET +static int output_flag = RTS_LOG_NET ; +#else +static int output_flag = RTS_LOG_STDERR ; +#endif + static const char *getCmd(void) ; static int odesc = -1 ; static int handchange ; @@ -42,7 +66,7 @@ static char servER[80] = RTS_LOG_HOST ; #endif static int port = RTS_LOG_PORT ; -static int output_flag = RTS_LOG_NET ; + static char cmd[1024] ; /* @@ -113,7 +137,6 @@ void rtsLogAddJmlFile (char *fname) jml_fname = _g_fname; } - int rtsLogUnix_v(const char *str, ...) { /* common to all threads */ @@ -328,8 +351,6 @@ int rtsLogUnix_v(const char *str, ...) return 0 ; } - - static const char *getCmd(void) { @@ -370,6 +391,11 @@ static const char *getCmd(void) #endif } + +#endif + + + #ifdef __cplusplus } #endif diff --git a/StRoot/RTS/src/rtsmakefile.def b/StRoot/RTS/src/rtsmakefile.def index 2b345a55a73..7f0b82f740c 100755 --- a/StRoot/RTS/src/rtsmakefile.def +++ b/StRoot/RTS/src/rtsmakefile.def @@ -17,6 +17,8 @@ ifeq ($(HOST_NAME),daqman.starp.bnl.gov) endif +HOSTDOMAIN = $(shell hostname -d) + # jml... TARGET_CPU_STRING to mean the full string... # go from "uname" to gcc -mcpu=TARGET_CPU variant @@ -373,14 +375,38 @@ DEFINES = -D_REENTRANT ${RTS_DAQMAN_FLAGS} -DRTS_HOST_NAME=\"${HOST_NAME}\" -DTA # Set strict errors in LINUX -BASEFLAGS = -O3 -Wall -Werror -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} +BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} + +#-O3 ifneq (${TARGET_SYSTEM}, LINUX) - BASEFLAGS = -O3 -Wall -pipe -fverbose-asm ${HOSTFLAGS} + BASEFLAGS = -Wall -pipe -fverbose-asm ${HOSTFLAGS} endif ifeq (${HOST_NAME},xvme01.daq.bnl.local) - BASEFLAGS = -O3 -Wall -Werror -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} + BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS} +endif + +# if not compiling on one of the standard domains, then +# use the default log destination of std_err +# if compiling on local domain, write to daqman +# +# if compiling somewhere else for writing to daqman these defines +ifeq (${HOSTDOMAIN},starp.bnl.gov) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},daq.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},daq2.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},trg.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG +else ifeq (${HOSTDOMAIN},l4.bnl.local) + DEFINES += -DRTS_LOG_DEFAULT_NET + DEFINES += -DRTS_ENABLE_LOG endif CCFLAGS = ${BASEFLAGS} ${USRCCFLAGS} ${DEFINES} ${INCLUDES} @@ -396,6 +422,10 @@ ifeq ($(RTS_PROJECT),PP2PP) endif endif + + + + # noticed problems on Linux where the default linker gcc doesn't work well for g++ compiled # files LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH) diff --git a/StRoot/RTS/trg/include/trgDataDefs_40.h b/StRoot/RTS/trg/include/trgDataDefs_40.h index be0d8c14d87..aec5bec0834 100644 --- a/StRoot/RTS/trg/include/trgDataDefs_40.h +++ b/StRoot/RTS/trg/include/trgDataDefs_40.h @@ -23,6 +23,7 @@ #define MAX_TRG_BLK_SIZE 122880 /* Current total: 113.25k bytes for pre/post non-zero suppressed data. Allow 120k */ #define MAX_OFFLEN 20 /* Depends on the number of crates in the system */ +#define ADD_BIT_CONTAMINATION 4 #define ADD_BIT_FORCE 5 /* Force store of this event */ #define ADD_BIT_L2_5 6 /* Level 2.5 abort */ #define ADD_BIT_SIM 7 /* Simulated event - used by DAQ */ diff --git a/StRoot/StBFChain/BigFullChain.h b/StRoot/StBFChain/BigFullChain.h index 1de6d36fe77..917dd831eaa 100644 --- a/StRoot/StBFChain/BigFullChain.h +++ b/StRoot/StBFChain/BigFullChain.h @@ -448,10 +448,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/simu/rcf9066_20_1000evts.fzd",kFALSE}, {"eval_Sti_pp200.MC.y2008","","","MC.y2008,Sti,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf9992_01_1000evts.fzd",kFALSE}, - {"eval_StvCA_dau200.MC.Stv.y2008","","","MC.in.y2008,StvPulls,StvCA,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11025_2040_100evts.event.root",kFALSE}, - {"eval_Stv_dau200.MC.y2008","","","MC.in.y2008,Stv,StvPulls,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11025_2040_100evts.event.root",kFALSE}, {"eval_Sti.AgML_pp500.MC.y2009","","","MC.y2009a,Sti,AgML,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf9994_01_1000evts.fzd",kFALSE}, {"eval_StiCA_pp200.MC.y2009","","","MC.y2009a,StiCA,fzin,MiniMcMk","","" @@ -462,10 +458,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/simu/rcf9993_01_1000evts.fzd",kFALSE}, {"eval_Sti_pp500.MC.y2009","","","MC.y2009a,Sti,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf9994_01_1000evts.fzd",kFALSE}, - {"eval_StvCA_pp500.MC.y2009","","","MC.in.y2009,StvPulls,StvCA,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11026_1020_50evts_pileup.event.root",kFALSE}, - {"eval_Stv_pp500.MC.y2009","","","MC.in.y2009,Stv,StvPulls,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11026_1020_50evts_pileup.event.root",kFALSE}, {"eval_Sti.AgML_auau11.MC.y2010","","","MC.y2010a,Sti,AgML,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf10031_1_100evts.fzd",kFALSE}, {"eval_Sti.AgML_auau200.MC.y2010","","","MC.y2010,Sti,AgML,fzin,MiniMcMk","","" @@ -490,16 +482,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/simu/rcf10033_1_100evts.fzd",kFALSE}, {"eval_StiCA_auau7.MC.y2010","","","MC.y2010a,StiCA,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf10030_1_100evts.fzd",kFALSE}, - {"eval_Stv_auau200.MC.y2010","","","MC.in.y2010,Stv,StvPulls,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11022_2241_50evts.event.root",kFALSE}, - {"eval_StvCA_auau200.MC.y2010","","","MC.in.y2010,StvPulls,StvCA,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11022_2241_50evts.event.root",kFALSE}, - {"eval_StvCA_auau39.MC.y2010","","","MC.y2010a,StvCA","","" - , "/star/rcf/simu/rcf10032_1_100evts.fzd",kFALSE}, - {"eval_StvCA_auau62.MC.y2010","","","MC.y2010a,StvCA","","" - , "/star/rcf/simu/rcf10033_1_100evts.fzd",kFALSE}, - {"eval_StvCA_auau7.MC.y2010","","","MC.y2010a,StvCA","","" - , "/star/rcf/simu/rcf10030_1_100evts.fzd",kFALSE}, {"eval_Sti.AgML_auau200.MC.y2011","","","MC.y2011,Sti,AgML,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf11023_2060_25evts.fzd",kFALSE}, {"eval_Sti.AgML_pp500.MC.y2011","","","MC.fast.y2011,AgML,Sti,fzin,MiniMcMk","","" @@ -518,10 +500,6 @@ Bfc_st BFC[] = { // standard chains ,"/star/rcf/simu/pp500/pythia/pileup/rcf10100_90_200evts_Wplus_enu.fzd\n" " gfile b /star/rcf/simu/pp500/pythia/pileup/rcf10100_90_4000evts_minb.fzd\n" " mode TPCE back 4001400\n gback 400 400 0.1 106.6" ,kFALSE}, - {"eval_Stv_auau200.MC.y2011","","","MC.in.y2011,Stv,StvPulls,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11023_2060_25evts.event.root",kFALSE}, - {"eval_StvCA_auau200.MC.y2011","","","MC.in.y2011,StvPulls,StvCA,in,MiniMcMk","","" - , "/star/rcf/simu/rcf11023_2060_25evts.event.root",kFALSE}, {"eval_Sti.AgML_CuAu200.MC.y2012","","","MC.y2012,Sti,AgML,fzin,MiniMcMk","","" , "/star/rcf/simu/rcf12003_1_100evts.fzd",kFALSE}, {"eval_Sti.AgML_pp200.MC.y2012","","","MC.y2012,Sti,AgML,fzin,MiniMcMk","","" @@ -546,12 +524,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/test/daq/2007/112/8112052/st_physics_8112052_raw_1020010.daq",kFALSE}, {"eval_Sti.RC.auau200.MB.y2007","","","RC.y2007,pmdReco,ITTF,Sti","","" , "/star/rcf/test/daq/2007/113/8113044/st_physics_8113044_raw_1040042.daq",kFALSE}, - {"eval_Stv.AgML.RC.auau200.MB.y2007","","","RC.y2007,Stv,AgML","","" - , "/star/rcf/test/daq/2007/113/8113044/st_physics_8113044_raw_1040042.daq",kFALSE}, - {"eval_StvCA.RC.auau200.MB.y2007","","","RC.y2007.NoSvt,StvCA","","" - , "/star/rcf/test/daq/2007/113/8113044/st_physics_8113044_raw_1040042.daq",kFALSE}, - {"eval_Stv.RC.auau200.MB.y2007","","","RC.y2007.NoSvt,Stv","","" - , "/star/rcf/test/daq/2007/113/8113044/st_physics_8113044_raw_1040042.daq",kFALSE}, {"eval_Sti.AgML.RC.dau200.y2008","","","RC.y2008,ITTF,AgML,Sti","","" , "/star/rcf/test/daq/2007/352/st_physics_8352025_raw_1030011.daq",kFALSE}, {"eval_StiCA.RC.dau200.y2008","","","RC.y2008,StiCA","","" @@ -562,16 +534,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/test/daq/2007/352/st_physics_8352025_raw_1030011.daq",kFALSE}, {"eval_Sti.RC.pp200.y2008","","","RC.pp.y2008,ITTF,Sti","","" , "/star/rcf/test/daq/2008/043/st_physics_9043046_raw_2030002.daq",kFALSE}, - {"eval_Stv.AgML.RC.dau200.y2008","","","RC.y2008.notof,Stv,AgML","","" - , "/star/rcf/test/daq/2007/352/st_physics_8352025_raw_1030011.daq",kFALSE}, - {"eval_StvCA.RC.dau200.y2008","","","RC.y2008.notof,StvCA","","" - , "/star/rcf/test/daq/2007/352/st_physics_8352025_raw_1030011.daq",kFALSE}, - {"eval_StvCA.RC.pp200.y2008","","","RC.pp.y2008.Minuit,StvCA","","" - , "/star/rcf/test/daq/2008/043/st_physics_9043046_raw_2030002.daq",kFALSE}, - {"eval_Stv.RC.dau200.y2008","","","RC.y2008.notof,Stv","","" - , "/star/rcf/test/daq/2007/352/st_physics_8352025_raw_1030011.daq",kFALSE}, - {"eval_Stv.RC.pp200.y2008","","","RC.pp.y2008.Minuit,Stv","","" - , "/star/rcf/test/daq/2008/043/st_physics_9043046_raw_2030002.daq",kFALSE}, {"eval_Sti.AgML.RC.pp500.y2009","","","RC.pp.y2009.VFPP,ITTF,Sti","","" , "/star/rcf/test/daq/2009/085/st_physics_10085024_raw_2020001.daq",kFALSE}, {"eval_StiCA.RC.pp200.y2009","","","RC.pp.y2009.VFPP,StiCA","","" @@ -582,16 +544,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/test/daq/2009/115/st_physics_10115020_raw_5020001.daq",kFALSE}, {"eval_Sti.RC.pp500.y2009","","","RC.pp.y2009.VFPP,ITTF,Sti","","" , "/star/rcf/test/daq/2009/085/st_physics_10085024_raw_2020001.daq",kFALSE}, - {"eval_Stv.AgML.RC.pp500.y2009","","","RC.pp.y2009,Stv,AgML","","" - , "/star/rcf/test/daq/2009/085/st_physics_10085024_raw_2020001.daq",kFALSE}, - {"eval_StvCA.RC.pp200.y2009","","","RC.pp.y2009,StvCA","","" - , "/star/rcf/test/daq/2009/115/st_physics_10115020_raw_5020001.daq",kFALSE}, - {"eval_StvCA.RC.pp500.y2009","","","RC.pp.y2009,StvCA","","" - , "/star/rcf/test/daq/2009/085/st_physics_10085024_raw_2020001.daq",kFALSE}, - {"eval_Stv.RC.pp200.y2009","","","RC.pp.y2009,Stv","","" - , "/star/rcf/test/daq/2009/115/st_physics_10115020_raw_5020001.daq",kFALSE}, - {"eval_Stv.RC.pp500.y2009","","","RC.pp.y2009,Stv","","" - , "/star/rcf/test/daq/2009/085/st_physics_10085024_raw_2020001.daq",kFALSE}, {"eval_Sti.AgML.RC.auau200.y2010","","","RC.y2010.notof,AgML,Sti","","" , "/star/rcf/test/daq/2010/029/st_physics_11029020_raw_1030002.daq",kFALSE}, {"eval_Sti.AgML.RC.auau39.y2010","","","RC.y2010.notof,AgML,Sti","","" @@ -619,34 +571,6 @@ Bfc_st BFC[] = { // standard chains #if 0 {"eval_Sti.RC.auau7.y2010","","","RC.y2010,Sti","","" , "/star/rcf/test/daq/2010/138/st_physics_11138001_raw_2020001.daq",kFALSE}, -#endif - {"eval_Stv.AgML.RC.auau200.y2010","","","RC.y2010.notof,Stv,AgML","","" - , "/star/rcf/test/daq/2010/029/st_physics_11029020_raw_1030002.daq",kFALSE}, - {"eval_Stv.AgML.RC.auau39.y2010","","","RC.y2010.notof,Stv,AgML","","" - , "/star/rcf/test/daq/2010/100/st_physics_11100070_raw_1030001.daq",kFALSE}, - {"eval_StvCA.RC.auau11.y2010","","","RC.y2010.notof,StvCA","","" - , "/star/rcf/test/daq/2010/157/st_physics_11157020_raw_2030001.daq",kFALSE}, - {"eval_StvCA.RC.auau200.y2010","","","RC.y2010.notof,StvCA","","" - , "/star/rcf/test/daq/2010/029/st_physics_11029020_raw_1030002.daq",kFALSE}, - {"eval_StvCA.RC.auau39.y2010","","","RC.y2010.notof,StvCA","","" - , "/star/rcf/test/daq/2010/100/st_physics_11100070_raw_1030001.daq",kFALSE}, - {"eval_StvCA.RC.auau62.y2010","","","RC.y2010.notof,StvCA","","" - , "/star/rcf/test/daq/2010/098/st_physics_11098050_raw_3020001.daq",kFALSE}, -#if 0 - {"eval_StvCA.RC.auau7.y2010","","","RC.y2010.notof,StvCA","","" - , "/star/rcf/test/daq/2010/138/st_physics_11138001_raw_2020001.daq",kFALSE}, -#endif - {"eval_Stv.RC.auau11.y2010","","","RC.y2010.notof,Stv","","" - , "/star/rcf/test/daq/2010/157/st_physics_11157020_raw_2030001.daq",kFALSE}, - {"eval_Stv.RC.auau200.y2010","","","RC.y2010.notof,Stv","","" - , "/star/rcf/test/daq/2010/029/st_physics_11029020_raw_1030002.daq",kFALSE}, - {"eval_Stv.RC.auau39.y2010","","","RC.y2010.notof,Stv","","" - , "/star/rcf/test/daq/2010/100/st_physics_11100070_raw_1030001.daq",kFALSE}, - {"eval_Stv.RC.auau62.y2010","","","RC.y2010.notof,Stv","","" - , "/star/rcf/test/daq/2010/098/st_physics_11098050_raw_3020001.daq",kFALSE}, -#if 0 - {"eval_Stv.RC.auau7.y2010","","","RC.y2010.notof,Stv","","" - , "/star/rcf/test/daq/2010/138/st_physics_11138001_raw_2020001.daq",kFALSE}, #endif {"eval_Sti.AgML.RC.auau200.y2011","","","RC.y2011,AgML,Sti","","" , "/star/rcf/test/daq/2011/130/st_physics_12130084_raw_5020002.daq",kFALSE}, @@ -670,26 +594,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/test/daq/2011/174/st_physics_12174106_raw_2040001.daq",kFALSE}, {"eval_Sti.RC.pp500.y2011","","","RC.pp.y2011.VFPPV,pmdReco,mtdDat,Sti","","" , "/star/rcf/test/daq/2011/059/st_physics_12059038_raw_2030002.daq",kFALSE}, - {"eval_Stv.AgML.RC.auau200.y2011","","","RC.y2011,Stv,AgML","","" - , "/star/rcf/test/daq/2011/130/st_physics_12130084_raw_5020002.daq",kFALSE}, - {"eval_Stv.AgML.RC.auau20.y2011","","","RC.y2011,Stv,AgML","","" - , "/star/rcf/test/daq/2011/122/st_physics_12122018_raw_2010002.daq",kFALSE}, - {"eval_StvCA.RC.auau200.y2011","","","RC.y2011,StvCA","","" - , "/star/rcf/test/daq/2011/130/st_physics_12130084_raw_5020002.daq",kFALSE}, - {"eval_StvCA.RC.auau20.y2011","","","RC.y2011,StvCA","","" - , "/star/rcf/test/daq/2011/122/st_physics_12122018_raw_2010002.daq",kFALSE}, - {"eval_StvCA.RC.auau27.y2011","","","RC.y2011,StvCA","","" - , "/star/rcf/test/daq/2011/174/st_physics_12174106_raw_2040001.daq",kFALSE}, - {"eval_StvCA.RC.pp500.y2011","","","RC.pp.y2011,pmdReco,mtdDat,StvCA","","" - , "/star/rcf/test/daq/2011/059/st_physics_12059038_raw_2030002.daq",kFALSE}, - {"eval_Stv.RC.auau200.y2011","","","RC.y2011,Stv","","" - , "/star/rcf/test/daq/2011/130/st_physics_12130084_raw_5020002.daq",kFALSE}, - {"eval_Stv.RC.auau20.y2011","","","RC.y2011,Stv","","" - , "/star/rcf/test/daq/2011/122/st_physics_12122018_raw_2010002.daq",kFALSE}, - {"eval_Stv.RC.auau27.y2011","","","RC.y2011,Stv","","" - , "/star/rcf/test/daq/2011/174/st_physics_12174106_raw_2040001.daq",kFALSE}, - {"eval_Stv.RC.pp500.y2011","","","RC.pp.y2011,pmdReco,mtdDat,Stv","","" - , "/star/rcf/test/daq/2011/059/st_physics_12059038_raw_2030002.daq",kFALSE}, {"eval_Sti.AgML.RC.pp200.y2012","","","RC.pp.y2012,AgML,Sti","","" , "/star/rcf/test/daq/2012/044/st_physics_13044030_raw_2010001.daq",kFALSE}, {"eval_Sti.AgML.RC.pp500.y2012","","","RC.pp.y2012,AgML,Sti","","" @@ -704,30 +608,6 @@ Bfc_st BFC[] = { // standard chains , "/star/rcf/test/daq/2012/082/st_physics_13082004_raw_1020004.daq",kFALSE}, {"eval_Sti.RC.UU193.y2012","","","RC.y2012,Sti","","" , "/star/rcf/test/daq/2012/115/st_physics_13115004_raw_2010002.daq",kFALSE}, - {"eval_Stv.AgML.RC.cuAu200.y2012","","","RC.y2012b.notof,Stv,AgML","","" - , "/star/rcf/test/daq/2012/143/st_physics_13143018_raw_3020009.daq",kFALSE}, - {"eval_Stv.AgML.RC.pp200.y2012","","","RC.pp.y2012.notofMin,Stv,AgML","","" - , "/star/rcf/test/daq/2012/044/st_physics_13044030_raw_2010001.daq",kFALSE}, - {"eval_Stv.AgML.RC.pp500.y2012","","","RC.pp.y2012.notofMin,Stv,AgML","","" - , "/star/rcf/test/daq/2012/082/st_physics_13082004_raw_1020004.daq",kFALSE}, - {"eval_Stv.AgML.RC.UU193.y2012","","","RC.y2012b.notof,Stv,AgML","","" - , "/star/rcf/test/daq/2012/115/st_physics_13115004_raw_2010002.daq",kFALSE}, - {"eval_StvCA.RC.cuAu200.y2012","","","RC.y2012b.notof,StvCA","","" - , "/star/rcf/test/daq/2012/143/st_physics_13143018_raw_3020009.daq",kFALSE}, - {"eval_StvCA.RC.pp200.y2012","","","RC.pp.y2012.notofMin,StvCA","","" - , "/star/rcf/test/daq/2012/044/st_physics_13044030_raw_2010001.daq",kFALSE}, - {"eval_StvCA.RC.pp500.y2012","","","RC.pp.y2012.notofMin,StvCA","","" - , "/star/rcf/test/daq/2012/082/st_physics_13082004_raw_1020004.daq",kFALSE}, - {"eval_StvCA.RC.UU193.y2012","","","RC.y2012b.notof,StvCA","","" - , "/star/rcf/test/daq/2012/115/st_physics_13115004_raw_2010002.daq",kFALSE}, - {"eval_Stv.RC.cuAu200.y2012","","","RC.y2012b.notof,Stv","","" - , "/star/rcf/test/daq/2012/143/st_physics_13143018_raw_3020009.daq",kFALSE}, - {"eval_Stv.RC.pp200.y2012","","","RC.pp.y2012.notofMin,Stv","","" - , "/star/rcf/test/daq/2012/044/st_physics_13044030_raw_2010001.daq",kFALSE}, - {"eval_Stv.RC.pp500.y2012","","","RC.pp.y2012.notofMin,Stv","","" - , "/star/rcf/test/daq/2012/082/st_physics_13082004_raw_1020004.daq",kFALSE}, - {"eval_Stv.RC.UU193.y2012","","","RC.y2012b.notof,Stv","","" - , "/star/rcf/test/daq/2012/115/st_physics_13115004_raw_2010002.daq",kFALSE}, {"doEvents" ,"" ,"","in,StEvent,analysis,NoDb" ,"","","",kFALSE}, {"MakeMuDst","","","in,StEvent,CMuDST,Tree,nodefault,NoHistos,ReadAll","","" ,"StEvent => MuDst",kFALSE}, {"drawDst" ,"" ,"","in,ry1h,globT,SCL,geant,display,NoDb,TbUtil" ,"","","",kFALSE}, @@ -1401,6 +1281,18 @@ Bfc_st BFC[] = { // standard chains {"hijing1.383" ,"","","stargen", "", "Hijing1_383.so", "Load Hijing 1.383 generator", false }, {"kinematics" ,"","","stargen", "", "Kinematics.so", "Load STAR Particle Gun", false }, {"genreader" ,"","","stargen", "", "StarGenEventReader.so", "Load STAR Gen Event Reader", false }, + + + {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, + {"GEANT4 Libs ","-----------","-----------","------------------------------------------","","","",kFALSE}, + {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, + + {"g4interfaces","", "", "", "", "libG4clhep.so,libG4global.so,libG4intercoms.so,libG4interfaces.so,libG4modeling.so,libG4vis_management.so","Load G4 libs",false}, + {"g4physics", "", "", "", "", "libG4materials.so,libG4graphics_reps.so,libG4geometry.so,libG4particles.so,libG4track.so,libG4zlib.so,libG4digits_hits.so,libG4processes.so,libG4tracking.so,libG4event.so,libG4run.so,libG4physicslists.so", "Load G4",false}, + {"g4geant3", "", "", "", "", "libG3toG4.so", "Load g3 to g4 support", false }, + {"geant4", "", "", "g4physics,g4interfaces","","","Load G4 libs", false}, + + {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, {"I/O Makers ","-----------","-----------","------------------------------------------","","","",kFALSE}, {"------------","-----------","-----------","------------------------------------------","","","",kFALSE}, @@ -1533,6 +1425,7 @@ Bfc_st BFC[] = { // standard chains {"TpcMixer","","tpcChain","StEvent,rts,-Mixer,-tpx,TpxClu" ,"StTpcMixerMaker","StTpcHitMaker","",kFALSE}, {"TpxClu","tpc_hits","tpcChain","rts,tpcDb,detDb,-tpx,-tpc_daq,-fcf","StTpcRTSHitMaker" ,"StTpcHitMaker", "RTS(online) cluster maker",kFALSE}, + {"TPC23" ,"","","TpxClu","","", "RTS(online, daq5k) tpc23-cluster maker",kFALSE}, {"TpxClu2D" ,"","","TpxClu","","", "RTS(online) 2D-cluster maker",kFALSE}, {"TpcAvCluster","TpcAvCluster","tpcChain","rts,detDb","StTpcAvClusterMaker","StTpcHitMaker" , "TPC+TPX averaging laser events into Sparse histogram on cluster level", kFALSE}, @@ -1792,7 +1685,6 @@ Bfc_st BFC[] = { // standard chains // Sti options {"StiPulls" ,"","","" ,"","", "Request to make Sti Pulls",kFALSE}, - {"StvPulls" ,"","","" ,"","", "Request to make Stv Pulls",kFALSE}, {"StiLib" ,"","","" ,"","Sti,StiUtilities","Load Sti",kFALSE}, {"StiCALib" ,"","","" ,"","TPCCATracker,StiCA","Load Sti+CA",kFALSE}, {"StiTpc" ,"","","TpcDb,ITTF,tpc_T,dbutil,detDb,StarMagField,magF" ,"","StiTpc","Load StiTpc",kFALSE}, @@ -1823,16 +1715,13 @@ Bfc_st BFC[] = { // standard chains // Sti/Stv chains {"Sti" ,"Sti","","StiLib,StiLibs,SCL,StEvent,StDbT,TpcIT,compend,sim_T,tbutil","StiMaker" , "StEventUtilities,StiUtilities,StiMaker","Sti tracker",kFALSE}, - {"StiCA" ,"Sti","","Sti","StiMaker","TPCCATracker,StiCA" ,"StiCA tracker",kFALSE}, + {"StiCA" ,"Sti","","Sti","StiMaker","TPCCATracker" ,"StiCA tracker",kFALSE}, {"StiCAPerf","","","","", "TPCCATrackerPerformance", "CA Performance",kFALSE}, {"StiCA" ,"Sti","","Sti,StiLib,StiCALib,StiLibs,SCL,StEvent,StDbT,TpcIT,compend,tbutil","StiMaker" , "StEventUtilities,libEG,StiUtilities,StiMaker","Sti+CA tracker",kFALSE}, {"HLTCA" ,"" ,"Sti","", "StHLTCAMaker","StHLTCAMaker", "HLT reconstruction",kFALSE}, {"KFVertex" ,"" ,"Sti","-genvtx,-VFMinuit,-VFFV,-VFMCE,-VFppLMV,-VFPPVnoCTB,-VFPPV,-Kink2,-V02,-Xi2" ,"StKFVertexMaker", "MathMore,Spectrum", "...KFParticle based multi vertex reconstruction",kFALSE}, - {"Stv" ,"Stv","","-xgeometry,-Sti,-StiTpc,-StiSsd,-StiSvt,-StiPxl,-StiSsd,-StiSst,-StiIst,","StvMaker" - ,"libHist,libHistPainter,libVMC,StarMiniCern,geant3,GeoTestMaker,StvUtil,Stv,StvSeed,StvMaker,StEventUtilities,-StiLibs,-StiLibsHft","Stv",kFALSE}, - {"StvCA" ,"StvCA","","Stv","","" ,"StvCA",kFALSE}, {"StiVMC" ,"StiVMC","","-Sti,SCL,StEvent,StDbT,TpcDb,compend","StiVMCMaker" , "StEventUtilities,StiVMC,StiVMCMaker" ,"ITTF VMC tracker",kFALSE}, {"StiVMCLibs","","","detDb,StarMagField","", "","ITTF:load StiVMC libraries",kFALSE}, diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 008f2509850..566db07be1f 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -465,11 +465,7 @@ Int_t StBFChain::Instantiate() // --- // Sti(ITTF) start // --- - if (maker == "StiMaker" || maker == "StiVMCMaker" || maker == "StvMaker") { - if ( maker == "StvMaker" && GetOption("StvCA")) { - // mk->SetAttr("seedFinders","CA","Stv"); // for CA seed finder - mk->SetAttr("seedFinders","CA,Default","Stv"); // for CA + Default seed finders - } + if (maker == "StiMaker" || maker == "StiVMCMaker" ) { // When StiCA library is requested CA will be used as seed finder in StiMaker if ( GetOption("StiCA") ) { @@ -545,8 +541,7 @@ Int_t StBFChain::Instantiate() mk->SetAttr("activeBTof" ,kTRUE); } - if (GetOption("StiPulls") || - GetOption("StvPulls")) mk->SetAttr("makePulls" ,kTRUE); + if (GetOption("StiPulls")) mk->SetAttr("makePulls" ,kTRUE); if (GetOption("skip1row")) mk->SetAttr("skip1row" ,kTRUE); if (GetOption("EastOff")) mk->SetAttr("EastOff" ,kTRUE); if (GetOption("WestOff")) mk->SetAttr("WestOff" ,kTRUE); @@ -559,16 +554,15 @@ Int_t StBFChain::Instantiate() // Sti(ITTF) end if (maker=="StGenericVertexMaker") { // VertexFinder methods - if (GetOption("Sti") || GetOption("StiCA") || - GetOption("Stv") || - GetOption("StiVMC" ) ) mk->SetAttr("ITTF" , kTRUE); + if (GetOption("Sti") || GetOption("StiCA") || GetOption("StiVMC" ) ) mk->SetAttr("ITTF" , kTRUE); if (GetOption("VFMinuit" ) ) mk->SetAttr("VFMinuit" , kTRUE); if (GetOption("VFppLMV" ) ) mk->SetAttr("VFppLMV" , kTRUE); if (GetOption("VFppLMV5" ) ) mk->SetAttr("VFppLMV5" , kTRUE); - if ((GetOption("VFPPV") && GetOption("Stv")) || GetOption("VFPPVEv") ) { + if ( GetOption("VFPPVEv") ) { gSystem->Load("StBTofUtil.so"); mk->SetAttr("VFPPVEv" , kTRUE); - } else if (GetOption("VFPPV") && GetOption("Sti")) mk->SetAttr( "VFPPV", kTRUE); + } + else if (GetOption("VFPPV") && GetOption("Sti")) mk->SetAttr( "VFPPV", kTRUE); if (GetOption("VFPPVEvNoBtof")){ gSystem->Load("StBTofUtil.so"); //Not used but loaded to avoid fail mk->SetAttr("VFPPVEvNoBtof", kTRUE); @@ -758,6 +752,7 @@ Int_t StBFChain::Instantiate() // TPC if (maker == "StTpcRTSHitMaker") { if ( GetOption("TpxClu2D")) mk->SetAttr("TpxClu2D", kTRUE); + if ( GetOption("TPC23")) mk->SetAttr("TPC23", kTRUE); } if (maker == "StTpcDbMaker"){ if ( GetOption("Simu") && ! GetOption("NoSimuDb")) mk->SetAttr("Simu",kTRUE); @@ -954,7 +949,6 @@ Int_t StBFChain::Instantiate() if (GetOption("svt1hit")) SetAttr("minPrecHits",1,"Sti"); if (GetOption("svt1hit")) SetAttr("minPrecHits",1,"StiCA"); - if (GetOption("svt1hit")) SetAttr("minPrecHits",1,"Stv"); if (GetOption("svt1hit")) SetAttr("minPrecHits",1,"StiVMC"); for ( unsigned int n=0 ; n < Gproperty.size() ; n++ ){ @@ -1015,7 +1009,6 @@ Int_t StBFChain::Init() { // force load of geometry for VMC and Sti if (GetOption("Sti") || GetOption("StiCA") || - GetOption("Stv") || GetOption("StiVMC") ||GetOption("VMC") || GetOption("VMCPassive")) { const DbAlias_t *DbAlias = GetDbAliases(); @@ -1560,41 +1553,31 @@ void StBFChain::SetFlags(const Char_t *chainOpts) gMessMgr->Error() << "Option ntin cannot be used in root.exe. Use root4star" << endm; abort(); } - if (! (GetOption("Stv"))) { - if (GetOption("gstar") || GetOption("pythia")) { - SetOption("VMC","Default,-TGiant3,gstar"); - SetOption("-gstar","Default,-TGiant3"); - SetOption("-pythia","Default,-TGiant3"); - } + + if (GetOption("gstar") || GetOption("pythia")) { + SetOption("VMC","Default,-TGiant3,gstar"); + SetOption("-gstar","Default,-TGiant3"); + SetOption("-pythia","Default,-TGiant3"); } + SetOption("-geant","Default,-TGiant3"); SetOption("-geantL","Default,-TGiant3"); SetOption("-geometry","Default,-TGiant3"); SetOption("-geomNoField","Default,-TGiant3"); - if (! (GetOption("Stv"))) { - if (! (GetOption("VMC") || GetOption("VMCPassive"))) { - SetOption("VMCPassive","Default,-TGiant3"); - } - SetOption("pgf77","Default,-TGiant3"); - SetOption("mysql","Default,-TGiant3"); - SetOption("StarMiniCern","Default,-TGiant3"); + + if (! (GetOption("VMC") || GetOption("VMCPassive"))) { + SetOption("VMCPassive","Default,-TGiant3"); } + SetOption("pgf77","Default,-TGiant3"); + SetOption("mysql","Default,-TGiant3"); + SetOption("StarMiniCern","Default,-TGiant3"); + } - if (GetOption("ITTF") && ! (GetOption("Sti") || GetOption("StiCA") || GetOption("Stv") || GetOption("StiVMC"))) { + if (GetOption("ITTF") && ! (GetOption("Sti") || GetOption("StiCA") || GetOption("StiVMC"))) { TString STAR_LEVEL(gSystem->Getenv("STAR_LEVEL")); if (STAR_LEVEL == ".DEV2") SetOption("StiCA","Default,ITTF"); else SetOption("Sti" ,"Default,ITTF"); } - if (GetOption("Stv")) { - SetOption("-TpcIT","Default,Stv"); - SetOption("-SvtIT","Default,Stv"); - SetOption("-SsdIT","Default,Stv"); - SetOption("-HpdIT","Default,Stv"); - SetOption("-BTofIT","Default,Stv"); - SetOption("-PxlIT","Default,Stv"); - SetOption("-IstIT","Default,Stv"); - } - } if (!GetOption("Eval") && GetOption("AllEvent")) SetOption("Eval","-Eval,AllEvent"); // Print set values @@ -1918,7 +1901,7 @@ void StBFChain::SetDbOptions(StMaker *mk){ << "\",\"MagFactor\")" << endm; if ( gClassTable->GetID("StarMagField") >= 0) { TString cmd = - Form("if (!StarMagField::Instance()) new StarMagField( 2, %f, kTRUE);", + Form("if (!StarMagField::Instance()) new StarMagField( StarMagField::EBField::kMapped, %f, kTRUE);", FieldOptions[k].scale); ProcessLine(cmd); } diff --git a/StRoot/StBichsel/StBichselLinkDef.h b/StRoot/StBichsel/StBichselLinkDef.h index ed15be8b35f..de843e256e3 100644 --- a/StRoot/StBichsel/StBichselLinkDef.h +++ b/StRoot/StBichsel/StBichselLinkDef.h @@ -12,4 +12,7 @@ #pragma link C++ function StdEdxPull::EvalPred2(Double_t, Double_t, UChar_t, Int_t); #pragma link C++ function StdEdxPull::EvalDeV2(Double_t, Double_t, Double_t, UChar_t, Int_t); #pragma link C++ function StdEdxPull::Eval2(Double_t, Double_t, Double_t, UChar_t, Int_t); + +#pragma link C++ class St_spline3-; +#pragma link C++ class spline3_st+; #endif diff --git a/StRoot/StBichsel/St_spline3C.cxx b/StRoot/StBichsel/St_spline3C.cxx new file mode 100644 index 00000000000..9c891391a6c --- /dev/null +++ b/StRoot/StBichsel/St_spline3C.cxx @@ -0,0 +1,73 @@ +#include "Riostream.h" +#include "St_spline3C.h" +#include "TString.h" +#include "TInterpreter.h" +#include "TSystem.h" +//________________________________________________________________________________ +St_spline3 *St_spline3C::Open(const Char_t *path) { + St_spline3 *table = 0; + TString PATH(path); + TString Dir(gSystem->DirName(PATH)); + TString File(gSystem->BaseName(PATH)); + File += ".C"; + TString pathF(".:./StarDb/"); pathF += Dir + ":$STAR/StarDb/" + Dir; + Char_t *file = gSystem->Which(pathF,File,kReadPermission); + if (! file) { + std::cout << Form("Fatal::St_spline3C::Open \tFile %s has not been found in path %s",File.Data(),pathF.Data()) << std::endl; + return table; + } else { + std::cout << Form("Warning::St_spline3C::Open \tFile %s has been found as %s",File.Data(),file) << std::endl; + } + TString command(".L "); command += file; TInterpreter::EErrorCode ee; + gInterpreter->ProcessLine(command,&ee); + if (ee) { //assert(!ee); + std::cout << Form("Fatal::St_spline3C::Open has failed to read \tFile %s",file) << std::endl; + delete [] file; + return table; + } + table = (St_spline3 *) gInterpreter->Calc("CreateTable()",&ee); + if (! table) {//assert(table); + std::cout << Form("Fatal::St_spline3C::Open has failed to load \tFile %s",file) << std::endl; + delete [] file; + return table; + } + table->Print(0,1); + command.ReplaceAll(".L ",".U "); + gInterpreter->ProcessLine(command,&ee); + if (ee) { // assert(!ee); + std::cout << Form("Fatal::St_spline3C::Open has failed to unload \tFile %s",file) << std::endl; + delete [] file; + SafeDelete(table); + return table; + } + return table; +} +//________________________________________________________________________________ +St_spline3C::St_spline3C(St_spline3 *table) : TChair(table), fSpline(0), fFunc(0), fValid(kTRUE) { + if (table) { + fSpline = new TSpline3("Spline3", Xknots(), Yknots(), nknots(), option(), ValBeg(), ValEnd()); + fSpline->SetLineColor(2); + fXmin = Xknots()[0] - 0.1; + fXmax = Xknots()[nknots()-1] + 0.1; + fFunc = new TF1(GetName(), this, fXmin, fXmax, 0, "St_spline3C"); + fFunc->SetNpx(100); + fFunc->Save(Xknots()[0], Xknots()[nknots()-1], 0., 0., 0., 0.); + } else { + fValid = kFALSE; + } +} +#define MakeChairInstance3(CLASS,PATH) \ + ClassImp(CLASS); \ + CLASS *CLASS::fgInstance = 0; \ + CLASS *CLASS::instance() { \ + if (fgInstance && ! fgInstance->IsValid()) return 0; \ + if (fgInstance) return fgInstance; \ + St_spline3 *table = St_spline3C::Open(# PATH); \ + fgInstance = new CLASS(table); \ + return fgInstance; \ + } +//________________________________________________________________________________ +MakeChairInstance3(Stspline3LndNdxL10,dEdxModel/spline3LndNdxL10); +MakeChairInstance3(StElectonsDEV_dEdx,dEdxModel/ElectonsDEV_dEdx); +MakeChairInstance3(StPionDEV_dEdx,dEdxModel/PionDEV_dEdx); +MakeChairInstance3(StProtonDEV_dEdx,dEdxModel/ProtonDEV_dEdx); diff --git a/StRoot/StBichsel/St_spline3C.h b/StRoot/StBichsel/St_spline3C.h new file mode 100644 index 00000000000..c62ee923f07 --- /dev/null +++ b/StRoot/StBichsel/St_spline3C.h @@ -0,0 +1,77 @@ +#ifndef St_spline3C_h +#define St_spline3C_h + +#include "TChair.h" +//#include "tables/St_spline3_Table.h" +#include "St_spline3_Table.h" +#include "TSpline.h" +#include "TF1.h" +//________________________________________________________________________________ +class St_spline3C : public TChair { + public: + St_spline3C(St_spline3 *table=0); + virtual ~St_spline3C() {} + spline3_st *Struct(Int_t i = 0) const {return ((St_spline3*) Table())->GetTable()+i;} + UInt_t getNumRows() const {return GetNRows();} + Int_t nknots(Int_t i = 0) const {return Struct(i)->nknots;} + Double_t* Xknots(Int_t i = 0) const {return Struct(i)->Xknots;} + Double_t* Yknots(Int_t i = 0) const {return Struct(i)->Yknots;} + Double_t ValBeg(Int_t i = 0) const {return Struct(i)->ValBeg;} + Double_t ValEnd(Int_t i = 0) const {return Struct(i)->ValEnd;} + Char_t* option(Int_t i = 0) const {return (Char_t *) Struct(i)->option;} + TSpline3* Spline() {return fSpline;} + Double_t operator() (Double_t *x, Double_t *p) const {return fSpline->Eval(x[0]);} + TF1* Func() {return fFunc;} + Bool_t IsValid() {return fValid;} + static St_spline3 *Open(const Char_t *path); + Bool_t InRange(Double_t x) {return fXmin <= x && x <= fXmax;} + private: + TSpline3* fSpline; + TF1* fFunc; + Bool_t fValid; + Double_t fXmin; + Double_t fXmax; + ClassDefChair(St_spline3, spline3_st ) + ClassDef(St_spline3C,1) //C++ TChair for spline3 table class +}; +//________________________________________________________________________________ +class Stspline3LndNdxL10 : public St_spline3C {// Log(dN/dx) versus log10(beta*gamma) + public: + static Stspline3LndNdxL10* instance(); + Stspline3LndNdxL10(St_spline3 *table=0) : St_spline3C(table) {} + virtual ~Stspline3LndNdxL10() {fgInstance = 0;} + private: + static Stspline3LndNdxL10* fgInstance; + ClassDef(Stspline3LndNdxL10,1) //C++ TChair for spline3LndNdxL10 +}; +//________________________________________________________________________________ +class StElectonsDEV_dEdx : public St_spline3C {// Log(dN/dx) versus log10(beta*gamma) + public: + static StElectonsDEV_dEdx* instance(); + StElectonsDEV_dEdx(St_spline3 *table=0) : St_spline3C(table) {} + virtual ~StElectonsDEV_dEdx() {fgInstance = 0;} + private: + static StElectonsDEV_dEdx* fgInstance; + ClassDef(StElectonsDEV_dEdx,1) //C++ TChair for ElectonsDEV_dEdx +}; +//________________________________________________________________________________ +class StPionDEV_dEdx : public St_spline3C {// Log(dN/dx) versus log10(beta*gamma) + public: + static StPionDEV_dEdx* instance(); + StPionDEV_dEdx(St_spline3 *table=0) : St_spline3C(table) {} + virtual ~StPionDEV_dEdx() {fgInstance = 0;} + private: + static StPionDEV_dEdx* fgInstance; + ClassDef(StPionDEV_dEdx,1) //C++ TChair for PionDEV_dEdx +}; +//________________________________________________________________________________ +class StProtonDEV_dEdx : public St_spline3C {// Log(dN/dx) versus log10(beta*gamma) + public: + static StProtonDEV_dEdx* instance(); + StProtonDEV_dEdx(St_spline3 *table=0) : St_spline3C(table) {} + virtual ~StProtonDEV_dEdx() {fgInstance = 0;} + private: + static StProtonDEV_dEdx* fgInstance; + ClassDef(StProtonDEV_dEdx,1) //C++ TChair for ProtonDEV_dEdx +}; +#endif diff --git a/StRoot/StBichsel/St_spline3_Table.cxx b/StRoot/StBichsel/St_spline3_Table.cxx new file mode 100644 index 00000000000..c3223c6da91 --- /dev/null +++ b/StRoot/StBichsel/St_spline3_Table.cxx @@ -0,0 +1,11 @@ + +#include "St_spline3_Table.h" +///////////////////////////////////////////////////////////////////////// +// +// Class St_spline3 wraps the STAF table spline3 +// It has been generated "by automatic". Please don't change it "by hand" +// +///////////////////////////////////////////////////////////////////////// + +#include "Stypes.h" +TableImpl(spline3) diff --git a/StRoot/StBichsel/St_spline3_Table.h b/StRoot/StBichsel/St_spline3_Table.h new file mode 100644 index 00000000000..6f60ccef010 --- /dev/null +++ b/StRoot/StBichsel/St_spline3_Table.h @@ -0,0 +1,23 @@ + +#ifndef STAF_St_spline3_Table +#define STAF_St_spline3_Table + +#include "TTable.h" + +#include "spline3.h" + +/*! + * \class St_spline3 + * \brief C++ wrapper for StAF table + * \author Automatic Generation + * \date Fri May 26 18:56:01 2023 + * + * This was generated for version '.DEV2' + */ +class St_spline3 : public TTable +{ + public: + ClassDefTable(St_spline3,spline3_st) + ClassDef(St_spline3,2) //C++ wrapper for StAF table +}; +#endif diff --git a/StRoot/StBichsel/StdEdxModel.cxx b/StRoot/StBichsel/StdEdxModel.cxx index 781498ee046..9022923c133 100644 --- a/StRoot/StBichsel/StdEdxModel.cxx +++ b/StRoot/StBichsel/StdEdxModel.cxx @@ -11,6 +11,7 @@ #include "StdEdxModel.h" #include "Bichsel.h" #include "TCallf77.h" +#include "St_spline3C.h" #ifndef WIN32 #define ggderiv ggderiv_ #else @@ -30,46 +31,62 @@ StdEdxModel* StdEdxModel::instance() { return fgStdEdxModel; } //________________________________________________________________________________ -StdEdxModel::StdEdxModel() : mdNdx(0), fScale(1) +StdEdxModel::StdEdxModel() : fScale(1) , fTmaxL10eV(5) // Tcut = 100 keV - , fGGaus(0), fGausExp(0) - , fpol2F(0), fpol5F(0), fpol6F(0), fpol7F(0) - , fLogkeVperElectron(0) { // LOG_INFO << "StdEdxModel:: use StTpcRSMaker model for dE/dx calculations" << endm; cout << "StdEdxModel:: use StTpcRSMaker model for dE/dx calculations" << endl; - if (! fgStdEdxModel) { - TDirectory *dir = gDirectory; - fgStdEdxModel = this; - const Char_t *path = ".:./StarDb/dEdxModel:$STAR/StarDb/dEdxModel"; - const Char_t *Files[1] = {"dNdx_Bichsel.root"}; - for (Int_t i = 0; i < 1; i++) { // files - Char_t *file = gSystem->Which(path,Files[i],kReadPermission); - if (! file) Fatal("StdEdxModel","File %s has not been found in path %s",Files[i],path); - else Warning("StdEdxModel","File %s has been found as %s",Files[i],file); - TFile *pFile = new TFile(file); - mdNdx = (TH1D *) pFile->Get("dNdx"); if (mdNdx) mdNdx->SetDirectory(0); - assert(mdNdx); - delete pFile; - delete [] file; + memset(beg, 0, end-beg+1); + TDirectory *dir = gDirectory; + fgStdEdxModel = this; + Int_t NFiles = 2; // old + if ( ! Stspline3LndNdxL10::instance()) NFiles = 1; + if ( Stspline3LndNdxL10::instance()->IsValid()) NFiles = 1; + + const Char_t *path = ".:./StarDb/dEdxModel:$STAR/StarDb/dEdxModel"; +#ifndef __HEED__ + const Char_t *Files[2] = {"dNdE_Bichsel.root","dNdx_Bichsel.root"}; +#else + const Char_t *Files[2] = {"dNdx_Heed.root","dNdx_Heed.root"}; +#endif +#define __Warn_Hist__(__HIST__) {m ## __HIST__ = (TH1D *) pFile->Get(#__HIST__); \ + if (m ## __HIST__) {Warning("StdEdxModel","Histogram %s/%s has been found",m ## __HIST__->GetName(),m ## __HIST__->GetTitle()); m ## __HIST__->SetDirectory(0);}} + for (Int_t i = 0; i < NFiles; i++) { // files + Char_t *file = gSystem->Which(path,Files[i],kReadPermission); + if (! file) Fatal("StdEdxModel","File %s has not been found in path %s",Files[i],path); + else Warning("StdEdxModel","File %s has been found as %s",Files[i],file); + TFile *pFile = new TFile(file); + if (i == 1) { + __Warn_Hist__(dNdx); + __Warn_Hist__(dNdxL10); + __Warn_Hist__(LndNdxL10); + __Warn_Hist__(LndNdxL10Smooth); + mLndNdxL10Spline5 = (TSpline5 *) pFile->Get("LndNdxL10Spline5"); if (mLndNdxL10Spline5) {Warning("StdEdxModel","TSpline5 %s has been found",mLndNdxL10Smooth->GetName());} + assert(mdNdx || mdNdxL10); + } else { + mdNdEL10 = (TH1D *) pFile->Get("dNdEL10"); assert(mdNdEL10); Warning("StdEdxModel","Histogram %s/%s has been found",mdNdEL10->GetName(),mdNdEL10->GetTitle()); mdNdEL10->SetDirectory(0); } - dir->cd(); + delete pFile; + delete [] file; } +#undef __Warn_Hist__ + dir->cd(); fGGaus = new TF1("GGaus",ggaus, -1., 5., 5); fGGaus->SetParNames("NormL","mu","sigma","alpha","k"); fGGaus->SetParameters(0,0,0.3,0.1,0); fGGaus->FixParameter(4,0.0); - + fGausExp = new TF1("GausExp",gausexp, -5., 5., 5); fGausExp->SetParNames("NormL","mu","sigma","k","l"); fGausExp->SetParameters(0,0,0.3,5.,0); fGausExp->FixParameter(4,0.0); InitPar(); // Set normalization point the same as for I70 (increase energy per conduction electron from 20 eB to 52 eV) - Double_t dEdxMIPLog = TMath::Log(2.62463815285237434); //TMath::Log(2.39761562607903311); // [keV/cm] for dX = 2 cm + // Double_t dEdxMIPLog = TMath::Log(2.62463815285237434) + 0.0174824 + 3.57110e-03; ; //TMath::Log(2.39761562607903311); // [keV/cm] for dX = 2 cm + Double_t dEdxMIPLog = TMath::Log(2.62463815285237434); ; //TMath::Log(2.39761562607903311); // [keV/cm] for dX = 2 cm Double_t MIPBetaGamma10 = TMath::Log10(4.); - // log2dx, charge - Double_t pars[3] = { 1.0, 1.0}; + // log2dx, charge mass + Double_t pars[3] = { 1.0, 1.0, 0.13956995}; Double_t dEdxLog = zMP(&MIPBetaGamma10, pars); fLogkeVperElectron = dEdxMIPLog - dEdxLog; cout << "StdEdxModel:: set scale = " << Form("%5.1f",1e3*keVperElectron()) << " eV/electron" << endl; @@ -78,7 +95,16 @@ StdEdxModel::StdEdxModel() : mdNdx(0), fScale(1) StdEdxModel::~StdEdxModel() { fgStdEdxModel = 0; SafeDelete(mdNdx); + SafeDelete(mdNdxL10); + SafeDelete(mLndNdxL10); + SafeDelete(mLndNdxL10Smooth); + SafeDelete(mLndNdxL10Spline5); SafeDelete(fGGaus); + SafeDelete(fGausExp); + SafeDelete(fpol2F); + SafeDelete(fpol5F); + SafeDelete(fpol6F); + SafeDelete(fpol7F); } //________________________________________________________________________________ Double_t StdEdxModel::dNdx(Double_t poverm, Double_t charge) { @@ -93,8 +119,40 @@ Double_t StdEdxModel::dNdx(Double_t poverm, Double_t charge) { Double_t w3 = 121.4139*w2 + 0.0378*TMath::Sin(190.7165*w2); Q_eff *= 1. -w1*TMath::Exp(-w3); } - if (mdNdx) return fScale*Q_eff*Q_eff*mdNdx->Interpolate(poverm); - return 0; + Double_t dNdx = 0; + if ( Stspline3LndNdxL10::instance() && Stspline3LndNdxL10::instance()->IsValid()) { + dNdx = TMath::Exp(Stspline3LndNdxL10::instance()->Func()->Eval(TMath::Log10(poverm))); + } else {// old + if (mLndNdxL10Spline5) { + dNdx = TMath::Exp(mLndNdxL10Spline5->Eval(TMath::Log10(poverm))); + } else if (mLndNdxL10Smooth) { + dNdx = TMath::Exp(mLndNdxL10Smooth->Interpolate(TMath::Log10(poverm))); + } else if (mLndNdxL10) { + dNdx = TMath::Exp(mLndNdxL10->Interpolate(TMath::Log10(poverm))); + } else if (mdNdxL10) { + dNdx = mdNdxL10->Interpolate(TMath::Log10(poverm)); + } else if (mdNdx) { + dNdx = mdNdx->Interpolate(poverm); + } + } + return fScale*Q_eff*Q_eff*dNdx; +} +//________________________________________________________________________________ +Double_t StdEdxModel::dNdxL10func(Double_t *x, Double_t *p) { + Double_t bgL10 = x[0]; + Double_t bg = TMath::Power(10., bgL10); + return instance()->dNdx(bg, 1.); +} +//________________________________________________________________________________ +TF1 *StdEdxModel::dNdxL10F() { + TF1 *f = new TF1("dNdxL10F",dNdxL10func,-2,5,0); + return f; +} +//________________________________________________________________________________ +Double_t StdEdxModel::dNdE() { + static Double_t cLog10 = TMath::Log(10.); + Double_t dE = TMath::Exp(cLog10*mdNdEL10->GetRandom()); + return dE; } //________________________________________________________________________________ Double_t StdEdxModel::gausw(Double_t *x, Double_t *p) { @@ -189,7 +247,7 @@ Double_t StdEdxModel::ggaus(Double_t *x, Double_t *p) { ksi = mu - w*m_0; // Double_t mean = ksi + w * muz; } - Double_t par[4] = {NormL, ksi, w, alpha}; + Double_t par[5] = {NormL, ksi, w, alpha, 0}; Double_t V = gausw(x, par); if (der) { #if 0 /* Derivatives */ @@ -398,7 +456,7 @@ TF1 *StdEdxModel::FParam(Int_t l) { } //________________________________________________________________________________ Double_t StdEdxModel::Prob(Double_t /* log(nE/Np) */ ee, Double_t Np, Double_t *der) { // GG: ggaus - Double_t params[4] = {0}; + Double_t params[5] = {0}; Double_t V = 0; if (! der) { Parameters(Np, ¶ms[1]); @@ -473,7 +531,7 @@ TF1 *StdEdxModel::FProbDer() { #if 0 //________________________________________________________________________________ Double_t StdEdxModel::ProbEx(Double_t /* log(nE/Np) */ ee, Double_t Np, Double_t *der) { // GEX : gausexp - Double_t params[4] = {0}; + Double_t params[5] = {0}; Double_t V = 0; if (! der) { Parameters(Np, ¶ms[1]); @@ -496,12 +554,14 @@ Double_t StdEdxModel::ProbdEGeVlog(Double_t dEGeVLog, Double_t Np, Double_t *der } //________________________________________________________________________________ Double_t StdEdxModel::zMP(Double_t *x, Double_t *p) { // log(keV/cm) - Double_t log10bg = x[0]; - Double_t pOverMRC = TMath::Power(10., log10bg); + Double_t bgL10 = x[0]; + Double_t pOverMRC = TMath::Power(10., bgL10); + // Double_t bgL10 = TMath::Log10(pOverM); Double_t log2dx = p[0]; Double_t charge = p[1]; + Double_t mass = p[2]; Double_t dx = TMath::Power( 2., log2dx); - Double_t dNdx = StdEdxModel::instance()->dNdxEff(pOverMRC, charge); // */dNdxVsBgC*.root [-1.5,5] + Double_t dNdx = StdEdxModel::instance()->dNdxEff(pOverMRC, charge, mass); // */dNdxVsBgC*.root [-1.5,5] Double_t Np = dNdx*dx; // Double_t NpLog = TMath::Log(Np); // Double_t mu = instance()->Parameter(Np, 0); @@ -510,19 +570,70 @@ Double_t StdEdxModel::zMP(Double_t *x, Double_t *p) { // log(keV/cm) // Double_t dEkeVLog = NpLog + mu -3.13746587897608142e+00 +1.78334647296254700e-01;// + 7.02725079814016507e+00;// - 3.13746587897608142e+00;// 43.4 eV/conducting electron Double_t dEkeVLog = instance()->MukeV(Np); // Parameter(Np, 0); Double_t dEdxLog = dEkeVLog - TMath::Log(dx); - return dEdxLog; + Double_t dEdxCor = 0; +#if 0 + StElectonsDEV_dEdx *EL = StElectonsDEV_dEdx::instance(); + if ( EL && EL->IsValid() && EL->InRange(bgL10)) { + dEdxCor = StElectonsDEV_dEdx::instance()->Func()->Eval(bgL10); + static TF1 *elCor1 = 0; + if (! elCor1) { + Double_t pars1[4] = {-0.2100929, 0.1500455, -0.02743834, 0.001894849}; //electrons [2.1,3.3] + Double_t pars2[4] = {-0.04352509, 0.03437069, -0.002851349, -0.0003568138}; //electornsD + Double_t pars[4] = {0}; + for (Int_t i = 0; i < 4; i++) pars[i] = pars1[i] + pars2[i]; + elCor1 = new TF1("dEdxElCor1","pol3",2.0,3.5); elCor1->SetParameters(pars); + } + dEdxCor += elCor1->Eval(bgL10); + dEdxCor += -7.63891e-03 - 3.57110e-03 ; + } else { // pions and protons + static Double_t pionM = 0.13956995; + static Double_t protonM = 0.9382723; + static Double_t mPionL10 = TMath::Log10(pionM); + static Double_t mProtonL10 = TMath::Log10(protonM); + static Double_t dML10 = mProtonL10 - mPionL10; + Double_t dEdxCorPion = 0; + Double_t dEdxCorProton = 0; + StPionDEV_dEdx *PI = StPionDEV_dEdx::instance(); + if ( PI && PI->IsValid() && PI->InRange(bgL10)) { + dEdxCorPion = PI->Func()->Eval(bgL10); + static TF1 *piCor1 = 0; + if (! piCor1) { + Double_t pars[4] = {0.008567411, 0.01817216, -0.004932309, -0.001434306}; //pionD + piCor1 = new TF1("dEdxPiCor1","pol3",-0.2,1.6); piCor1->SetParameters(pars); + } + dEdxCorPion += piCor1->Eval(bgL10); + } + StProtonDEV_dEdx *P = StProtonDEV_dEdx::instance(); + if (P &&P->IsValid() &&P->InRange(bgL10)) { + dEdxCorProton = P->Func()->Eval(bgL10); + static TF1 *protonCor1 = 0; + if (! protonCor1) { + Double_t pars[6] = {0.01745018 + 0.005654033 - 3.57110e-03 , 0.005726225 -0.00228347, 0.004416636, -0.02814983, 0.1824491, -0.2114645}; //protonD + // Double_t pars2[2] = {0.005654033, -0.00228347}; //proton dEdxG + protonCor1 = new TF1("dEdxProtonCor1","pol5",-0.5,0.8); protonCor1->SetParameters(pars); + } + dEdxCorProton += protonCor1->Eval(bgL10); + } + Double_t mL10 = TMath::Log10(mass); + dEdxCor += dEdxCorPion + (dEdxCorProton - dEdxCorPion)*(mL10 - mPionL10)/dML10; + } + // dEdxCor = 1.66944e-02; + // dEdxCor += 0.0174824; +#endif + return dEdxLog + dEdxCor; } //________________________________________________________________________________ -TF1 *StdEdxModel::ZMP(Double_t log2dx) { +TF1 *StdEdxModel::ZMP(Double_t log2dx, Double_t charge, Double_t mass) { TString fName(Form("New%i",(int)(2*(log2dx+2)))); TF1 *f = (TF1 *) gROOT->GetListOfFunctions()->FindObject(fName); if (! f) { - f = new TF1(fName,zMP,-2,5,2); - f->SetParName(0,"log2dx"); + f = new TF1(fName,zMP,-2,5,3); f->SetLineStyle(4); + f->SetParNames("log2dx","charge","mass"); f->SetParameter(0,log2dx); - f->SetParameter(1, 1.0); // charge - cout << "Create ZMPNew with name " << f->GetName() << " for log2dx = " << log2dx << endl; + f->SetParameter(1, charge); + f->SetParameter(2, mass); + cout << "Create ZMPNew with name " << f->GetName() << " for log2dx = " << log2dx << " and mass = " << mass << endl; } return f; } @@ -628,130 +739,42 @@ TH1D *StdEdxModel::protonEff() { //========= Macro generated from object: Func/ //========= by ROOT version5.34/39 - TH1D *Func__1 = new TH1D("protonEff","",100,-2.0,0.0); - Func__1->SetBinContent(1,0.829974); - Func__1->SetBinContent(2,0.833488); - Func__1->SetBinContent(3,0.836679); - Func__1->SetBinContent(4,0.839568); - Func__1->SetBinContent(5,0.842227); - Func__1->SetBinContent(6,0.844577); - Func__1->SetBinContent(7,0.846659); - Func__1->SetBinContent(8,0.848506); - Func__1->SetBinContent(9,0.850145); - Func__1->SetBinContent(10,0.851604); - Func__1->SetBinContent(11,0.857514); - Func__1->SetBinContent(12,0.863548); - Func__1->SetBinContent(13,0.869116); - Func__1->SetBinContent(14,0.874097); - Func__1->SetBinContent(15,0.878448); - Func__1->SetBinContent(16,0.88217); - Func__1->SetBinContent(17,0.885305); - Func__1->SetBinContent(18,0.887923); - Func__1->SetBinContent(19,0.890128); - Func__1->SetBinContent(20,0.891974); - Func__1->SetBinContent(21,0.893513); - Func__1->SetBinContent(22,0.894796); - Func__1->SetBinContent(23,0.895866); - Func__1->SetBinContent(24,0.896761); - Func__1->SetBinContent(25,0.897513); - Func__1->SetBinContent(26,0.898147); - Func__1->SetBinContent(27,0.898683); - Func__1->SetBinContent(28,0.899139); - Func__1->SetBinContent(29,0.899531); - Func__1->SetBinContent(30,0.899868); - Func__1->SetBinContent(31,0.90016); - Func__1->SetBinContent(32,0.900415); - Func__1->SetBinContent(33,0.900639); - Func__1->SetBinContent(34,0.900836); - Func__1->SetBinContent(35,0.90101); - Func__1->SetBinContent(36,0.901165); - Func__1->SetBinContent(37,0.901304); - Func__1->SetBinContent(38,0.901431); - Func__1->SetBinContent(39,0.90164); - Func__1->SetBinContent(40,0.901817); - Func__1->SetBinContent(41,0.901969); - Func__1->SetBinContent(42,0.902099); - Func__1->SetBinContent(43,0.902212); - Func__1->SetBinContent(44,0.902309); - Func__1->SetBinContent(45,0.902392); - Func__1->SetBinContent(46,0.902469); - Func__1->SetBinContent(47,0.902536); - Func__1->SetBinContent(48,0.902595); - Func__1->SetBinContent(49,0.902646); - Func__1->SetBinContent(50,0.902692); - Func__1->SetBinContent(51,0.902733); - Func__1->SetBinContent(52,0.902769); - Func__1->SetBinContent(53,0.902801); - Func__1->SetBinContent(54,0.90283); - Func__1->SetBinContent(55,0.902857); - Func__1->SetBinContent(56,0.902881); - Func__1->SetBinContent(57,0.902902); - Func__1->SetBinContent(58,0.902922); - Func__1->SetBinContent(59,0.90294); - Func__1->SetBinContent(60,0.902956); - Func__1->SetBinContent(61,0.90297); - Func__1->SetBinContent(62,0.902984); - Func__1->SetBinContent(63,0.902996); - Func__1->SetBinContent(64,0.903007); - Func__1->SetBinContent(65,0.903017); - Func__1->SetBinContent(66,0.903026); - Func__1->SetBinContent(67,0.903034); - Func__1->SetBinContent(68,0.903042); - Func__1->SetBinContent(69,0.903049); - Func__1->SetBinContent(70,0.903055); - Func__1->SetBinContent(71,0.903061); - Func__1->SetBinContent(72,0.903066); - Func__1->SetBinContent(73,0.903071); - Func__1->SetBinContent(74,0.903075); - Func__1->SetBinContent(75,0.903079); - Func__1->SetBinContent(76,0.90308); - Func__1->SetBinContent(77,0.90308); - Func__1->SetBinContent(78,0.90308); - Func__1->SetBinContent(79,0.90308); - Func__1->SetBinContent(80,0.90308); - Func__1->SetBinContent(81,0.90308); - Func__1->SetBinContent(82,0.90308); - Func__1->SetBinContent(83,0.90308); - Func__1->SetBinContent(84,0.90308); - Func__1->SetBinContent(85,0.90308); - Func__1->SetBinContent(86,0.90308); - Func__1->SetBinContent(87,0.90308); - Func__1->SetBinContent(88,0.90308); - Func__1->SetBinContent(89,0.90308); - Func__1->SetBinContent(90,0.90308); - Func__1->SetBinContent(91,0.90308); - Func__1->SetBinContent(92,0.90308); - Func__1->SetBinContent(93,0.90308); - Func__1->SetBinContent(94,0.90308); - Func__1->SetBinContent(95,0.90308); - Func__1->SetBinContent(96,0.90308); - Func__1->SetBinContent(97,0.90308); - Func__1->SetBinContent(98,0.90308); - Func__1->SetBinContent(99,0.90308); - Func__1->SetBinContent(100,0.90308); - Func__1->SetEntries(700); - Func__1->SetDirectory(0); - Func__1->SetStats(0); - Func__1->SetFillColor(19); - Func__1->SetFillStyle(0); - Func__1->SetLineColor(9); - Func__1->SetLineWidth(3); - Func__1->SetMarkerStyle(20); - Func__1->GetXaxis()->SetTitleOffset(1.2); - // Func__1->Draw(""); - return Func__1; + TH1D *eff = new TH1D("protonEff","",100,-2.0,0.0); + Double_t corr[102] = { 0, + 0.8300, 0.8335, 0.8367, 0.8396, 0.8422, 0.8446, 0.8467, 0.8485, 0.8501, 0.8516, + 0.8575, 0.8635, 0.8691, 0.8741, 0.8784, 0.8822, 0.8853, 0.8879, 0.8901, 0.8920, + 0.8935, 0.8948, 0.8959, 0.8968, 0.8975, 0.8981, 0.8987, 0.8991, 0.8995, 0.8999, + 0.9002, 0.9004, 0.9006, 0.9008, 0.9010, 0.9012, 0.9013, 0.9014, 0.9016, 0.9018, + 0.9020, 0.9021, 0.9022, 0.9023, 0.9024, 0.9025, 0.9025, 0.9026, 0.9026, 0.9027, + 0.9027, 0.9028, 0.9028, 0.9028, 0.9029, 0.9029, 0.9029, 0.9029, 0.9029, 0.9030, + 0.9030, 0.9030, 0.9030, 0.9030, 0.9030, 0.9030, 0.9030, 0.9030, 0.9030, 0.9031, + 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, + 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, + 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, 0.9031, + 0}; + eff->Set(102, corr); + eff->SetDirectory(0); + eff->SetStats(0); + eff->SetFillColor(19); + eff->SetFillStyle(0); + eff->SetLineColor(9); + eff->SetLineWidth(3); + eff->SetMarkerStyle(20); + eff->GetXaxis()->SetTitleOffset(1.2); + // eff->Draw(""); + return eff; } //________________________________________________________________________________ Double_t StdEdxModel::NpCorrection(Double_t betagamma) { Double_t bgL10 = TMath::Log10(betagamma); - bgL10 = TMath::Max(-2.0, TMath::Min(1.0,bgL10)); + bgL10 = TMath::Max(-2.0, TMath::Min(-1e-3,bgL10)); static TH1D *eff = 0; if (! eff) eff = protonEff(); // return 1.03*eff->Interpolate(bgL10); return eff->Interpolate(bgL10); } //________________________________________________________________________________ -Double_t StdEdxModel::dNdxEff(Double_t poverm, Double_t charge) { +Double_t StdEdxModel::dNdxEff(Double_t poverm, Double_t charge, Double_t mass) { if (!fgStdEdxModel) instance(); Double_t bgMC = bgCorrected(poverm); Double_t dNdxMC = dNdx(bgMC, charge); @@ -759,6 +782,16 @@ Double_t StdEdxModel::dNdxEff(Double_t poverm, Double_t charge) { return dNdx; } //________________________________________________________________________________ +Double_t StdEdxModel::dNdxEffL10func(Double_t *x, Double_t *p) { + Double_t bg = TMath::Power(10., x[0]); + return instance()->dNdxEff(bg, 1., 0.13956995); +} +//________________________________________________________________________________ +TF1 *StdEdxModel::dNdxEffL10F() { + TF1 *f = new TF1("dNdxEffL10F",dNdxEffL10func,-2,5,0); + return f; +} +//________________________________________________________________________________ Double_t StdEdxModel::extremevalueG(Double_t *x, Double_t *p) { Double_t normL = p[0]; Double_t mu = p[1]; diff --git a/StRoot/StBichsel/StdEdxModel.h b/StRoot/StBichsel/StdEdxModel.h index 10f8d1169a8..6658cad1028 100644 --- a/StRoot/StBichsel/StdEdxModel.h +++ b/StRoot/StBichsel/StdEdxModel.h @@ -10,6 +10,7 @@ #include "TFile.h" #include "TString.h" #include "TF1.h" +#include "TSpline.h" class StdEdxParamerization { }; class StdEdxModel { @@ -20,14 +21,18 @@ class StdEdxModel { enum EValType {kProb, kdProbdX, kdProbdY}; virtual ~StdEdxModel(); static StdEdxModel* instance(); - TH1D *GetdNdx() {return mdNdx;} // dN/dx versus beta*gamma static Double_t gausw(Double_t *x, Double_t *p); // vesus ksi, w, alpha static Double_t ggaus(Double_t *x, Double_t *p); // versus mu, sigm, alpha static Double_t ggausD(Double_t *x, Double_t *p, Double_t *der = 0); // versus mu, sigm, alpha wth derivatives static Double_t gausexp(Double_t *x, Double_t *p); // versus mu, sigma, k static Double_t gausexpD(Double_t *x, Double_t *p, Double_t *der = 0); // versus mu, sigma, k - Double_t dNdx(Double_t poverm, Double_t charge = 1.0); - Double_t dNdxEff(Double_t poverm, Double_t charge = 1.0); + Double_t dNdx(Double_t poverm, Double_t charge = 1.0); + TF1 *dNdxL10F(); + static Double_t dNdxL10func(Double_t *x, Double_t *p); + Double_t dNdxEff(Double_t poverm, Double_t charge = 1.0, Double_t mass = 0.13956995); + static Double_t dNdxEffL10func(Double_t *x, Double_t *p); + TF1 *dNdxEffL10F(); + Double_t dNdE(); static Double_t saturationFunc(Double_t *x, Double_t *p); // nP saturation versus beta*gamma from TpcRS (nP/dX - dN/dx_model) TF1 *GGaus() {return fGGaus;} TF1 *GausExp() {return fGausExp;} @@ -63,8 +68,8 @@ class StdEdxModel { Double_t ProbdEGeVlog(Double_t dEGeVLog, Double_t Np, Double_t *der = 0); // probability for give log(dE(GeV)) versus Np void SetScale(Double_t scale = 1.0) {fScale = scale;} Double_t dNdxScale() {return fScale;} - static Double_t zMP(Double_t *x, Double_t *p); // most probable log (dE) versus x = log10(p/M) and p[0] = log2dx and p[1] = charge - TF1 *ZMP(Double_t log2dx = 1); + static Double_t zMP(Double_t *x, Double_t *p); // most probable log (dE) versus x = log10(p/M) and p[0] = log2dx, p[1] = charge, and p[2] = mass + TF1 *ZMP(Double_t log2dx = 1, Double_t charge = 1, Double_t mass = 0.1395699); // from 100 keV Tcut (GEXNor.C) void InitPar(); Double_t tmaxL10eV(Double_t betagamma); // eV @@ -75,16 +80,23 @@ class StdEdxModel { StdEdxModel(); static StdEdxModel *fgStdEdxModel; //! last instance static Int_t _debug; - TH1D *mdNdx; // dN/dx versus beta*gamma Double_t fScale; Double_t fTmaxL10eV; - TF1 *fGGaus; - TF1 *fGausExp; - TF1 *fpol2F; - TF1 *fpol5F; - TF1 *fpol6F; - TF1 *fpol7F; + Char_t beg[1]; //! Double_t fLogkeVperElectron; + TH1D *mdNdx; //! + TH1D *mdNdxL10; //! + TH1D *mLndNdxL10; //! + TH1D *mLndNdxL10Smooth; //! + TSpline5 *mLndNdxL10Spline5; //! + TH1D *mdNdEL10; //! + TF1 *fGGaus; //! + TF1 *fGausExp; //! + TF1 *fpol2F; //! + TF1 *fpol5F; //! + TF1 *fpol6F; //! + TF1 *fpol7F; //! + Char_t end[1]; //! ClassDef(StdEdxModel,0) }; #endif diff --git a/StRoot/StBichsel/StdEdxPull.cxx b/StRoot/StBichsel/StdEdxPull.cxx index c048bf19f50..725e8ba6b5d 100644 --- a/StRoot/StBichsel/StdEdxPull.cxx +++ b/StRoot/StBichsel/StdEdxPull.cxx @@ -2,35 +2,35 @@ #include "StdEdxModel.h" #include "StdEdxPull.h" //________________________________________________________________________________ -Double_t StdEdxPull::EvalPred(Double_t betagamma, UChar_t fit, Int_t charge) { - Double_t dedx_expected; - Double_t dx2 = 1; - if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.); +Double_t StdEdxPull::EvalPred(Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) { + Double_t dedx_expected = 0; if (! fit) { // I70 + Double_t dx2 = 1; + if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.); dedx_expected = 1.e-6*charge*charge*Bichsel::Instance()->GetI70M(TMath::Log10(betagamma),dx2); } else if ( fit == 1) { // Ifit // dedx_expected = 1.e-6*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(betagamma),dx2)); - Double_t par[3] = {TMath::Log10(betagamma), 1., (Double_t) charge}; + Double_t par[4] = {TMath::Log10(betagamma), 1., (Double_t) charge, mass}; dedx_expected = 1.e-6*TMath::Exp(StdEdxModel::instance()->zMP(par,&par[1])); } else { // dNdx_eff // dedx_expected = StdEdxModel::instance()->dNdx(betagamma,charge); - dedx_expected = StdEdxModel::instance()->dNdxEff(betagamma,charge); + dedx_expected = StdEdxModel::instance()->dNdxEff(betagamma,charge, mass); } return dedx_expected; } //________________________________________________________________________________ -Double_t StdEdxPull::EvalDeV(Double_t dEdx, Double_t betagamma, UChar_t fit, Int_t charge) { - return TMath::Log(dEdx/EvalPred(betagamma, fit, charge)); +Double_t StdEdxPull::EvalDeV(Double_t dEdx, Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) { + return TMath::Log(dEdx/EvalPred(betagamma, fit, charge, mass)); } //________________________________________________________________________________ -Double_t StdEdxPull::Eval(Double_t dEdx, Double_t dEdxError, Double_t betagamma, UChar_t fit, Int_t charge) { - return (dEdxError > 0) ? EvalDeV(dEdx, betagamma, fit, charge)/dEdxError : -999; +Double_t StdEdxPull::Eval(Double_t dEdx, Double_t dEdxError, Double_t betagamma, UChar_t fit, Int_t charge, Double_t mass) { + return (dEdxError > 0) ? EvalDeV(dEdx, betagamma, fit, charge, mass)/dEdxError : -999; } //________________________________________________________________________________ Double_t StdEdxPull::EvalPred2(Double_t betagamma, Double_t dx2, UChar_t fit, Int_t charge) { - Double_t dedx_expected; - if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.); + Double_t dedx_expected = 0; if (! fit) { // I70 + if (TMath::Abs(charge) > 1) dx2 = TMath::Log2(5.); dedx_expected = 1.e-6*charge*charge*Bichsel::Instance()->GetI70M(TMath::Log10(betagamma),dx2); } else if ( fit == 1) { // Ifit dedx_expected = 1.e-6*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(betagamma),dx2)); diff --git a/StRoot/StBichsel/StdEdxPull.h b/StRoot/StBichsel/StdEdxPull.h index b089aa2cb76..2f85b8ba8be 100644 --- a/StRoot/StBichsel/StdEdxPull.h +++ b/StRoot/StBichsel/StdEdxPull.h @@ -3,9 +3,9 @@ #include "Rtypes.h" #include "TMath.h" namespace StdEdxPull { - Double_t EvalPred(Double_t betagamma, UChar_t fit = 0, Int_t charge=1); - Double_t EvalDeV(Double_t dEdx, Double_t betagamma, UChar_t fit = 0, Int_t charge=1); - Double_t Eval(Double_t dEdx, Double_t dEdxError, Double_t betagamma, UChar_t fit = 0, Int_t charge=1); + Double_t EvalPred(Double_t betagamma, UChar_t fit = 0, Int_t charge=1, Double_t mass = 0); + Double_t EvalDeV(Double_t dEdx, Double_t betagamma, UChar_t fit = 0, Int_t charge=1, Double_t mass = 0); + Double_t Eval(Double_t dEdx, Double_t dEdxError, Double_t betagamma, UChar_t fit = 0, Int_t charge=1, Double_t mass = 0); Double_t EvalPred2(Double_t betagamma, Double_t dx2, UChar_t fit = 0, Int_t charge=1); Double_t EvalDeV2(Double_t dEdx, Double_t betagamma, Double_t dx2, UChar_t fit = 0, Int_t charge=1); Double_t Eval2(Double_t dEdx, Double_t dEdxError, Double_t betagamma, Double_t dx2, UChar_t fit = 0, Int_t charge=1); diff --git a/StRoot/StBichsel/bichselG10.C b/StRoot/StBichsel/bichselG10.C index 08fa1b57370..ec9bb51b4eb 100644 --- a/StRoot/StBichsel/bichselG10.C +++ b/StRoot/StBichsel/bichselG10.C @@ -85,10 +85,27 @@ #include "StBichsel/StdEdxPull.h" #include "TLegend.h" #include "TROOT.h" +#include "TString.h" #else class Bichsel; #endif -Bichsel *m_Bichsel = 0; +// function object (functor) +struct MyDerivFunc { + MyDerivFunc(TF1 * f): fFunc(f) {} + double operator() (double *x, double * ) const { + return fFunc->Derivative(*x); + } + TF1 * fFunc; +}; +//________________________________________________________________________________ +TF1 *Derivative(TF1 *f1) { + MyDerivFunc * deriv = new MyDerivFunc(f1); + TString name("der_"); + name += f1->GetName(); + TF1 * f2 = new TF1(name,deriv, f1->GetXmin(), f1->GetXmax(), 0, "MyDerivFunc"); + return f2; +} +//Bichsel *m_Bichsel = 0; const Int_t NMasses = 20; const Double_t kAu2Gev=0.9314943228; struct Part_t { @@ -146,8 +163,8 @@ Double_t bichselZ(Double_t *x,Double_t *par) { poverm *= charge; dx2 = TMath::Log2(5.); } - return TMath::Log10(scale*charge*charge*TMath::Exp(m_Bichsel->GetMostProbableZ(TMath::Log10(poverm),dx2)));//TMath::Exp(7.81779499999999961e-01)); - // Charge*Charge* (TMath::Exp(m_Bichsel->GetMostProbableZM(TMath::Log10(TMath::Abs(Charge)*p/M),dx2))) + return TMath::Log10(scale*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(poverm),dx2)));//TMath::Exp(7.81779499999999961e-01)); + // Charge*Charge* (TMath::Exp(Bichsel::Instance()->GetMostProbableZM(TMath::Log10(TMath::Abs(Charge)*p/M),dx2))) // return TMath::Log10(1e6*scale*StdEdxPull::EvalPred(poverm, 1, charge)); } //________________________________________________________________________________ @@ -158,7 +175,7 @@ Double_t dEdxModelZ(Double_t *x,Double_t *par) { //new dEdxModel if (mass < 0) {mass = - mass; scale = 2;} Double_t poverm = pove/mass; Double_t charge = par[1]; - poverm *= charge; + poverm *= TMath::Abs(charge); return TMath::Log10(1e6*scale*StdEdxPull::EvalPred(poverm, 1, charge)); } //________________________________________________________________________________ @@ -172,7 +189,7 @@ Double_t bichselZM(Double_t *x,Double_t *par) { Double_t dx2 = 1; if (par[1] > 1.0) { charge = par[1]; - poverm *= charge; + poverm *= TMath::Abs(charge); dx2 = TMath::Log2(5.); } return TMath::Log10(1e6*scale*StdEdxPull::EvalPred(poverm, 1, charge)); @@ -224,7 +241,7 @@ Double_t bichsel70Trs(Double_t *x,Double_t *par) { dx2 = TMath::Log2(5.); } scale *= charge*charge; - return TMath::Log10(scale*TMath::Exp(m_Bichsel->I70Trs(part,TMath::Log10(poverm)))); + return TMath::Log10(scale*TMath::Exp(Bichsel::Instance()->I70Trs(part,TMath::Log10(poverm)))); } //________________________________________________________________________________ Double_t bichselZTrs(Double_t *x,Double_t *par) { @@ -243,7 +260,7 @@ Double_t bichselZTrs(Double_t *x,Double_t *par) { dx2 = TMath::Log2(5.); } scale *= charge*charge; - return TMath::Log10(scale*TMath::Exp(m_Bichsel->IfitTrs(part,TMath::Log10(poverm))));//TMath::Exp(7.81779499999999961e-01)); + return TMath::Log10(scale*TMath::Exp(Bichsel::Instance()->IfitTrs(part,TMath::Log10(poverm))));//TMath::Exp(7.81779499999999961e-01)); } #endif //________________________________________________________________________________ @@ -349,17 +366,15 @@ Double_t aleph70(Double_t *x,Double_t *par) { } #endif /* __CINT__ */ //________________________________________________________________________________ -void bichselG10(const Char_t *type="z", Int_t Nhyps = 9, Bool_t rigidity = kFALSE) { +void bichselG10(const Char_t *type="zN", Int_t Nhyps = 9, Bool_t rigidity = kFALSE) { fgRigidity = rigidity; - if (! m_Bichsel) { - if (gClassTable->GetID("StBichsel") < 0) { - gSystem->Load("libTable"); - gSystem->Load("St_base"); - gSystem->Load("StarClassLibrary"); - gSystem->Load("StBichsel"); - } - m_Bichsel = Bichsel::Instance(); + if (gClassTable->GetID("StBichsel") < 0) { + gSystem->Load("libTable"); + gSystem->Load("St_base"); + gSystem->Load("StarClassLibrary"); + gSystem->Load("StBichsel"); } + // m_Bichsel = Bichsel::Instance(); TString Type(type); TLegend *leg = new TLegend(0.85,0.45,0.95,0.9,""); Double_t xmax = 4; diff --git a/StRoot/StBichsel/spline3.h b/StRoot/StBichsel/spline3.h new file mode 100644 index 00000000000..05a55e42c2f --- /dev/null +++ b/StRoot/StBichsel/spline3.h @@ -0,0 +1,33 @@ +/* spline3.h */ +/* This file was made by the idl compiler "stic". Do not edit. +** This was generated for version '(unspecified)' +** Instead, edit the source idl file and then re-run the compiler. +** For help, type contact Craig Tull or Herb Ward. */ +/* COMMENTS FROM IDL FILE: + spine3.idl + + Table: spine3 + + description: keep parameters and knots for TSpline3 creation + + */ +#ifndef SPLINE3_H +#define SPLINE3_H +#define SPLINE3_SPEC \ +"struct spline3 { \ + long nknots; \ + double Xknots[50]; \ + double Yknots[50]; \ + double ValBeg; \ + double ValEnd; \ + octet option[8]; \ +};" +typedef struct spline3_st { + int nknots; /* no. of knots <= 50 */ + double Xknots[50]; /* X of knots */ + double Yknots[50]; /* Y of knots */ + double ValBeg; + double ValEnd; + unsigned char option[8]; /* option for boundary condition */ +} SPLINE3_ST; +#endif /* SPLINE3_H */ diff --git a/StRoot/StChain/GeometryDbAliases.h b/StRoot/StChain/GeometryDbAliases.h index af3be9fac1e..fd7c5bd7dc7 100644 --- a/StRoot/StChain/GeometryDbAliases.h +++ b/StRoot/StChain/GeometryDbAliases.h @@ -162,6 +162,9 @@ static const DbAlias_t fDbAlias[] = {// geometry Comment old { "y2023", 20230410, 0, "y2023", "y2023 first cut geometry, AgML,xgeometry"}, { "y2023a", 20230410, 1, "y2023a", "y2023a production geometry, AgML,xgeometry"}, + { "y2023", 20231210, 0, "y2024", "y2024 first cut geometry, AgML,xgeometry"}, + { "y2023a", 20231210, 1, "y2024a", "y2024a production geometry, AgML,xgeometry"}, + {"dev2021", 21201210, 1, "dev2021", "-deprecated- geometry for 2021+ forward program,AgML,xgeometry"}, {"dev2022", 21211210, 1, "dev2022", "development geometry for 2022+ forward program,AgML,xgeometry"}, diff --git a/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx b/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx index 004bd6941dc..efbd2fc4546 100644 --- a/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx +++ b/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx @@ -1,6 +1,7 @@ #include #include #include "StDetectorDbMaker.h" +#include "TROOT.h" #include "TEnv.h" #include "TF1.h" #include "TMath.h" @@ -12,49 +13,59 @@ using namespace ROOT::Math; #include "St_db_Maker/St_db_Maker.h" #if 0 #include "tables/St_tpcCorrection_Table.h" +#include "tables/St_pidCorrection_Table.h" #include "tables/St_tpcSectorT0offset_Table.h" #include "tables/St_tofTrayConfig_Table.h" -#define DEBUGTABLED(STRUCT) PrintTable(#STRUCT,table ) -#define makeString(PATH) # PATH -#define CHECKTABLED(C_STRUCT) \ - if (table->InheritsFrom("St_" makeSTRING(C_STRUCT))) { \ +#define makeSTRING(PATH) # PATH +#define CHECKTABLED(C_STRUCT) \ + if (table->InheritsFrom("St_" # C_STRUCT)) { \ St_ ## C_STRUCT *t = (St_ ## C_STRUCT *) table ; \ - ## C_STRUCT ## _st *s = t->GetTable(); Nrows = s->nrows; \ - ## C_STRUCT ## _st def = {0}; \ + C_STRUCT ## _st *s = t->GetTable(); Nrows = s->nrows; \ + C_STRUCT ## _st def = {0}; \ iprt = kFALSE; \ - Int_t shift = 0; \ - Int_t NrowSize = t->GetRowSize(); \ - if (! strcmp(makeSTRING(C_STRUCT),"Survey")) {shift = 4; NrowSize = 12*8;}\ - if (! strcmp(makeSTRING(C_STRUCT),"tpcSectorT0offset")) {for (Int_t i = 0; i < 24; i++) def->t0[i] = -22.257;} \ - if (! strcmp(makeSTRING(C_STRUCT),"tofTrayConfig")) {def->entries = 120; for (Int_t i = 0; i < 120; i++) {def->iTray[i] = i+1; def->nModules[i] = 32;} \ - for (Int_t i = 0; i < table->GetNRows(); i++, s++) { \ - if (memcmp(&def+shift, s+shift, NrowSize)) {iprt = kTRUE; break;} \ - } \ - } -//___________________Debug Print out _____________________________________________________________ -void PrintTable(const Char_t *str, TTable *table) { - DEBUGTABLE(str); - Bool_t iprt = kTRUE; - if (St_db_Maker::GetValidity(table,t) > 0) { - if (table->InheritsFrom("St_tpcCorrection")) { - St_tpcCorrection *tt = (St_tpcCorrection *) table; - tpcCorrection_st *s = tt->GetTable(); Nrows = s->nrows;} - if (Nrows > 10) Nrows = 10; - CHECKTABLE(tpcCorrection); - CHECKTABLE(tpcHVPlanes); - CHECKTABLE(Survey); - CHECKTABLE(tpcSectorT0offset); - CHECKTABLE(tofTrayConfig); - if (iprt) { - if (table->GetRowSize() < 512) table->Print(0,Nrows); - } else { - LOG_WARN << "Default table" << endm; + Int_t shift = 0; \ + Int_t NrowSize = t->GetRowSize(); \ + if (! strcmp(makeSTRING(C_STRUCT),"Survey")) {shift = 4; NrowSize = 12*8;} \ + if (! strcmp(makeSTRING(C_STRUCT),"tpcSectorT0offset")) {for (Int_t i = 0; i < 24; i++) def.t0[i] = -22.257;} \ + if (! strcmp(makeSTRING(C_STRUCT),"tofTrayConfig")) {def.entries = 120; for (Int_t i = 0; i < 120; i++) {def.iTray[i] = i+1; def.nModules[i] = 32;} \ + for (Int_t i = 0; i < table->GetNRows(); i++, s++) { \ + if (memcmp(&def+shift, s+shift, NrowSize)) {iprt = kTRUE; break;} \ + } \ } - } } +#define DEBUGTABLE(STRUCT) \ + TDatime t[2]; \ + Bool_t iprt = kTRUE; \ + Int_t Nrows = -1; \ + if (St_db_Maker::GetValidity(table,t) > 0) { \ + if (table->InheritsFrom("St_tpcCorrection") ) { \ + St_tpcCorrection *tt = (St_tpcCorrection *) table; \ + tpcCorrection_st *s = tt->GetTable(); Nrows = s->nrows; \ + } else if (table->InheritsFrom("St_pidCorrection") ) { \ + St_pidCorrection *tt = (St_pidCorrection *) table; \ + pidCorrection_st *s = tt->GetTable(); Nrows = s->nrows; \ + } \ + LOG_WARN << "St_" << makeSTRING(STRUCT) << "C::instance found table " << table->GetName() \ + << " with NRows = " << Nrows << " in db" \ + << Form("\tValidity:%8i.%06i",t[0].GetDate(),t[0].GetTime()) \ + << Form(" - %8i.%06i",t[1].GetDate(),t[1].GetTime()) << endm; \ + if (Nrows > 10) Nrows = 10; \ + CHECKTABLED(tpcCorrection); \ + CHECKTABLED(tpcHVPlanes); \ + CHECKTABLED(Survey); \ + CHECKTABLED(tpcSectorT0offset); \ + CHECKTABLED(tofTrayConfig); \ + if (iprt) { \ + if (table->GetRowSize() < 512) table->Print(0,Nrows); \ + } else { \ + LOG_WARN << "Default table" << endm; \ + } \ + } +//___________________Debug Print out _____________________________________________________________ #endif #include "StarChairDefs.h" static Int_t _debug = 0; + //___________________Calibrations/ftpc_____________________________________________________________ #include "StDetectorDbFTPCGas.h" StDetectorDbFTPCGas* StDetectorDbFTPCGas::fgInstance = 0; @@ -76,7 +87,11 @@ MakeChairInstance(tpcGridLeak,Calibrations/tpc/tpcGridLeak); #include "St_tpcOmegaTauC.h" MakeChairInstance(tpcOmegaTau,Calibrations/tpc/tpcOmegaTau); #include "St_tpcDriftVelocityC.h" +#include "St_starClockOnlC.h" MakeChairInstance(tpcDriftVelocity,Calibrations/tpc/tpcDriftVelocity); +Float_t St_tpcDriftVelocityC::timeBucketPitch(Int_t i) { + return laserDriftVelocityEast(i)/St_starClockOnlC::instance()->Frequency()*1e6; // cm +} #include "St_TpcSecRowCorC.h" ClassImp(St_TpcSecRowCorC); #include "St_TpcSecRowBC.h" @@ -350,6 +365,126 @@ Int_t St_tpcCorrectionC::IsActiveChair() const { } return npar; } +#include "St_pidCorrectionC.h" +MakeChairInstance2(pidCorrection,St_pidCorrectionC,dEdxModel/PiDC/pidCorrection); +//________________________________________________________________________________ +Double_t St_pidCorrectionC::CalcCorrection(Int_t i, Double_t x, Double_t z, Int_t NparMax) const { + pidCorrection_st *cor = ((St_pidCorrection *) Table())->GetTable() + i; + return SumSeries(cor, x, z, NparMax); +} +//________________________________________________________________________________ +Double_t St_pidCorrectionC::SumSeries(pidCorrection_st *cor, Double_t x, Double_t z, Int_t NparMax) const { + Double_t Sum = 0; + if (! cor) return Sum; + Int_t N = TMath::Abs(cor->npar)%100; + if (N == 0) return Sum; + if (NparMax > 0) N = NparMax; + Double_t X = x; + if (X < cor->min) return Sum; + if (X > cor->max) return Sum; + Double_t T0, T1, T2; + switch (cor->type) { + case 1: // Tchebyshev [-1,1] + if (cor->min < cor->max) X = -1 + 2*TMath::Max(0.,TMath::Min(1.,(X - cor->min)/( cor->max - cor->min))); + T0 = 1; + Sum = cor->a[0]*T0; + if (N == 1) break; + T1 = X; + Sum += cor->a[1]*T1; + for (int n = 2; n <= N; n++) { + T2 = 2*X*T1 - T0; + Sum += cor->a[n]*T2; + T0 = T1; + T1 = T2; + } + break; + case 2: // Shifted TChebyshev [0,1] + if (cor->min < cor->max) X = TMath::Max(0.,TMath::Min(1.,(X - cor->min)/( cor->max - cor->min))); + T0 = 1; + Sum = cor->a[0]*T0; + if (N == 1) break; + T1 = 2*X - 1; + Sum += cor->a[1]*T1; + for (int n = 2; n <= N; n++) { + T2 = 2*(2*X - 1)*T1 - T0; + Sum += cor->a[n]*T2; + T0 = T1; + T1 = T2; + } + break; + default: // polynomials + Sum = cor->a[N-1]; + for (int n = N-2; n>=0; n--) Sum = X*Sum + cor->a[n]; + break; + } + return Sum; +} +//________________________________________________________________________________ +Int_t St_pidCorrectionC::IsActiveChair() const { + const St_pidCorrection *tableC = (const St_pidCorrection *) Table(); + Int_t npar = 0; + if (! tableC) return npar; + pidCorrection_st *cor = tableC->GetTable(); + Int_t N = tableC->GetNRows(); + if (! cor || ! N) { + return npar; + } + N = cor->nrows; + for (Int_t i = 0; i < N; i++, cor++) { + if (cor->nrows == 0 && cor->idx == 0) continue; + if (TMath::Abs(cor->npar) > 0 || + TMath::Abs(cor->OffSet) > 1.e-7 || + TMath::Abs(cor->min) > 1.e-7 || + TMath::Abs(cor->max) > 1.e-7) { + npar++; + } + } + return npar; +} +//________________________________________________________________________________ +Double_t St_pidCorrectionC::Correction(Double_t X, Int_t part, Int_t det, Int_t charge, Int_t pull, Int_t varT) { + Int_t N = nrows(); + Double_t Correction = 0; + for (Int_t l = 0; l < N; l++) { + pidCorrection_st *row = Struct(l); + if (part != row->particle) continue; + if (det != row->det) continue; + if (pull != row->pull) continue; + if (varT != row->var) continue; + if (row->charge != 0 && charge != row->charge) continue; + if (row->min < row->max && (X < row->min || X > row->max)) continue; + // Correction += CalcCorrection(l, X); + Correction += SumSeries(row, X); + } + return TMath::Exp(Correction); +} +//________________________________________________________________________________ +Double_t St_pidCorrectionC::func(Double_t *x, Double_t *p) { + Int_t part = p[0]; + Int_t det = p[1]; + Int_t charge = p[2]; + Int_t pull = p[3]; + Int_t varT = p[4]; + return TMath::Log(St_pidCorrectionC::instance()->Correction(x[0],part,det,charge,pull,varT)); +} +//________________________________________________________________________________ +TF1 *St_pidCorrectionC::Func(Int_t part, Int_t det, Int_t charge, Int_t pull, Int_t varT) { + TString fName(Form("pidCor_p%i_d%i_c%i_p%i_v%i",part,det,charge,pull,varT)); + TF1 *f = (TF1 *) gROOT->GetListOfFunctions()->FindObject(fName); + if (! f) { + f = new TF1(fName, St_pidCorrectionC::func, -1.2, 0.9, 5); + if (! varT) + f->GetXaxis()->SetTitle("log_{10} P [GeV/c]"); + else + f->GetXaxis()->SetTitle("log_{10} P/M"); + f->FixParameter(0, part); + f->FixParameter(1, det); + f->FixParameter(2, charge); + f->FixParameter(3, pull); + f->FixParameter(4, varT); + } + return f; +} #include "St_TpcRowQC.h" MakeChairInstance2(tpcCorrection,St_TpcRowQC,Calibrations/tpc/TpcRowQ); #include "St_TpcDriftDistOxygenC.h" @@ -428,13 +563,19 @@ Double_t St_GatingGridC::CalcCorrection(Int_t i, Double_t x) {// drift time in m MakeChairInstance2(tpcCorrection,St_GatingGridBC,Calibrations/tpc/GatingGridB); //________________________________________________________________________________ Double_t St_GatingGridBC::CalcCorrection(Int_t i, Double_t x) {// drift time in microseconds - Double_t value = -10; - if (x <= t0(i)) return value; - Double_t corD = 1. - TMath::Exp(-(x-t0(i))/(settingTime(i)/4.6)); - if (corD < 1e-4) return value; - return TMath::Log(corD); + const tpcCorrection_st *s = Struct(i); + Double_t T0 = s->a[0]; + Double_t SettingTime = s->a[1]; + // Double_t tau = (x-t0(i))/(settingTime(i)/4.6); + Double_t tau = (x - T0)/(SettingTime/4.6); + if (tau > 10) return 0; + if (tau > 0) { + Double_t corD = 1. - TMath::Exp(-tau); + return TMath::Log(corD); + } else { + return -10; + } } - #include "St_TpcCurrentCorrectionC.h" //MakeChairInstance2(tpcCorrection,St_TpcCurrentCorrectionC,Calibrations/tpc/TpcCurrentCorrection); ClassImp(St_TpcCurrentCorrectionC); @@ -1333,8 +1474,237 @@ Float_t St_tpcAnodeHVavgC::voltagePadrow(Int_t sector, Int_t padrow) const { return v_eff; } //________________________________________________________________________________ +#include "St_tpcRDOMasksC.h" +//MakeChairInstance(tpcRDOMasks,RunLog/onl/tpcRDOMasks); +ClassImp(St_tpcRDOMasksC); +St_tpcRDOMasksC *St_tpcRDOMasksC::fgInstance = 0; +St_tpcRDOMasksC *St_tpcRDOMasksC::instance() { + if (fgInstance) return fgInstance; + St_tpcRDOMasks *table = (St_tpcRDOMasks *) StMaker::GetChain()->GetDataBase("RunLog/onl/tpcRDOMasks"); + if (! table) { + LOG_WARN << "St_tpcRDOMasksC::instance RunLog/onl/tpcRDOMasks was not found" << endm; + assert(table); + assert(table->GetNRows() == 12); + } + DEBUGTABLE(tpcRDOMasks); + // Take care about unsorted tpcRDOMaks table + Bool_t needReorder = kFALSE; + tpcRDOMasks_st *row = table->GetTable(); + UInt_t Nactive = 0; + UInt_t N = table->GetNRows(); + if (N != 12) { + needReorder = kTRUE; + LOG_WARN << "St_tpcRDOMasksC::instance RunLog/onl/tpcRDOMasks has NRows = " << N << " =! 12" << endm; + } else { + for (UInt_t i = 0; i < N; i++) { + if ((row+i)->sector == 2*i + 1) continue; + needReorder = kTRUE; + break; + } + } + if (needReorder) { + LOG_WARN << "St_tpcRDOMasksC::instance RunLog/onl/tpcRDOMasks has to be reordered" << endm; + tpcRDOMasks_st rows[12] = {0}; + Int_t OldRun = -1; + for (UInt_t i = 0; i < N; i++) { + if ((row+i)->sector == 2*i + 1) { + rows[i] = *(row+i); + if ((row+i)->runNumber > 0 && OldRun < 0) OldRun = (row+i)->runNumber; + Nactive++; + } else { + if ((row+i)->sector > 0 && (row+i)->sector <= 24) { + if ((row+i)->runNumber > 0 && OldRun < 0) OldRun = (row+i)->runNumber; + Int_t j = ((row+i)->sector-1)/2; + if (rows[j].sector != 0) { + LOG_ERROR << "St_tpcRDOMasksC::instance RunLog/onl/tpcRDOMasks has duplicated rows\t" << i << "\tand " << j << endm; + } + rows[j] = *(row+i); + Nactive++; + } + } + } + if (Nactive != 12) { // Add missing rows + delete table; + table = new St_tpcRDOMasks("tpcRDOMasks", 12); + // fill missing rows + for (Int_t i = 0; i < 12; i++) { + if (rows[i].sector == 0) { + rows[i].sector = 2*i + 1; + rows[i].runNumber = OldRun; + if (St_tpcPadConfigC::instance()->iTpc(rows[i].sector)) { + rows[i].mask = 65535; + } else { + rows[i].mask = 4095; + } + } + } + } + for (Int_t i = 0; i < 12; i++) { + table->AddAt(&rows[i],i); + } + table->Print(0,12); + } + fgInstance = new St_tpcRDOMasksC(table); + if (StDetectorDbMaker::instance()) { + fgInstance->SetName("tpcRDOMasksC"); + StDetectorDbMaker::instance()->AddConst(fgInstance); + } + return fgInstance; +} +//________________________________________________________________________________ +UInt_t St_tpcRDOMasksC::getSectorMask(UInt_t sec) { + static UInt_t Sector = 0; + static UInt_t Mask = 0; + if (Sector == sec) { + return Mask; + } + UInt_t MASK = 0x0000; // default is to mask it out + //UInt_t MASK = 0xFFFF; // change to ON by default ** THIS WAS A HACK + if(sec < 1 || sec > 24 || getNumRows() == 0){ + LOG_WARN << "St_tpcRDOMasksC:: getSectorMask : return default mask for " + << "sector= " << sec << " getNumRows()=" << getNumRows() << endm; + Sector = 0; + return MASK; + } + // tpcRDOMasks_st *row = Struct(); + // Take care about unsorted tpcRDOMaks table + tpcRDOMasks_st *row = Struct((sec-1)/2); + MASK = row->mask; + Int_t run = row->runNumber; + if (! St_tpcPadConfigC::instance()->iTpc(sec)) {// no iTPC + if (sec == 16 && MASK == 0 && run > 8181000 && run < 9181000) MASK = 4095; + if( sec % 2 == 0){ // if its even relevent bits are 6-11 + MASK = MASK >> 6; + } + // Otherwise want lower 6 bits + MASK &= 0x000003F; // Mask out higher order bits + } else if (run < 20000000 && sec == 20) { // Run XVIII, sector 20 + MASK = 255; + } else { // Run XIX and higher + if( sec % 2 == 0){ // if its even relevent bits are 8-13 + MASK = MASK >> 8; + } + // Otherwise want lower 8 bits + MASK &= 255; // Mask out higher order bits + } + Sector = sec; + Mask = MASK; + return Mask; +} +//________________________________________________________________________________ +Bool_t St_tpcRDOMasksC::isOn(Int_t sector,Int_t rdo) { + static Int_t Sector = -1; + static Int_t Rdo = -1; + static Bool_t Mask = kFALSE; + if (Sector == sector && Rdo == rdo) { + return Mask; + } + Mask = kFALSE; + Sector = sector; + Rdo = rdo; + if(sector < 1 || sector > 24 || rdo < 1 || rdo > 8) { + getSectorMask(0); + return 0; + } + tpcRDOMasks_st *row = Struct((sector-1)/2); + assert(row->sector == (UInt_t) 2*((sector-1)/2) + 1); + UInt_t MASK = getSectorMask(sector); + MASK = MASK >> (rdo - 1); + MASK &= 0x00000001; + Mask = MASK; + return Mask; +} +//________________________________________________________________________________ +void St_tpcRDOMasksC::setSectorRDOMaskOff(UInt_t sector,Int_t rdo) { + if(sector < 1 || sector > 24 || rdo < 1 || rdo > 8) return; + if (isOn(sector,rdo)) { + tpcRDOMasks_st *row = Struct((sector-1)/2); + assert(row->sector == 2*((sector-1)/2) + 1); + if (! St_tpcPadConfigC::instance()->iTpc(sector)) {// no iTPC + row->mask &= ~(1 << (6*((sector-1)%2) + rdo - 1)); + } else { // with iTPC + row->mask &= ~(1 << (8*((sector-1)%2) + rdo - 1)); + } + isOn(0,rdo); // Reset saved mask + LOG_WARN << "St_tpcRDOMasksC::setSectorRDOMaskOff(" << sector << "," << rdo << ") = " << isOn(sector,rdo) << endm; + } +} +//________________________________________________________________________________ +#include "St_tpcExtraGainCorrectionC.h" +MakeChairInstance(tpcExtraGainCorrection,Calibrations/tpc/tpcExtraGainCorrection); +//________________________________________________________________________________ #include "St_tpcPadGainT0C.h" -MakeChairInstance(tpcPadGainT0,Calibrations/tpc/tpcPadGainT0); +//MakeChairInstance(tpcPadGainT0,Calibrations/tpc/tpcPadGainT0); +St_tpcPadGainT0C *St_tpcPadGainT0C::fgInstance = 0; +//________________________________________________________________________________ +St_tpcPadGainT0C *St_tpcPadGainT0C::instance() { + if (fgInstance) return fgInstance; + St_tpcPadGainT0 *table = (St_tpcPadGainT0 *) StMaker::GetChain()->GetDataBase("Calibrations/tpc/tpcPadGainT0"); + if (! table) { + LOG_WARN << "St_tpcPadGainT0C::instance Calibrations/tpc/tpcPadGainT0\twas not found" << endm; + assert(table); + } + fgInstance = new St_tpcPadGainT0C(table); + if (StDetectorDbMaker::instance()) { + fgInstance->SetName("tpcPadGainT0C"); + StDetectorDbMaker::instance()->AddConst(fgInstance); + } + // Apply additional correction for gain tables + Int_t run = StMaker::GetChain()->GetRunNumber(); + St_tpcExtraGainCorrectionC *extra = St_tpcExtraGainCorrectionC::instance(); + Int_t nrows = extra->nrows(); + for (Int_t i = 0; i < nrows; i++) { + if (extra->idx(i) <= 0) continue; + Int_t runMin = extra->runMin(i); + Int_t runMax = extra->runMax(i); + if (run < runMin || run > runMax) continue; + Int_t sector = extra->sector(i); + if (sector < 0 || sector > 24) continue; + Int_t row = extra->row(i); + if (row > 72) row = -1; + Int_t padMin = extra->padMin(i); + Int_t padMax = extra->padMax(i); + Int_t RDO = extra->RDO(i); + Int_t FEE = extra->FEE(i); + Int_t status = extra->status(i); + if (status) continue; + if (padMin < padMax && row > 0) { + Int_t r = row; + if (St_tpcPadConfigC::instance()->iTPC(sector)) { + if (row <= 40) continue; + r = row - 40 + 13; + } + LOG_WARN << "St_tpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", + sector, r, padMin, padMax, RDO, FEE, status) << endm; + Float_t *gains = St_tpcPadGainT0C::instance()->Gains(sector, r); + for (Int_t p = padMin; p <= padMax; p++) { + if (gains[p-1] > 0) { + LOG_WARN << "St_tpcPadGainT0C::instance reset gain[" << sector-1 << "][" << r - 1 << "][" << p-1 << "] = " << gains[p-1] << " to zero" << endm; + } + gains[p-1] = 0; + } + } else if (FEE > 0) { // iTPC stuff, ignorefor tpx + } else if (RDO > 0) { + LOG_WARN << "St_tpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" reset tpcRDOMasks for sector = %i and RDO = %i to zero with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", + sector, RDO, sector, row, padMin, padMax, RDO, FEE, status) << endm; + St_tpcRDOMasksC::instance()->setSectorRDOMaskOff(sector,RDO); + } else { + LOG_WARN << "St_tpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i => whole sector is marker as DEAD", + sector, row, padMin, padMax, RDO, FEE, status) << endm; + Int_t rdoMin = 1; + Int_t rdoMax = 6; + if (! St_tpcPadConfigC::instance()->iTPC(sector)) {rdoMin = 5; rdoMax = 8;} + for (Int_t rdoD = rdoMin; rdoD <= rdoMax; rdoD++) { + St_tpcRDOMasksC::instance()->setSectorRDOMaskOff(sector,rdoD); + } + } + } + return fgInstance; +} +//________________________________________________________________________________ #include "St_itpcDeadFEEC.h" MakeChairInstance(itpcDeadFEE,Calibrations/tpc/itpcDeadFEE); #include "St_itpcPadGainT0C.h" @@ -1587,6 +1957,7 @@ rowpadFEEmap_t St_itpcPadGainT0C::rowpadFEE[] = { {40, 81,100, 5, 4}, }; Int_t St_itpcPadGainT0C::NCrowpadFEE = sizeof(St_itpcPadGainT0C::rowpadFEE)/sizeof(rowpadFEEmap_t); +//________________________________________________________________________________ St_itpcPadGainT0C *St_itpcPadGainT0C::instance() { if (fgInstance) return fgInstance; St_itpcPadGainT0 *table = (St_itpcPadGainT0 *) StMaker::GetChain()->GetDataBase("Calibrations/tpc/itpcPadGainT0"); @@ -1594,97 +1965,81 @@ St_itpcPadGainT0C *St_itpcPadGainT0C::instance() { LOG_WARN << "St_itpcPadGainT0C::instance Calibrations/tpc/itpcPadGainT0\twas not found" << endm; assert(table); } - St_itpcDeadFEEC *dead = St_itpcDeadFEEC::instance(); - if (dead) { - itpcPadGainT0_st *g = table->GetTable(); - Int_t N = dead->getNumRows(); - for (Int_t i = 0; i < N; i++) { - Int_t s = dead->sector(i); - if (s <= 0) break; - Int_t r = dead->row(i); - Int_t pmin = dead->padMin(i); - Int_t pmax = dead->padMax(i); - Int_t fee = dead->FEE(i); - // Int_t rdo = dead->RDO(i); - Int_t nFEE = 1; - if (fee > 0) { - nFEE = NCrowpadFEE; + fgInstance = new St_itpcPadGainT0C(table); + if (StDetectorDbMaker::instance()) { + fgInstance->SetName("itpcPadGainT0C"); + StDetectorDbMaker::instance()->AddConst(fgInstance); + } + // Apply additional correction for gain tables + Int_t run = StMaker::GetChain()->GetRunNumber(); + St_tpcExtraGainCorrectionC *extra = St_tpcExtraGainCorrectionC::instance(); + Int_t nrows = extra->nrows(); + for (Int_t i = 0; i < nrows; i++) { + if (extra->idx(i) <= 0) continue; + Int_t runMin = extra->runMin(i); + Int_t runMax = extra->runMax(i); + if (run < runMin || run > runMax) continue; + Int_t sector = extra->sector(i); + if (sector < 0 || sector > 24) continue; + Int_t row = extra->row(i); + if (row > 40) continue; // iTPC only + Int_t padMin = extra->padMin(i); + Int_t padMax = extra->padMax(i); + Int_t RDO = extra->RDO(i); + Int_t FEE = extra->FEE(i); + Int_t status = extra->status(i); + if (status) continue; + if (padMin < padMax && row > 0) { + Int_t r = row; + LOG_WARN << "St_itpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", + sector, r, padMin, padMax, RDO, FEE, status) << endm; + Float_t *gains = St_itpcPadGainT0C::instance()->Gains(sector, r); + for (Int_t p = padMin; p <= padMax; p++) { + if (gains[p-1] > 0) { + LOG_WARN << "St_itpcPadGainT0C::instance reset gain[" << sector-1 << "][" << r - 1 << "][" << p-1 << "] = " << gains[p-1] << " to zero" << endm; + } + gains[p-1] = 0; } - for (Int_t j = 0; j < nFEE; j++) { - if (fee > 0) { - if (rowpadFEE[j].fee != fee) continue; - if (rowpadFEE[j].row != r ) continue; - r = rowpadFEE[j].row; - pmin = rowpadFEE[j].padMin; - pmax = rowpadFEE[j].padMax; - if (pmin > 0 && pmax >= pmin) { - for (Int_t pad = pmin; pad <= pmax; pad++) { - if (_debug && g->Gain[s-1][r-1][pad-1] > 0) { - cout << "Reset gain[" << s - 1 << "][" << r - 1 << "][" << pad -1 << "] = " << g->Gain[s-1][r-1][pad-1] << " to 0" << endl; - } - g->Gain[s-1][r-1][pad-1] = 0; - } + } else if (FEE > 0) { + for (Int_t j = 0; j < St_itpcPadGainT0C::NCrowpadFEE; j++) { + if (St_itpcPadGainT0C::rowpadFEE[j].fee != FEE) continue; + Int_t r = St_itpcPadGainT0C::rowpadFEE[j].row; + padMin = St_itpcPadGainT0C::rowpadFEE[j].padMin; + padMax = St_itpcPadGainT0C::rowpadFEE[j].padMax; + LOG_WARN << "St_itpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", + sector, r, padMin, padMax, RDO, FEE, status) << endm; + Float_t *gains = St_itpcPadGainT0C::instance()->Gains(sector, r); + for (Int_t p = padMin; p <= padMax; p++) { + if (gains[p-1] > 0) { + LOG_WARN << "St_itpcPadGainT0C::instance reset gain[" << sector-1 << "][" << r - 1 << "][" << p-1 << "] = " << gains[p-1] << " to zero" << endm; } + gains[p-1] = 0; } } + } else if (RDO > 0) { + LOG_WARN << "St_itpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" reset tpcRDOMasks for sector = %i and RDO = %i to zero with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", + sector, RDO, sector, row, padMin, padMax, RDO, FEE, status) << endm; + St_tpcRDOMasksC::instance()->setSectorRDOMaskOff(sector,RDO); + } else { + LOG_WARN << "St_itpcPadGainT0C::instance found extra correction for run = " << run << " in [" << runMin << "," << runMax << "]" + << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i => whole sector is marker as DEAD", + sector, row, padMin, padMax, RDO, FEE, status) << endm; + for (Int_t rdoD = 1; rdoD <= 4; rdoD++) { + St_tpcRDOMasksC::instance()->setSectorRDOMaskOff(sector,rdoD); + } } } - DEBUGTABLE(STRUCT); - fgInstance = new St_itpcPadGainT0C(table); return fgInstance; } //________________________________________________________________________________ -#include "St_tpcExtraGainCorrectionC.h" -MakeChairInstance(tpcExtraGainCorrection,Calibrations/tpc/tpcExtraGainCorrection); -//________________________________________________________________________________ #include "St_tpcPadGainT0BC.h" // tpcPadGainT0B table (indexed) is not used any more. tpcPadGainT0BChair combines nonindexed tpcPadGainT0 and itpcPadGainT0 St_tpcPadGainT0BC *St_tpcPadGainT0BC::fgInstance = 0; St_tpcPadGainT0BC *St_tpcPadGainT0BC::instance() { - if (! fgInstance) { - fgInstance = new St_tpcPadGainT0BC(); - // Apply additional correction for gain tables - Int_t run = StMaker::GetChain()->GetRunNumber(); - St_tpcExtraGainCorrectionC *extra = St_tpcExtraGainCorrectionC::instance(); - Int_t nrows = extra->nrows(); - for (Int_t i = 0; i < nrows; i++) { - if (extra->idx(i) <= 0) continue; - if (run < extra->runMin(i) || run > extra->runMax(i)) continue; - Int_t sector = extra->sector(i); - if (sector < 0 || sector > 24) continue; - Int_t row = extra->row(i); - Int_t padMin = extra->padMin(i); - Int_t padMax = extra->padMax(i); - Int_t RDO = extra->RDO(i); - Int_t FEE = extra->FEE(i); - Int_t status = extra->status(i); -#if 0 - LOG_WARN << "St_tpcPadGainT0BC::instance found extra correction for run = " << run - << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i", - sector, row, padMin, padMax, RDO, FEE, status) << endm; - if (! status) continue; - Int_t rowMin = row; - Int_t rowMax = row; - if (row <= 0) {rowMin = 1; rowMax = 45;} - if (padMin > padMax) { - // Calculate padMin/Max from FEE or RDO - } - for (Int_t r = rowMin; r <= rowMax; r++) { - Float_t *gains = St_tpcPadGainT0BC::instance()->Gains(sector, r); - for (Int_t p = padMin; p <= padMax; p++) { - if (gains[p-1] > 0) { - LOG_WARN << "St_tpcPadGainT0BC::instance reset gain[" << sector-1 << "][" << r - 1 << "][" << p-1 << "] = " << gains[p-1] << " to zero" << endm; - } - gains[p-1] = 0; - } - } -#else - LOG_ERROR << "St_tpcPadGainT0BC::instance found extra correction for run = " << run - << Form(" with sec = %2i, row = %2i, padMin/Max = %3i/%3i, RDO = %2i, FEE = %2i, status = %i should be moved to tpcRDOMaks", - sector, row, padMin, padMax, RDO, FEE, status) << endm; -#endif - } - } + if (! fgInstance) fgInstance = new St_tpcPadGainT0BC(); return fgInstance; } //________________________________________________________________________________ @@ -1993,14 +2348,15 @@ double StTpcBXT0CorrEPDC::getCorrection (double epdTAC, double driftVelocity, do } #include "St_tpcT0BXC.h" MakeChairInstance(tpcT0BX,Calibrations/tpc/tpcT0BX); -Double_t St_tpcT0BXC::getT0(Double_t values[6]) const { // xxxEarliestTDC (W+E)/2 variables for "vpd","bbc","epd","zdc", "TAC", "CAVdt" +Double_t St_tpcT0BXC::getT0(Double_t values[7]) const { // xxxEarliestTDC (W+E)/2 variables for "vpd","bbc","epd","zdc", "TAC", "CAVdt" Double_t T0 = 0; Double_t T0W = 0, T0WW = 0; static Int_t __debug = 0; if (__debug > 0) { + if (__debug > 1) Table()->Print(0,10); LOG_INFO << "St_tpcT0BXC::getT0:"; } - for (Int_t i = 0; i < 6; i++) { + for (Int_t i = 0; i < 7; i++) { if (values[i] < xmin(i) || values[i] > xmax(i)) continue; if (detId(i) < 0) continue; // if (detId(i) != 6 && (CountPs(i) < 10 || CountPs(i) > 100)) continue; @@ -2027,6 +2383,18 @@ Double_t St_tpcT0BXC::getT0(Double_t values[6]) const { // xxxEarliestTDC (W+E)/ } #include "St_starTriggerDelayC.h" MakeChairOptionalInstance2(starTriggerDelay,St_starTriggerDelayC,Calibrations/tpc/starTriggerDelay); +//________________________________________________________________________________ +Float_t St_starTriggerDelayC::TrigT0(Int_t i) const { + return clocks(i)/(1e-6*St_starClockOnlC::instance()->CurrentFrequency()) + tZero(i); +} +//________________________________________________________________________________ +Float_t St_starTriggerDelayC::TrigT0GG(Int_t io, Int_t i) const { + Float_t delay = TrigT0(i); // usec add Gating Grid cable + delay += 0.150; // length 30 m, delay 150ns for both Inner and Outer sectors, measured by A.Lebedev 10/13/2023 + if (! io) delay += -0.123; + else delay += -0.502; + return delay; +} //__________________Calibrations/trg______________________________________________________________ #include "St_defaultTrgLvlC.h" MakeChairInstance(defaultTrgLvl,Calibrations/trg/defaultTrgLvl); @@ -2138,7 +2506,6 @@ MakeChairInstance2(spaceChargeCor,St_spaceChargeCorR2C,Calibrations/rich/spaceCh #include "St_MagFactorC.h" MakeChairInstance(MagFactor,RunLog/MagFactor); //_________________RunLog/onl_______________________________________________________________ -#include "St_starClockOnlC.h" MakeChairInstance(starClockOnl,RunLog/onl/starClockOnl); //________________________________________________________________________________ starClockOnl_st *St_starClockOnlC::Struct(Int_t i) { @@ -2199,8 +2566,13 @@ Float_t St_beamInfoC::GammaBlue() { return gamma; } //________________________________________________________________________________ -Float_t St_beamInfoC::Gamma() { - return GammaYellow(); +Float_t St_beamInfoC::GammaCMS() { + Double_t eBlue = kProtonMass*GammaBlue(); + Double_t eYellow = kProtonMass*GammaYellow(); + Double_t Etot = eBlue + eYellow; + Double_t Ecm = SqrtS(); + Double_t gammaCM = Etot/Ecm; + return gammaCM; } //________________________________________________________________________________ Float_t St_beamInfoC::BetaBlue() { @@ -2213,8 +2585,12 @@ Float_t St_beamInfoC::BetaYellow() { return -TMath::Sqrt(1 - 1./(gamma*gamma)); } //________________________________________________________________________________ -Float_t St_beamInfoC::Beta() { - return -BetaBlue(); +Float_t St_beamInfoC::BetaCMS() { + Double_t eBlue = kProtonMass*GammaBlue(); + Double_t eYellow = kProtonMass*GammaYellow(); + Double_t Etot = eBlue + eYellow; + Double_t betaCM = (eBlue*BetaBlue() + eYellow*BetaYellow())/Etot; + return betaCM; } //________________________________________________________________________________ Float_t St_beamInfoC::SqrtS() { @@ -2225,12 +2601,8 @@ Float_t St_beamInfoC::SqrtS() { } //________________________________________________________________________________ Float_t St_beamInfoC::Ycms() { - Double_t eBlue = kProtonMass*GammaBlue(); - Double_t eYellow = kProtonMass*GammaYellow(); - Double_t Etot = eBlue + eYellow; - Double_t Ecm = SqrtS(); - Double_t gammaCM = Etot/Ecm; - Double_t betaCM = (eBlue*BetaBlue() + eYellow*BetaYellow())/Etot; + Double_t gammaCM = GammaCMS(); + Double_t betaCM = BetaCMS(); Double_t yCM = TMath::Log(gammaCM*(1 + betaCM)); return yCM; } @@ -2238,78 +2610,10 @@ Float_t St_beamInfoC::Ycms() { Float_t St_beamInfoC::Frequency() { static Double_t l = 3833.845*9.99999253982746361e-01;// *9.99988614393081399e-01;// *9.99998896969437556e-01; // RHIC perimetr static Double_t NB = 120; // no. of buches, can be changed - Double_t frequency = 1e-6*NB*Beta()*TMath::C()/l; + Double_t frequency = 1e-6*NB*BetaYellow()*TMath::C()/l; return TMath::Abs(frequency); } //________________________________________________________________________________ -#include "St_tpcRDOMasksC.h" -MakeChairInstance(tpcRDOMasks,RunLog/onl/tpcRDOMasks); -//________________________________________________________________________________ -UInt_t St_tpcRDOMasksC::getSectorMask(UInt_t sec) { - static UInt_t Sector = 0; - static UInt_t Mask = 0; - if (Sector == sec) { - return Mask; - } - UInt_t MASK = 0x0000; // default is to mask it out - //UInt_t MASK = 0xFFFF; // change to ON by default ** THIS WAS A HACK - if(sec < 1 || sec > 24 || getNumRows() == 0){ - LOG_WARN << "St_tpcRDOMasksC:: getSectorMask : return default mask for " - << "sector= " << sec << " getNumRows()=" << getNumRows() << endm; - return MASK; - } - // tpcRDOMasks_st *row = Struct(); - // Take care about unsorted tpcRDOMaks table - Int_t i = -1; - UInt_t j = (sec + 1) / 2 - 1; - if (sector(j) == 2*j + 1) { - i = j; - } else { - for (i = 0; i < 12; i++) { - if (sector(i) == 2*j + 1) {break;} - } - } - assert(i >= 0); - // MASK = mask(((sec + 1) / 2) - 1); // does the mapping from sector 1-24 to packed sectors - MASK = mask(i); // does the mapping from sector 1-24 to packed sectors - if (! St_tpcPadConfigC::instance()->iTpc(sec)) {// no iTPC - if (sec == 16 && MASK == 0 && runNumber() > 8181000 && runNumber() < 9181000) MASK = 4095; - if( sec % 2 == 0){ // if its even relevent bits are 6-11 - MASK = MASK >> 6; - } - // Otherwise want lower 6 bits - MASK &= 0x000003F; // Mask out higher order bits - } else if (runNumber() < 20000000 && sec == 20) { // Run XVIII, sector 20 - MASK = 255; - } else { // Run XIX and higher - if( sec % 2 == 0){ // if its even relevent bits are 8-13 - MASK = MASK >> 8; - } - // Otherwise want lower 8 bits - MASK &= 255; // Mask out higher order bits - } - Sector = sec; - Mask = MASK; - return MASK; -} -//________________________________________________________________________________ -Bool_t St_tpcRDOMasksC::isOn(Int_t sector,Int_t rdo) { - static Int_t Sector = -1; - static Int_t Rdo = -1; - static Bool_t Mask = kFALSE; - if (Sector == sector && Rdo == rdo) { - return Mask; - } - if(sector < 1 || sector > 24 || rdo < 1 || rdo > 8) return 0; - UInt_t MASK = getSectorMask(sector); - MASK = MASK >> (rdo - 1); - MASK &= 0x00000001; - Sector = sector; - Rdo = rdo; - Mask = MASK; - return MASK; -} -//________________________________________________________________________________ #include "St_triggerInfoC.h" MakeChairInstance(triggerInfo,RunLog/onl/triggerInfo); #include "St_triggerIDC.h" @@ -2865,7 +3169,53 @@ MakeChairInstance(tofTrgWindow,Calibrations/tof/tofTrgWindow); #include "St_tofTzeroC.h" MakeChairInstance(tofTzero,Calibrations/tof/tofTzero); #include "St_tofSimResParamsC.h" -MakeChairInstance(tofSimResParams,Calibrations/tof/tofSimResParams); +//MakeChairInstance(tofSimResParams,Calibrations/tof/tofSimResParams); +St_tofSimResParamsC *St_tofSimResParamsC::fgInstance = 0; +Double_t St_tofSimResParamsC::params[120][192] = {0}; +Double_t St_tofSimResParamsC::mAverageTimeResTof = 0; + +St_tofSimResParamsC *St_tofSimResParamsC::instance() { + if (fgInstance) return fgInstance; + St_tofSimResParams *table = (St_tofSimResParams *) StMaker::GetChain()->GetDataBase("Calibrations/tof/tofSimResParams"); + if (! table) { + LOG_WARN << "St_tofSimResParamsC::instance Calibrations/tof/tofSimResParams was not found" << endm; + assert(table); + } + DEBUGTABLE(tofSimResParams); + fgInstance = new St_tofSimResParamsC(table); + mAverageTimeResTof=0; + const tofSimResParams_st *row = fgInstance->Struct(0); + for ( Int_t i = 0; i < 120; i++ ){ // nTrays + for ( Int_t j = 0; j < 192; j++ ){ + Int_t index = i * 120 + j; + params[i][j] = row->resolution[index]; + mAverageTimeResTof += params[i][j]; +#if 0 + if (_debug) { + LOG_DEBUG << "tray:" << i << ", mod cell:" << j << " = " << row->resolution[index] << " == " << params[i][j] << endm; + } +#endif + } + } + mAverageTimeResTof=mAverageTimeResTof/(120*192); + LOG_INFO << "Loaded tofSimResParams. Average = " << mAverageTimeResTof << endm; + + if (StDetectorDbMaker::instance()) { + fgInstance->SetName("tofSimResParamsC"); + StDetectorDbMaker::instance()->AddConst(fgInstance); + } + return fgInstance; +} +//________________________________________________________________________________ +Double_t St_tofSimResParamsC::timeres_tof(UInt_t itray, UInt_t imodule, UInt_t icell) { + /* + * Calculates the average resolution across all 38 tubes (discounts inactive tubes) + * then returns a single vertex resolution (in ps) for use in embedding w/ vpdStart + */ + Double_t result = 8.5e-11; + if ( itray > 120 || imodule > 32 || icell > 6 ) return result; + return params[ itray ][ imodule * 6 + icell ]; +} #include "St_vpdDelayC.h" MakeChairInstance(vpdDelay,Calibrations/tof/vpdDelay); #include "St_vpdTotCorrC.h" diff --git a/StRoot/StDetectorDbMaker/StDetectorDbMaker.cxx b/StRoot/StDetectorDbMaker/StDetectorDbMaker.cxx old mode 100755 new mode 100644 index ee32c760d09..e93b1c16d44 --- a/StRoot/StDetectorDbMaker/StDetectorDbMaker.cxx +++ b/StRoot/StDetectorDbMaker/StDetectorDbMaker.cxx @@ -10,8 +10,15 @@ #endif St_trigDetSums* St_trigDetSumsC::fgTableCopy = 0; Int_t StDetectorDbMaker::_debug = 0; +StDetectorDbMaker *StDetectorDbMaker::fgStDetectorDbMaker = 0; ClassImp(StDetectorDbMaker) //_____________________________________________________________________________ +//_____________________________________________________________________________ +Int_t StDetectorDbMaker::InitRun (Int_t runumber) { + if (m_ConstSet) m_ConstSet->Delete(); // Clear Chair Instances + return 0; +} +//_____________________________________________________________________________ Int_t StDetectorDbMaker::Make(){ #if 0 /* Move to St_trigDetSumsC to unify reading daq and StEvent files */ // Also need to update instances for classes done in InitRun. diff --git a/StRoot/StDetectorDbMaker/StDetectorDbMaker.h b/StRoot/StDetectorDbMaker/StDetectorDbMaker.h index 9c3eefe89c0..bc7416741c5 100644 --- a/StRoot/StDetectorDbMaker/StDetectorDbMaker.h +++ b/StRoot/StDetectorDbMaker/StDetectorDbMaker.h @@ -1,19 +1,22 @@ #ifndef STAR_StDetectorDbMaker #define STAR_StDetectorDbMaker -#ifndef StMaker_H +#ifndef STAR_StMaker #include "StMaker.h" #endif class StDetectorDbMaker : public StMaker { public: - StDetectorDbMaker(const char *name="DetectorDb") : StMaker(name) {} - virtual ~StDetectorDbMaker() {} + StDetectorDbMaker(const char *name="DetectorDb") : StMaker(name) {fgStDetectorDbMaker = this; } + virtual ~StDetectorDbMaker() {fgStDetectorDbMaker = 0;} + virtual Int_t InitRun(Int_t runumber); virtual Int_t Make(); + static StDetectorDbMaker *instance() {return fgStDetectorDbMaker;} + private: static Int_t _debug; virtual const char *GetCVS() const {static const char cvs[]="Tag $Name: $ $Id: StDetectorDbMaker.h,v 1.5 2015/12/23 23:34:09 fisyak Exp $ built " __DATE__ " " __TIME__ ; return cvs;} - + static StDetectorDbMaker *fgStDetectorDbMaker; ClassDef(StDetectorDbMaker,0) //StAF chain virtual base class for Makers }; diff --git a/StRoot/StDetectorDbMaker/St_TpcAvgPowerSupplyC.h b/StRoot/StDetectorDbMaker/St_TpcAvgPowerSupplyC.h index 080f87b5d74..dbcf1347fd9 100644 --- a/StRoot/StDetectorDbMaker/St_TpcAvgPowerSupplyC.h +++ b/StRoot/StDetectorDbMaker/St_TpcAvgPowerSupplyC.h @@ -34,7 +34,7 @@ class St_TpcAvgPowerSupplyC : public TChair { Float_t AcChargeRow(Int_t sector = 1, Int_t row = 1) {return AcCharge(sector,ChannelFromRow(sector,row));} Float_t AcChargeL(Int_t sector = 1, Int_t channel = 1); // C/cm Float_t AcChargeRowL(Int_t sector = 1, Int_t row = 1) {return AcChargeL(sector,ChannelFromRow(sector,row));} - Bool_t livePadrow(Int_t sec = 1, Int_t padrow = 1) const { return voltagePadrow(sec,padrow) > 500;} + Bool_t livePadrow(Int_t sec = 1, Int_t padrow = 1) const { return voltagePadrow(sec,padrow) > 850;} void PrintC() const; protected: St_TpcAvgPowerSupplyC(St_TpcAvgPowerSupply *table=0) : TChair(table) {} diff --git a/StRoot/StDetectorDbMaker/St_beamInfoC.h b/StRoot/StDetectorDbMaker/St_beamInfoC.h index 63a2f5ed519..8b7e60d0b78 100644 --- a/StRoot/StDetectorDbMaker/St_beamInfoC.h +++ b/StRoot/StDetectorDbMaker/St_beamInfoC.h @@ -42,12 +42,12 @@ class St_beamInfoC : public TChair { Float_t getYellowBunchIntensity(Int_t i=0){return yellowBunchIntensity(i);} Float_t getYellowFillNumber(Int_t i=0) {return yellowFillNumber(i);} Bool_t IsFixedTarget(); - Float_t Gamma(); + Float_t GammaCMS(); Float_t GammaYellow(); Float_t GammaBlue(); Float_t BetaYellow(); Float_t BetaBlue(); - Float_t Beta(); + Float_t BetaCMS(); Float_t Frequency(); Float_t SqrtS(); Float_t Ycms(); diff --git a/StRoot/StDetectorDbMaker/St_itpcPadGainT0C.h b/StRoot/StDetectorDbMaker/St_itpcPadGainT0C.h index 902f8a4c0a5..a759dedabee 100644 --- a/StRoot/StDetectorDbMaker/St_itpcPadGainT0C.h +++ b/StRoot/StDetectorDbMaker/St_itpcPadGainT0C.h @@ -3,7 +3,7 @@ #include "TChair.h" #include "tables/St_itpcPadGainT0_Table.h" - +class TBrowser; struct rowpadFEEmap_t {// FEE & RDO map for iTPC Int_t row, padMin, padMax, fee, rdo; }; @@ -26,6 +26,7 @@ class St_itpcPadGainT0C : public TChair { for (Int_t pad=1; pad<=120; pad++) if (Gain(sector,row,pad)>0) return kTRUE; return kFALSE; } + void Browse(TBrowser *b) {} static rowpadFEEmap_t rowpadFEE[]; static Int_t NCrowpadFEE; protected: diff --git a/StRoot/StDetectorDbMaker/St_pidCorrectionC.h b/StRoot/StDetectorDbMaker/St_pidCorrectionC.h new file mode 100644 index 00000000000..56f16b8de6e --- /dev/null +++ b/StRoot/StDetectorDbMaker/St_pidCorrectionC.h @@ -0,0 +1,55 @@ +#ifndef St_pidCorrectionC_h +#define St_pidCorrectionC_h + +#include "TChair.h" +#include "tables/St_pidCorrection_Table.h" +#include "StEvent/StPidParticleDefinition.h" +#include "StEvent/StEnumerations.h" +#include "TF1.h" +class St_pidCorrectionC : public TChair { + public: + enum PiDStatusIDs { // from StdEdxY2Maker/StTrackCombPiD.h + kUndef = kUndefinedMethodId, + kI70 = kTruncatedMeanId, + kI70U = kEnsembleTruncatedMeanId, + kFit = kLikelihoodFitId, + kFitU = kWeightedTruncatedMeanId, + kdNdx = kOtherMethodId, + kdNdxU = kOtherMethodId2, + kBTof, kETof, kMtd, kBEmc, kTotal + }; + static St_pidCorrectionC* instance(); + pidCorrection_st *Struct(Int_t i = 0) const {return ((St_pidCorrection*) Table())->GetTable()+i;} + UInt_t getNumRows() const {return GetNRows();} + Int_t idx(Int_t i = 0) const {return Struct(i)->idx;} // row index > 0 if it is real + Int_t nrows(Int_t i = 0) const {return Struct(i)->nrows;} // total no. of real rows in the table; For Db interface (where nrows = 50) + Int_t type(Int_t i = 0) const {return Struct(i)->type;} // type = 0 polymonical fit, use only [min,max] + Int_t var(Int_t i = 0) const {return Struct(i)->var;} // fit variable: 0 => pmomL10, 1 => bgL10 + Int_t particle(Int_t i = 0) const {return Struct(i)->particle;} // from StEvent/StPidParticleDefinition.h : kUndef = -1, kPidElectron = 0, Proton = 1, + // Kaon = 2, Pion = 3, Muon = 4, Deuteron = 5, Triton = 6, + // He3 = 7, Alpha = 8, He6 = 9, Li5 = 10, Li6,= 11, Li7 = 12, Be7 = 13, Be9 = 14, Be10 = 15, B11 = 16 + Int_t charge(Int_t i = 0) const {return Struct(i)->charge;} // +/-1, 0 does not matter + Int_t pull(Int_t i = 0) const {return Struct(i)->pull;} // != 0 calculated pull correction, == 0 to value + Int_t det(Int_t i = 0) const {return Struct(i)->det;} // from StdEdxY2Maker/StTrackPiD.h : kUndef = 0, kI70 = 1, kI70U = 2, kFit = 3, kFitU = 4, kdNdx = 5, + // kdNdxU = 6, kBTof -7 , kETof = 8, kMtd = 9, kBEmc = 10 + Int_t npar(Int_t i = 0) const {return Struct(i)->npar;} // npar < 0, X = exp(x) paramterization; abs(npar) >= 100 cut on range [min.max] + Double_t OffSet(Int_t i = 0) const {return Struct(i)->OffSet;} // for future use + Double_t min(Int_t i = 0) const {return Struct(i)->min;} // fit range + Double_t max(Int_t i = 0) const {return Struct(i)->max;} // + Double_t* a(Int_t i = 0) const {return Struct(i)->a;} // a[npar] + Char_t* comment(Int_t i = 0) const {return Struct(i)->comment;} + Double_t CalcCorrection(Int_t i, Double_t x, Double_t z = 0, Int_t NparMax = -1) const; + Double_t SumSeries(pidCorrection_st *cor, Double_t x, Double_t z = 0, Int_t NparMax = -1) const; + Double_t Correction(Double_t X, Int_t part = kPidPion, Int_t det = kFit, Int_t charge = 0, Int_t pull = 0, Int_t varT = 0); + static Double_t func(Double_t *x, Double_t *p); + TF1* Func(Int_t part = kPidPion, Int_t det = kFit, Int_t charge = 0, Int_t pull = 0, Int_t varT = 0); + Int_t IsActiveChair() const; + protected: + St_pidCorrectionC(St_pidCorrection *table=0) : TChair(table) {} + virtual ~St_pidCorrectionC() {fgInstance = 0;} + private: + static St_pidCorrectionC* fgInstance; + ClassDefChair(St_pidCorrection, pidCorrection_st ) + ClassDef(St_pidCorrectionC,1) //C++ TChair for pidCorrection table class +}; +#endif diff --git a/StRoot/StDetectorDbMaker/St_starTriggerDelayC.h b/StRoot/StDetectorDbMaker/St_starTriggerDelayC.h index 843647a6d00..aab06bac1e0 100644 --- a/StRoot/StDetectorDbMaker/St_starTriggerDelayC.h +++ b/StRoot/StDetectorDbMaker/St_starTriggerDelayC.h @@ -11,6 +11,8 @@ class St_starTriggerDelayC : public TChair { UInt_t getNumRows() const {return GetNRows();} Float_t clocks(Int_t i = 0) const {return Struct(i)->clocks;} Float_t tZero(Int_t i = 0) const {return Struct(i)->tZero;} + Float_t TrigT0(Int_t i = 0) const; // usec + Float_t TrigT0GG(Int_t io = 0, Int_t i = 0) const; // usec add cables protected: St_starTriggerDelayC(St_starTriggerDelay *table=0) : TChair(table) {} virtual ~St_starTriggerDelayC() {if (Table()->IsMarked()) delete GetThisTable(); fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_tofSimResParamsC.h b/StRoot/StDetectorDbMaker/St_tofSimResParamsC.h index ebc5f9ceb5a..19312ba1160 100644 --- a/StRoot/StDetectorDbMaker/St_tofSimResParamsC.h +++ b/StRoot/StDetectorDbMaker/St_tofSimResParamsC.h @@ -3,6 +3,7 @@ #include "TChair.h" #include "tables/St_tofSimResParams_Table.h" +class TBrowser; class St_tofSimResParamsC : public TChair { public: @@ -11,7 +12,12 @@ class St_tofSimResParamsC : public TChair { UInt_t getNumRows() const {return GetNRows();} UShort_t * resolution(Int_t i = 0) const {return Struct(i)->resolution;} UChar_t* algoFlag(Int_t i = 0) const {return Struct(i)->algoFlag;} + static Double_t average_timeres_tof(){return mAverageTimeResTof;} + static Double_t timeres_tof(UInt_t itray, UInt_t imodule, UInt_t icell); + void Browse(TBrowser *b) {} protected: + static Double_t params[120][192]; + static Double_t mAverageTimeResTof; St_tofSimResParamsC(St_tofSimResParams *table=0) : TChair(table) {} virtual ~St_tofSimResParamsC() {fgInstance = 0;} private: diff --git a/StRoot/StDetectorDbMaker/St_tpcAnodeHVC.h b/StRoot/StDetectorDbMaker/St_tpcAnodeHVC.h index 58f865c9bd2..169740c91c3 100644 --- a/StRoot/StDetectorDbMaker/St_tpcAnodeHVC.h +++ b/StRoot/StDetectorDbMaker/St_tpcAnodeHVC.h @@ -12,7 +12,7 @@ class St_tpcAnodeHVC : public TChair { UShort_t sector(Int_t i = 0) const {return Struct(i)->sector;} UShort_t socket(Int_t i = 0) const {return Struct(i)->socket;} Float_t voltage(Int_t i = 0) const; - Bool_t livePadrow(Int_t sector = 1, Int_t padrow = 1) const { return voltagePadrow(sector,padrow) > 500; } + Bool_t livePadrow(Int_t sector = 1, Int_t padrow = 1) const { return voltagePadrow(sector,padrow) > 850; } Float_t voltagePadrow(Int_t sector = 1, Int_t padrow = 1) const ; // sector=1..24 , padrow=1..100 Bool_t tripped(Int_t sector = 1, Int_t padrow = 1) const { return (voltagePadrow(sector,padrow) < -100); } static void sockets(Int_t sector, Int_t padrow, Int_t &e1, Int_t &e2, Float_t &f2); diff --git a/StRoot/StDetectorDbMaker/St_tpcAnodeHVavgC.h b/StRoot/StDetectorDbMaker/St_tpcAnodeHVavgC.h index c7ef8a5f8f4..0d9254678e7 100644 --- a/StRoot/StDetectorDbMaker/St_tpcAnodeHVavgC.h +++ b/StRoot/StDetectorDbMaker/St_tpcAnodeHVavgC.h @@ -15,7 +15,7 @@ class St_tpcAnodeHVavgC : public TChair { Float_t rms(Int_t i = 0) const {return Struct(i)->rms;} Int_t numentries(Int_t i = 0) const {return Struct(i)->numentries;} Int_t numoutliers(Int_t i = 0) const {return Struct(i)->numoutliers;} - Bool_t livePadrow(Int_t sec = 1, Int_t padrow = 1) const { return voltagePadrow(sec,padrow) > 500; } + Bool_t livePadrow(Int_t sec = 1, Int_t padrow = 1) const { return voltagePadrow(sec,padrow) > 850; } Float_t voltagePadrow(Int_t sec = 1, Int_t padrow = 1) const; // sector=1..24 , padrow=1..100 Bool_t tripped(Int_t sec = 1, Int_t padrow = 1) const;// { return (voltage() < -100); } protected: diff --git a/StRoot/StDetectorDbMaker/St_tpcDriftVelocityC.h b/StRoot/StDetectorDbMaker/St_tpcDriftVelocityC.h index baa2be3cd6f..e50241a0194 100644 --- a/StRoot/StDetectorDbMaker/St_tpcDriftVelocityC.h +++ b/StRoot/StDetectorDbMaker/St_tpcDriftVelocityC.h @@ -13,6 +13,7 @@ class St_tpcDriftVelocityC : public TChair { Float_t laserDriftVelocityWest(Int_t i = 0) {return Struct(i)->laserDriftVelocityWest;} Float_t cathodeDriftVelocityEast(Int_t i = 0) {return Struct(i)->cathodeDriftVelocityEast;} Float_t cathodeDriftVelocityWest(Int_t i = 0) {return Struct(i)->cathodeDriftVelocityWest;} + Float_t timeBucketPitch(Int_t i = 0); // cm #if 0 Float_t scaleY(Int_t i = 0) {return Struct(i)->scaleY;} #endif diff --git a/StRoot/StDetectorDbMaker/St_tpcExtraGainCorrectionC.h b/StRoot/StDetectorDbMaker/St_tpcExtraGainCorrectionC.h index 57d87ea438e..3e1534410ab 100644 --- a/StRoot/StDetectorDbMaker/St_tpcExtraGainCorrectionC.h +++ b/StRoot/StDetectorDbMaker/St_tpcExtraGainCorrectionC.h @@ -9,17 +9,17 @@ class St_tpcExtraGainCorrectionC : public TChair { static St_tpcExtraGainCorrectionC* instance(); tpcExtraGainCorrection_st *Struct(Int_t i = 0) const {return ((St_tpcExtraGainCorrection*) Table())->GetTable()+i;} UInt_t getNumRows() const {return GetNRows();} - UChar_t idx(Int_t i = 0) const {return Struct(i)->idx;} - UChar_t nrows(Int_t i = 0) const {return Struct(i)->nrows;} + Short_t idx(Int_t i = 0) const {return Struct(i)->idx;} + Short_t nrows(Int_t i = 0) const {return Struct(i)->nrows;} Int_t runMin(Int_t i = 0) const {return Struct(i)->runMin;} Int_t runMax(Int_t i = 0) const {return Struct(i)->runMax;} - UChar_t sector(Int_t i = 0) const {return Struct(i)->sector;} - UChar_t row(Int_t i = 0) const {return Struct(i)->row;} + Int_t sector(Int_t i = 0) const {return Struct(i)->sector;} + Int_t row(Int_t i = 0) const {return Struct(i)->row;} + Int_t RDO(Int_t i = 0) const {return Struct(i)->RDO;} + Int_t FEE(Int_t i = 0) const {return Struct(i)->FEE;} Short_t padMin(Int_t i = 0) const {return Struct(i)->padMin;} Short_t padMax(Int_t i = 0) const {return Struct(i)->padMax;} - UChar_t RDO(Int_t i = 0) const {return Struct(i)->RDO;} - UChar_t FEE(Int_t i = 0) const {return Struct(i)->FEE;} - UChar_t status(Int_t i = 0) const {return Struct(i)->status;} + Short_t status(Int_t i = 0) const {return Struct(i)->status;} protected: St_tpcExtraGainCorrectionC(St_tpcExtraGainCorrection *table=0) : TChair(table) {} virtual ~St_tpcExtraGainCorrectionC() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_tpcMaxHitsC.h b/StRoot/StDetectorDbMaker/St_tpcMaxHitsC.h index 16443fc96d5..1795affa638 100644 --- a/StRoot/StDetectorDbMaker/St_tpcMaxHitsC.h +++ b/StRoot/StDetectorDbMaker/St_tpcMaxHitsC.h @@ -2,12 +2,14 @@ #define St_tpcMaxHitsC_h #include "TChair.h" #include "tables/St_tpcMaxHits_Table.h" +class TBrowser; class St_tpcMaxHitsC : public TChair { public: static St_tpcMaxHitsC* instance(); tpcMaxHits_st *Struct(Int_t i = 0) {return ((St_tpcMaxHits*) Table())->GetTable()+i;} Int_t maxSectorHits() {return Struct()->maxSectorHits;} Int_t maxBinZeroHits() {return Struct()->maxBinZeroHits;} + void Browse(TBrowser *b) {} protected: St_tpcMaxHitsC(St_tpcMaxHits *table=0) : TChair(table) {} virtual ~St_tpcMaxHitsC() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_tpcPadConfigC.h b/StRoot/StDetectorDbMaker/St_tpcPadConfigC.h index b55e690f0b4..21ee90bcc4e 100644 --- a/StRoot/StDetectorDbMaker/St_tpcPadConfigC.h +++ b/StRoot/StDetectorDbMaker/St_tpcPadConfigC.h @@ -10,58 +10,58 @@ class St_tpcPadConfigC : public TChair { tpcPadConfig_st *Struct(Int_t i=0); UInt_t getNumRows(); UChar_t *itpc(Int_t i=0) {return (((St_tpcPadConfig*) Table())->GetTable(i))->itpc;} - UChar_t iTpc(Int_t sector); - UChar_t iTPC(Int_t sector) {return iTpc(sector);} - Int_t padRows(Int_t sector); - Int_t innerPadRows(Int_t sector); - Int_t innerPadRows48(Int_t sector); - Int_t innerPadRows52(Int_t sector); - Int_t outerPadRows(Int_t sector); - Int_t superInnerPadRows(Int_t sector); - Int_t superOuterPadRows(Int_t sector); - Double_t innerSectorPadWidth(Int_t sector); - Double_t innerSectorPadLength(Int_t sector); - Double_t innerSectorPadPitch(Int_t sector); - Double_t innerSectorRowPitch1(Int_t sector); - Double_t innerSectorRowPitch2(Int_t sector); - Double_t firstPadRow(Int_t sector); - Double_t firstOuterSectorPadRow(Int_t sector); - Double_t lastOuterSectorPadRow(Int_t sector); - Double_t firstRowWidth(Int_t sector); - Double_t lastRowWidth(Int_t sector); - Double_t outerSectorPadWidth(Int_t sector); - Double_t outerSectorPadLength(Int_t sector); - Double_t outerSectorPadPitch(Int_t sector); - Double_t outerSectorRowPitch(Int_t sector); - Double_t outerSectorLength(Int_t sector); - Double_t ioSectorSeparation(Int_t sector); - Double_t innerSectorEdge(Int_t sector); - Double_t outerSectorEdge(Int_t sector); - Double_t innerSectorPadPlaneZ(Int_t sector); - Double_t outerSectorPadPlaneZ(Int_t sector); - Int_t* innerPadsPerRow(Int_t sector); - Int_t* outerPadsPerRow(Int_t sector); - Int_t padsPerRow(Int_t sector, Int_t row = 1); - Double_t* innerRowRadii(Int_t sector); - Double_t* outerRowRadii(Int_t sector); + UChar_t iTpc(Int_t sector = 1); + UChar_t iTPC(Int_t sector = 1) {return iTpc(sector);} + Int_t padRows(Int_t sector = 1); + Int_t innerPadRows(Int_t sector = 1); + Int_t innerPadRows48(Int_t sector = 1); + Int_t innerPadRows52(Int_t sector = 1); + Int_t outerPadRows(Int_t sector = 1); + Int_t superInnerPadRows(Int_t sector = 1); + Int_t superOuterPadRows(Int_t sector = 1); + Double_t innerSectorPadWidth(Int_t sector = 1); + Double_t innerSectorPadLength(Int_t sector = 1); + Double_t innerSectorPadPitch(Int_t sector = 1); + Double_t innerSectorRowPitch1(Int_t sector = 1); + Double_t innerSectorRowPitch2(Int_t sector = 1); + Double_t firstPadRow(Int_t sector = 1); + Double_t firstOuterSectorPadRow(Int_t sector = 1); + Double_t lastOuterSectorPadRow(Int_t sector = 1); + Double_t firstRowWidth(Int_t sector = 1); + Double_t lastRowWidth(Int_t sector = 1); + Double_t outerSectorPadWidth(Int_t sector = 1); + Double_t outerSectorPadLength(Int_t sector = 1); + Double_t outerSectorPadPitch(Int_t sector = 1); + Double_t outerSectorRowPitch(Int_t sector = 1); + Double_t outerSectorLength(Int_t sector = 1); + Double_t ioSectorSeparation(Int_t sector = 1); + Double_t innerSectorEdge(Int_t sector = 1); + Double_t outerSectorEdge(Int_t sector = 1); + Double_t innerSectorPadPlaneZ(Int_t sector = 1); + Double_t outerSectorPadPlaneZ(Int_t sector = 1); + Int_t* innerPadsPerRow(Int_t sector = 1); + Int_t* outerPadsPerRow(Int_t sector = 1); + Int_t padsPerRow(Int_t sector = 1, Int_t row = 1); + Double_t* innerRowRadii(Int_t sector = 1); + Double_t* outerRowRadii(Int_t sector = 1); // taken from StRItpcPadPlane - Int_t numberOfRows(Int_t sector); - Int_t numberOfInnerRows(Int_t sector); - Int_t numberOfInnerRows48(Int_t sector); - Int_t numberOfInnerRows52(Int_t sector); - Int_t numberOfOuterRows(Int_t sector); - Bool_t isRowInRange(Int_t sector, Int_t row); - Double_t radialDistanceAtRow(Int_t sector, Int_t row); - Int_t numberOfPadsAtRow(Int_t sector, Int_t row); - Double_t PadWidthAtRow(Int_t sector, Int_t row); - Double_t PadLengthAtRow(Int_t sector, Int_t row); - Double_t PadPitchAtRow(Int_t sector, Int_t row); - Double_t RowPitchAtRow(Int_t sector, Int_t row); - Int_t indexForRowPad(Int_t sector, Int_t row, Int_t pad); - bool isiTpcSector(Int_t sector) { return iTpc(sector) == 1; } - bool isiTpcPadRow(Int_t sector, Int_t row) { return iTpc(sector) && row >= 1 && row <= numberOfInnerRows(sector); } - bool isInnerPadRow(Int_t sector, Int_t row) { return row <= numberOfInnerRows(sector); } - Int_t IsRowInner(Int_t sector, Int_t row) {return (row <= innerPadRows(sector)) ? 1 : 0;} + Int_t numberOfRows(Int_t sector = 1); + Int_t numberOfInnerRows(Int_t sector = 1); + Int_t numberOfInnerRows48(Int_t sector = 1); + Int_t numberOfInnerRows52(Int_t sector = 1); + Int_t numberOfOuterRows(Int_t sector = 1); + Bool_t isRowInRange(Int_t sector = 1, Int_t row = 1); + Double_t radialDistanceAtRow(Int_t sector = 1, Int_t row = 1); + Int_t numberOfPadsAtRow(Int_t sector = 1, Int_t row = 1); + Double_t PadWidthAtRow(Int_t sector = 1, Int_t row = 1); + Double_t PadLengthAtRow(Int_t sector = 1, Int_t row = 1); + Double_t PadPitchAtRow(Int_t sector = 1, Int_t row = 1); + Double_t RowPitchAtRow(Int_t sector = 1, Int_t row = 1); + Int_t indexForRowPad(Int_t sector = 1, Int_t row = 1, Int_t pad = 1); + bool isiTpcSector(Int_t sector = 1) { return iTpc(sector) == 1; } + bool isiTpcPadRow(Int_t sector = 1, Int_t row = 1) { return iTpc(sector) && row >= 1 && row <= numberOfInnerRows(sector); } + bool isInnerPadRow(Int_t sector = 1, Int_t row = 1) { return row <= numberOfInnerRows(sector); } + Int_t IsRowInner(Int_t sector = 1, Int_t row = 1) {return (row <= innerPadRows(sector)) ? 1 : 0;} protected: St_tpcPadConfigC(St_tpcPadConfig *table=0) : TChair(table) {} virtual ~St_tpcPadConfigC() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_tpcPadGainT0C.h b/StRoot/StDetectorDbMaker/St_tpcPadGainT0C.h index 8d692151502..71f4d2abc33 100644 --- a/StRoot/StDetectorDbMaker/St_tpcPadGainT0C.h +++ b/StRoot/StDetectorDbMaker/St_tpcPadGainT0C.h @@ -4,6 +4,7 @@ #include "TChair.h" #include "tables/St_tpcPadGainT0_Table.h" #include "St_tpcPadConfigC.h" +class TBrowser; class St_tpcPadGainT0C : public TChair { public: static St_tpcPadGainT0C* instance(); @@ -28,6 +29,7 @@ class St_tpcPadGainT0C : public TChair { for (Int_t pad=1; pad<=182; pad++) if (Gain(sector,row,pad)>0) return kTRUE; return kFALSE; } + void Browse(TBrowser *b) {} protected: St_tpcPadGainT0C(St_tpcPadGainT0 *table=0) : TChair(table) {} virtual ~St_tpcPadGainT0C() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_tpcRDOMasksC.h b/StRoot/StDetectorDbMaker/St_tpcRDOMasksC.h index 1cea318aeee..988a276e2be 100644 --- a/StRoot/StDetectorDbMaker/St_tpcRDOMasksC.h +++ b/StRoot/StDetectorDbMaker/St_tpcRDOMasksC.h @@ -13,8 +13,9 @@ class St_tpcRDOMasksC : public TChair { UInt_t getNumRows() {return GetNRows();} UInt_t runNumber(Int_t i = 0) {return Struct(i)->runNumber;} UInt_t sector(Int_t i = 0) {return Struct(i)->sector;} - UInt_t mask(Int_t i = 0) {return Struct(i)->mask;} + UInt_t &mask(Int_t i = 0) {return *&Struct(i)->mask;} UInt_t getSectorMask(UInt_t sector); + void setSectorRDOMaskOff(UInt_t sector, Int_t rdo); #if 0 static UInt_t rdoForPadrow(Int_t row) { //Function returns the rdo board number for a given padrow index. Range of map used is 1-45. UInt_t rdo = 0; diff --git a/StRoot/StDetectorDbMaker/St_tpcT0BXC.h b/StRoot/StDetectorDbMaker/St_tpcT0BXC.h index a506897d679..dfaed2f326c 100644 --- a/StRoot/StDetectorDbMaker/St_tpcT0BXC.h +++ b/StRoot/StDetectorDbMaker/St_tpcT0BXC.h @@ -21,7 +21,7 @@ class St_tpcT0BXC : public TChair { Float_t dslope(Int_t i = 0) const {return Struct(i)->dslope;} Float_t CountPs(Int_t i = 0) const {return Struct(i)->CountPs;} Float_t dCountPs(Int_t i = 0) const {return Struct(i)->dCountPs;} - Double_t getT0(Double_t values[6]) const; + Double_t getT0(Double_t values[7]) const; protected: St_tpcT0BXC(St_tpcT0BX *table=0) : TChair(table) {} virtual ~St_tpcT0BXC() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/St_trgTimeOffsetC.h b/StRoot/StDetectorDbMaker/St_trgTimeOffsetC.h index 5a14b83e5c1..c0f4c5bc0bf 100644 --- a/StRoot/StDetectorDbMaker/St_trgTimeOffsetC.h +++ b/StRoot/StDetectorDbMaker/St_trgTimeOffsetC.h @@ -15,6 +15,7 @@ class St_trgTimeOffsetC : public TChair { Float_t triggerTimeOffset(Int_t i = 0) {return 1e-6*(mLaser ? laserOffset(i) : offset(i));} // usec Float_t triggerTimeOffsetWest(Int_t i = 0) {return 1e-6*(mLaser ? laserOffsetW(i) : 0);} // usec void SetLaser(Bool_t k = kTRUE) {mLaser = k;} + Int_t IsLaser() { return mLaser;} protected: St_trgTimeOffsetC(St_trgTimeOffset *table=0) : TChair(table), mLaser(kFALSE) {} virtual ~St_trgTimeOffsetC() {fgInstance = 0;} diff --git a/StRoot/StDetectorDbMaker/StiChairs.cxx b/StRoot/StDetectorDbMaker/StiChairs.cxx index 643e48e79ad..15f9503b8ce 100644 --- a/StRoot/StDetectorDbMaker/StiChairs.cxx +++ b/StRoot/StDetectorDbMaker/StiChairs.cxx @@ -2,14 +2,13 @@ #include "StarChairDefs.h" #include "St_db_Maker/St_db_Maker.h" #include "StDetectorDbMaker/StiHitErrorCalculator.h" -//________________________________________________________________________________ -#include "StiHitErrorCalculator.h" ClassImp(StiHitErrorCalculator); //________________________________________________________________________________ void StiHitErrorCalculator::calculateError(Double_t _z, Double_t _eta, Double_t _tanl, Double_t &ecross, Double_t &edip, Double_t fudgeCactor) const { static const Double_t tenMicrons = 1e-3; static const Double_t min2Err = tenMicrons*tenMicrons; static const Double_t max2Err = 1.; + static const Double_t scale = 1.; const Double_t *Coeff = ((StiHitErrorCalculator *) this)->coeff(); #if 0 Double_t dz = (200.-TMath::Abs(_z+100))/100.; // Local z @@ -27,12 +26,12 @@ void StiHitErrorCalculator::calculateError(Double_t _z, Double_t _eta, Double_t Double_t sinCA = TMath::Sin(Phi); if (TMath::Abs(cosCA)<0.01) cosCA=0.01; Double_t tanCA = sinCA/cosCA; - ecross=fudgeCactor*fudgeCactor*(Coeff[0]+Coeff[1]*dz/(cosCA*cosCA) +Coeff[2]*tanCA*tanCA); + ecross=scale*fudgeCactor*fudgeCactor*(Coeff[0]+Coeff[1]*dz/(cosCA*cosCA) +Coeff[2]*tanCA*tanCA); if (ecross< min2Err) ecross = min2Err; if (ecross> max2Err) ecross = max2Err; Double_t tanDip=_tanl; Double_t cosDipInv2=1+tanDip*tanDip; - edip=fudgeCactor*fudgeCactor*(Coeff[3]+Coeff[4]*dz*cosDipInv2+Coeff[5]*tanDip*tanDip); + edip=scale*fudgeCactor*fudgeCactor*(Coeff[3]+Coeff[4]*dz*cosDipInv2+Coeff[5]*tanDip*tanDip); if (edip< min2Err) edip = min2Err; if (edip> max2Err) edip = max2Err; // Temporary hack for Gene. Increase prompt hit errors @@ -51,3 +50,48 @@ MakeChairInstance2(LocalTrackSeedFinder,StiLocalTrackSeedFinderParameters,Calibr MakeChairInstance2(KalmanTrackFitterParameters,StiKalmanTrackFitterParameters,Calibrations/tracker/KalmanTrackFitterParameters); #include "StiKalmanTrackFinderParameters.h" MakeChairInstance2(KalmanTrackFinderParameters,StiKalmanTrackFinderParameters,Calibrations/tracker/KalmanTrackFinderParameters); +#include "StiTpcHitErrorMDF4.h" +//________________________________________________________________________________ +void StiTpcHitErrorMDF4::convert(Double_t _z, Double_t _eta, Double_t _tanl, Double_t AdcL) { + fxx[0] = 1. - TMath::Abs(_z)/207.707; // Z + Double_t y = TMath::Tan(_eta); + fxx[1] = y*y; // tanP**2 + fxx[2] = _tanl*_tanl; // tanL**2 + fxx[3] = AdcL; // AdcL +} +//________________________________________________________________________________ +void StiTpcHitErrorMDF4::calculateError(Double_t _z, Double_t _eta, Double_t _tanl, + Double_t &ecross, Double_t &edip, + Double_t fudgeFactor, Double_t AdcL, + Double_t *dZ, Double_t *dX) { + static const Double_t tenMicrons = 1e-3; + static const Double_t min2Err = tenMicrons*tenMicrons; + static const Double_t max2Err = 1.; + static const Double_t scale = 1.; + convert(_z, _eta, _tanl, AdcL); + Double_t dPadSigmaSQ = Eval( 0, fxx); + Double_t dTimeSigmaSQ = Eval( 2, fxx); + ecross = scale*padPitch() *padPitch() *dPadSigmaSQ * fudgeFactor; + edip = scale*timePitch()*timePitch()*dTimeSigmaSQ * fudgeFactor; + Int_t fail = 0; + if (ecross< min2Err) {ecross = min2Err; fail++;} + if (ecross> max2Err) {ecross = max2Err; fail++;} + if (edip< min2Err) {edip = min2Err; fail++;} + if (edip> max2Err) {edip = max2Err; fail++;} + if (dZ) { + if (fail) *dZ = 0; + else { + Double_t dTime = Eval( 3, fxx); + *dZ = - timePitch()*dTime * TMath::Sign(1., _z); + } + } + if (dX) { + if (fail) *dX = 0; + else { + Double_t dPad = Eval( 1, fxx); + *dX = - padPitch()*dPad; + } + } +} +MakeChairInstance2(MDFCorrection4,StiTpcInnerHitErrorMDF4,Calibrations/tracker/TpcInnerHitErrorMDF4); +MakeChairInstance2(MDFCorrection4,StiTpcOuterHitErrorMDF4,Calibrations/tracker/TpcOuterHitErrorMDF4); diff --git a/StRoot/StDetectorDbMaker/StiTpcHitErrorMDF4.h b/StRoot/StDetectorDbMaker/StiTpcHitErrorMDF4.h new file mode 100644 index 00000000000..5d2ef96dd7d --- /dev/null +++ b/StRoot/StDetectorDbMaker/StiTpcHitErrorMDF4.h @@ -0,0 +1,55 @@ +#ifndef StiTpcHitErrorMDF4_h +#define StiTpcHitErrorMDF4_h + +#include "Sti/StiNodePars.h" +#include "St_MDFCorrection4C.h" +#include "StDetectorDbMaker/St_tpcDriftVelocityC.h" +#include "StDetectorDbMaker/St_tpcPadConfigC.h" + +class StiTpcHitErrorMDF4 : public St_MDFCorrection4C { + public: + virtual void calculateError(Double_t _z, Double_t _eta, Double_t _tanl, + Double_t &ecross, Double_t &edip, + Double_t fudgeFactor = 1, Double_t AdcL = 5.5, Double_t *dZ = 0, Double_t *dX = 0); + virtual void calculateError(const StiNodePars *pars, + Double_t &ecross, Double_t &edip, + Double_t fudgeFactor = 1, Double_t AdcL = 5.5, Double_t *dZ = 0, Double_t *dX = 0) { + calculateError(pars->z(), pars->eta(), pars->tanl(), ecross, edip, fudgeFactor, AdcL, dZ, dX); + } + protected: + StiTpcHitErrorMDF4(St_MDFCorrection4 *table=0) : St_MDFCorrection4C(table) {} + virtual ~StiTpcHitErrorMDF4() {} + private: + void convert(Double_t _z, Double_t _eta, Double_t _tanl, Double_t AdcL); + Double_t fxx[4]; + virtual Double_t padPitch() = 0; + Double_t timePitch() {return St_tpcDriftVelocityC::instance()->timeBucketPitch();} + ClassDefineChair(StiTpcHitErrorMDF4,St_MDFCorrection4, MDFCorrection4_st ) + ClassDef(StiTpcHitErrorMDF4,1) //C++ TChair for MDFCorrection4 table class +}; +//________________________________________________________________________________ +class StiTpcInnerHitErrorMDF4 : public StiTpcHitErrorMDF4 { + public: + static StiTpcInnerHitErrorMDF4 *instance(); + protected: + StiTpcInnerHitErrorMDF4(St_MDFCorrection4 *table=0) : StiTpcHitErrorMDF4(table) {} + virtual ~StiTpcInnerHitErrorMDF4() {fgInstance = 0;} + private: + static StiTpcInnerHitErrorMDF4* fgInstance; + Double_t padPitch() {return St_tpcPadConfigC::instance()->innerSectorPadPitch();} + ClassDef(StiTpcInnerHitErrorMDF4,1) //C++ TChair for MDFCorrection4 table class +}; +//________________________________________________________________________________ +class StiTpcOuterHitErrorMDF4 : public StiTpcHitErrorMDF4 { + public: + static StiTpcOuterHitErrorMDF4 *instance(); + protected: + StiTpcOuterHitErrorMDF4(St_MDFCorrection4 *table=0) : StiTpcHitErrorMDF4(table) {} + virtual ~StiTpcOuterHitErrorMDF4() {fgInstance = 0;} + private: + static StiTpcOuterHitErrorMDF4* fgInstance; + Double_t padPitch() {return St_tpcPadConfigC::instance()->innerSectorPadPitch();} + ClassDef(StiTpcOuterHitErrorMDF4,1) //C++ TChair for MDFCorrection4 table class +}; + +#endif diff --git a/StRoot/StETofHitMaker/StETofHitMaker.cxx b/StRoot/StETofHitMaker/StETofHitMaker.cxx index 393e1eea5ad..809d4f4138b 100644 --- a/StRoot/StETofHitMaker/StETofHitMaker.cxx +++ b/StRoot/StETofHitMaker/StETofHitMaker.cxx @@ -1313,10 +1313,8 @@ StETofHitMaker::matchSides() int mode = mModMatrix.at(detIndex); modifyHit(mode, posX , posY , time); } - - - StETofHit* constructedHit = new StETofHit( sector, plane, counter, time, totSum, clusterSize, posX, posY ); - + + StETofHit* constructedHit = new StETofHit( sector, plane, counter, time, totSum, clusterSize, posX, posY ); //Check for "same direction double clockjumps" and update FlagMap if(mDoDoubleClockJumpShift){ diff --git a/StRoot/StEvent/StFcsCollection.h b/StRoot/StEvent/StFcsCollection.h index bec1c4abc1a..5dbc2465d0b 100644 --- a/StRoot/StEvent/StFcsCollection.h +++ b/StRoot/StEvent/StFcsCollection.h @@ -53,6 +53,9 @@ class StFcsCollection : public StObject { const StSPtrVecFcsPoint& points(unsigned int det) const; // Return the point list unsigned int numberOfPoints(unsigned int det) const; // Return the number of points + void setDataExist(int v) {mDataExist=v;} + int isDataExist() {return mDataExist;} + int fcsReconstructionFlag() const; void setFcsReconstructionFlag(int v); @@ -64,9 +67,9 @@ class StFcsCollection : public StObject { StSPtrVecFcsPoint mPoints[kFcsNDet]; Int_t mFcsReconstructionFlag=0; // undefined for now + Int_t mDataExist=0; // if FCS data existed in daq file - ClassDef(StFcsCollection,1) - + ClassDef(StFcsCollection,2) }; inline int StFcsCollection::fcsReconstructionFlag() const {return mFcsReconstructionFlag;} diff --git a/StRoot/StEvent/StFstConsts.h b/StRoot/StEvent/StFstConsts.h index 422bcd2702d..fd84cc5ed12 100644 --- a/StRoot/StEvent/StFstConsts.h +++ b/StRoot/StEvent/StFstConsts.h @@ -52,7 +52,7 @@ const float kFstrStart[kFstNumRStripsPerWedge]= {5.000, 7.875, 10.750, 13.625, 1 const float kFstrStop[kFstNumRStripsPerWedge] = {7.875, 10.750, 136.25, 16.500, 19.375, 22.250, 25.125, 28.000}; // in cm //general APV chip constants -const unsigned char kFstNumTimeBins = 3; // 3 time bins for ADC sampling (maximum time bin number) +const unsigned char kFstNumTimeBins = 9; // 9 time bins for ADC sampling (maximum time bin number, 3 or 9) const unsigned char kFstDefaultTimeBin = 2; // the default time bin number (2nd time bin) for FST raw hits const int kFstMaxAdc = 4096; // ADC value should be less than 4096 (12 bits ADC) diff --git a/StRoot/StEvent/StFwdTrack.h b/StRoot/StEvent/StFwdTrack.h index b082daa28ae..315f3b941e3 100644 --- a/StRoot/StEvent/StFwdTrack.h +++ b/StRoot/StEvent/StFwdTrack.h @@ -26,7 +26,7 @@ class StFcsCluster; -struct StFwdTrackProjection { +struct StFwdTrackProjection : public StObject { StFwdTrackProjection() {} StFwdTrackProjection ( const StFwdTrackProjection & other) { mXYZ = other.mXYZ; @@ -70,9 +70,11 @@ struct StFwdTrackProjection { float dz(){ return sqrt( mCov[8] ); } + + ClassDef(StFwdTrackProjection, 1) }; -struct StFwdTrackSeedPoint { +struct StFwdTrackSeedPoint : public StObject { StFwdTrackSeedPoint() {} StFwdTrackSeedPoint( StThreeVectorD xyz, short sec, @@ -88,6 +90,8 @@ struct StFwdTrackSeedPoint { unsigned short mTrackId; short mSector; float mCov[9]; + + ClassDef(StFwdTrackSeedPoint, 1) }; class StFwdTrack : public StObject { @@ -169,7 +173,7 @@ class StFwdTrack : public StObject { StPtrVecFcsCluster mEcalClusters; StPtrVecFcsCluster mHcalClusters; - ClassDef(StFwdTrack,1) + ClassDef(StFwdTrack,2) }; diff --git a/StRoot/StEvent/StTriggerData.cxx b/StRoot/StEvent/StTriggerData.cxx index be786954cdb..37f5a3eb9f2 100644 --- a/StRoot/StEvent/StTriggerData.cxx +++ b/StRoot/StEvent/StTriggerData.cxx @@ -176,9 +176,12 @@ void StTriggerData::decodeQT(unsigned int ndata, unsigned int* data, unsigned sh nline = (d & 0x000000ff); oldch = -1; if (addr > 15 || (oldcrt!=-1 && crate!=oldcrt)){ + static Int_t err = 0; + err++; + if (err <10) printf("i=%3d d=%08x crt=%3d adr=%08x nline=%3d oldcrt=%3d QTBd header bad crt or addr\n", i,d,crate,addr+0x10,nline,oldcrt); - return; + return; } // else { //printf("i=%3d d=%08x crt=%3d adr=0x%02x nline=%3d\n",i,d,crate,addr+0x10,nline); @@ -233,6 +236,7 @@ unsigned short StTriggerData::mAddBits() const {return 0;} unsigned short StTriggerData::bcData(int address) const {return 0;} unsigned short StTriggerData::getTrgDetMask() const {return 0;} unsigned int StTriggerData::getTrgCrateMask() const {return 0;} +unsigned int StTriggerData::zdcKillerBit() const {return 0;} unsigned short StTriggerData::busyStatus() const {return 0;} unsigned int StTriggerData::tcuCounter() const {return 0;} unsigned int StTriggerData::rccCounter(int crate) const {return 0;} diff --git a/StRoot/StEvent/StTriggerData.h b/StRoot/StEvent/StTriggerData.h index 5296821d835..88a21b39a45 100644 --- a/StRoot/StEvent/StTriggerData.h +++ b/StRoot/StEvent/StTriggerData.h @@ -212,6 +212,7 @@ class StTriggerData : public StObject { virtual unsigned int token() const = 0; virtual unsigned int triggerWord() const = 0; virtual unsigned int actionWord() const = 0; + virtual unsigned int zdcKillerBit() const; virtual unsigned short busyStatus() const; virtual unsigned short dsmInput() const; virtual unsigned short trgToken() const; diff --git a/StRoot/StEvent/StTriggerData2022.cxx b/StRoot/StEvent/StTriggerData2022.cxx index b19e2a21d77..eda0ccc1d78 100644 --- a/StRoot/StEvent/StTriggerData2022.cxx +++ b/StRoot/StEvent/StTriggerData2022.cxx @@ -231,6 +231,11 @@ unsigned int StTriggerData2022::actionWord() const ( EvtDesc->actionWdDetectorBitMask & 0x00ff ); } + +unsigned int StTriggerData2022::zdcKillerBit() const{ + return (EvtDesc->addBits>>4) & 0x1; +} + unsigned int StTriggerData2022::numberOfPreXing() const { return EvtDesc->npre & 0xf; diff --git a/StRoot/StEvent/StTriggerData2022.h b/StRoot/StEvent/StTriggerData2022.h index ec29597b569..a38c7995cc0 100644 --- a/StRoot/StEvent/StTriggerData2022.h +++ b/StRoot/StEvent/StTriggerData2022.h @@ -47,6 +47,7 @@ class StTriggerData2022 : public StTriggerData { unsigned int token() const; unsigned int triggerWord() const; unsigned int actionWord() const; + unsigned int zdcKillerBit() const; unsigned short busyStatus() const; unsigned short dsmInput() const; unsigned short trgToken() const; @@ -283,7 +284,7 @@ class StTriggerData2022 : public StTriggerData { void swapRawDetOfflen(TrgOfflen2022* offlen); void swapRawDet(DataBlock2022* data, int name, int hlength, int bs); - ClassDef(StTriggerData2022,1) + ClassDef(StTriggerData2022,2) }; inline void StTriggerData2022::swapOfflen(TrgOfflen2022* offlen) diff --git a/StRoot/StEventUtilities/StEbyET0.cxx b/StRoot/StEventUtilities/StEbyET0.cxx index 98d1c188da2..f707ec420c6 100644 --- a/StRoot/StEventUtilities/StEbyET0.cxx +++ b/StRoot/StEventUtilities/StEbyET0.cxx @@ -69,17 +69,17 @@ double StEbyET0::getTime(StEvent* event, int mode) { if (info[0] > 0 && info[1] > 0) coordinate = 0.5*(info[0]+info[1]); break; - case 5 : // next 4 use east trigger detectors + case 4 : // next 4 use east trigger detectors + case 5 : case 6 : - case 7 : - case 8 : getTriggerInfo(event,static_cast (detector-4),info); + case 7 : getTriggerInfo(event,static_cast (detector-4),info); if (info[0] > 0) coordinate = info[0]; break; - case 9 : // next 4 use west trigger detectors + case 8 : // next 4 use west trigger detectors + case 9 : case 10 : - case 11 : - case 12 : getTriggerInfo(event,static_cast (detector-8),info); + case 11 : getTriggerInfo(event,static_cast (detector-8),info); if (info[1] > 0) coordinate = info[1]; break; diff --git a/StRoot/StFcsClusterMaker/StFcsClusterMaker.cxx b/StRoot/StFcsClusterMaker/StFcsClusterMaker.cxx index 050df3cfbe6..6a92d4d5acf 100644 --- a/StRoot/StFcsClusterMaker/StFcsClusterMaker.cxx +++ b/StRoot/StFcsClusterMaker/StFcsClusterMaker.cxx @@ -285,7 +285,7 @@ float StFcsClusterMaker::isNeighbor(StFcsHit* hit, StFcsCluster* clu){ if(ehp==1) thr=mNeighborDistance_Hcal; float d = distance(hit,h); float e = h->energy(); - if(d < thr) ne=e; + if(d < thr && e>ne) ne=e; } return ne; } diff --git a/StRoot/StFcsDbMaker/StFcsDb.cxx b/StRoot/StFcsDbMaker/StFcsDb.cxx index b666a7c2f09..e6e1feec7e3 100644 --- a/StRoot/StFcsDbMaker/StFcsDb.cxx +++ b/StRoot/StFcsDbMaker/StFcsDb.cxx @@ -244,15 +244,6 @@ StFcsDb::StFcsDb(const char *name) : TDataSet(name) {}; StFcsDb::~StFcsDb() {} int StFcsDb::Init(){ - if(mRun19>0){ - makeMap2019(); - }else{ - makeMap(); - printEtGain(); - } - if(mDebug>0) { - printMap(); - } return kStOK; } @@ -300,6 +291,16 @@ int StFcsDb::InitRun(int runNumber) { LOG_INFO << "StFcsDb::InitRun - run = " << runNumber << endm; mRun=runNumber; + if(mRun19>0){ + makeMap2019(); + }else{ + makeMap(); + printEtGain(); + } + if(mDebug>0) { + printMap(); + } + //storing in DEP sorted table if(mGainMode==GAINMODE::DB){ int ie=0, ih=0, ip=0, ehp, ns, crt, slt, dep, ch; @@ -532,7 +533,7 @@ void StFcsDb::getDetIdFromKey(unsigned short key, unsigned short& detid, unsigne unsigned short StFcsDb::getDetFromKey(unsigned short key){ return (key >> 12) & 0x0007; } unsigned short StFcsDb::getIdFromKey(unsigned short key) { return (key & 0x0fff); } -StThreeVectorD StFcsDb::getDetectorOffset(int det) const{ +StThreeVectorD StFcsDb::getDetectorOffset(int det, double zdepth ) const{ if(mRun19>0){ const float bOffY=-(17.0*5.81); //40in=101.6cm and 17*5.81=98.76 so I will leave this unchanged if(det==1) return StThreeVectorD( 25.25*2.54, bOffY + getYWidth(det)*nRow(det)/2.0, 710.16); @@ -547,17 +548,25 @@ StThreeVectorD StFcsDb::getDetectorOffset(int det) const{ } return StThreeVectorD(0.0, 0.0, 0.0); }else{ + double xoff = 0; + double zoff = 0; + if( zdepth>0 ){ + double detangle = getDetectorAngle(det)*M_PI/180.0; + if( det%2==0 ){ detangle *= -1.0; } //North side use negative angle + xoff = zdepth*sin(detangle); + zoff = zdepth*cos(detangle); + } if(mDbAccess==0){ //no DB - if(det==0) return StThreeVectorD(-17.399, -5.26, 710.16); - if(det==1) return StThreeVectorD( 17.399, -5.26, 710.16); - if(det==2) return StThreeVectorD(-21.285, +1.80, 782.63); - if(det==3) return StThreeVectorD( 21.285, +1.80, 782.63); + if(det==0) return StThreeVectorD(-17.399+xoff, -5.26, 710.16+zoff); + if(det==1) return StThreeVectorD( 17.399+xoff, -5.26, 710.16+zoff); + if(det==2) return StThreeVectorD(-21.285+xoff, +1.80, 782.63+zoff); + if(det==3) return StThreeVectorD( 21.285+xoff, +1.80, 782.63+zoff); return StThreeVectorD(0.0, 0.0, 0.0); }else{ //from DB if(det>=0 && det<4) - return StThreeVectorD(mFcsDetectorPosition.xoff[det], + return StThreeVectorD(mFcsDetectorPosition.xoff[det]+xoff, mFcsDetectorPosition.yoff[det], - mFcsDetectorPosition.zoff[det]); + mFcsDetectorPosition.zoff[det]+zoff); return StThreeVectorD(0.0, 0.0, 0.0); } } @@ -698,6 +707,95 @@ double StFcsDb::getProjectedDistance(StFcsPoint* ecal, StFcsCluster* hcal, doub return sqrt(dX*dX + dY*dY); }; +StThreeVectorD StFcsDb::getNormal(int det) const +{ + double detangle = getDetectorAngle(det)*M_PI/180.0; + if( det%2==0 ){ detangle *= -1.0; } //North side use negative angle + return StThreeVectorD( sin(detangle), 0 ,cos(detangle) ); + double planenormal[3] = {sin(detangle),0,cos(detangle)}; +} + +StThreeVectorD StFcsDb::projectTrackToEcal(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert) const +{ + int det=0; // North side for negative px + // South side for positive px, since px==0 does not hit detector choose south side for that case + if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=1; } + if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=1; } + return projectTrack(det,g2ttrk,g2tvert,0); +} + +StThreeVectorD StFcsDb::projectTrackToHcal(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert) const +{ + int det = 2; // North side for negative px + // South side for positive px, since px==0 does not hit detector choose south side for that case + if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=3; } + if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=3; } + return projectTrack(det,g2ttrk,g2tvert,0); +} + +StThreeVectorD StFcsDb::projectTrackToEcalSMax(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert) const +{ + int det=0; // North side for negative px + // South side for positive px, since px==0 does not hit detector choose south side for that case + if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=1; } + if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=1; } + return projectTrack(det,g2ttrk,g2tvert,-1); +} + +StThreeVectorD StFcsDb::projectTrackToHcalSMax(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert) const +{ + int det = 2; // North side for negative px + // South side for positive px, since px==0 does not hit detector choose south side for that case + if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=3; } + if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=3; } + return projectTrack(det,g2ttrk,g2tvert,-1); +} + +StThreeVectorD StFcsDb::projectTrack(int det, const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert, double showermaxz) const +{ + double linedir[3] = {g2ttrk->p[0],g2ttrk->p[1],g2ttrk->p[2]}; + if( g2tvert!=0 ){ + int vertind = g2ttrk->start_vertex_p - 1; //To correct for offset by one between fortran array and c array. 0 start index means it was generated at the starting vertex + std::cout << "+++++ DEBUG: vertind = " << vertind << " +++++" << std::endl; + double linestart[3] = {g2tvert[vertind].ge_x[0],g2tvert[vertind].ge_x[1],g2tvert[vertind].ge_x[2]}; + if( vertind >= 0 ){//Since start index==0 means no start then vertind<0 will default to using origin + return projectLine(det, linedir, linestart, showermaxz); + } + } + double zero[3] = {0,0,0}; + return projectLine(det,linedir,zero,showermaxz); +} + +StThreeVectorD StFcsDb::projectLine(int det, StThreeVectorD &linedirection, StThreeVectorD &lineorigin, double showermaxz) const +{ + double linedir[3] = {linedirection.x(),linedirection.y(),linedirection.z()}; + double linestart[3] = {lineorigin.x(),lineorigin.y(),lineorigin.z()}; + return projectLine(det,linedir,linestart,showermaxz); +} + +StThreeVectorD StFcsDb::projectLine(int det, double* linedirection, double* lineorigin, double showermaxz) const +{ + if( showermaxz<0 ){ showermaxz = getShowerMaxZ(det); } //when negative use default showermax + if( det%2==0 ){ //North side is negative x-axis + if( linedirection[2]>=0 && linedirection[0]>=0 ){ LOG_WARN << "Incorrect Det" << endm; } + if( linedirection[2]<0 && linedirection[0]<=0 ){ LOG_WARN << "Incorrect Det" << endm; } + } + else{ //South side is positive x-axis + if( linedirection[2]>=0 && linedirection[0]<0 ){ LOG_WARN << "Incorrect Det" << endm; } + if( linedirection[2]<0 && linedirection[0]>=0 ){ LOG_WARN << "Incorrect Det" << endm; } //(If x and z direction are both negative then also projects to south side which is positive x-axis + } + double detangle = getDetectorAngle(det)*M_PI/180.0; + if( det%2==0 ){ detangle *= -1.0; } //North side use negative angle + StThreeVectorD xyzoff = getDetectorOffset(det,showermaxz); + StThreeVectorD planenormal = getNormal(det); + //Solution of intersection of line and plane where line has direction {xdir,ydir,zdir}*t and starts at {xorigin,yorigin,zorigin} and a plane that has some normal with a point on the plane as the detector offset; "t" is the free parameter in the parametric equation of the line. + double tintersection = + (planenormal.x()*(xyzoff.x()-lineorigin[0])+planenormal.y()*(xyzoff.y()-lineorigin[1])+planenormal.z()*(xyzoff.z()-lineorigin[2])) / + (planenormal.x()*linedirection[0]+planenormal.y()*linedirection[1]+planenormal.z()*linedirection[2]); + + return StThreeVectorD( linedirection[0]*tintersection+lineorigin[0], linedirection[1]*tintersection+lineorigin[1], linedirection[2]*tintersection+lineorigin[2] ); +} + //! get coordinates of center of the cell STAR frame from StFcsHit StThreeVectorD StFcsDb::getStarXYZ(const StFcsHit* hit, float FcsZ) const{ return getStarXYZ(hit->detectorId(),hit->id(),FcsZ); diff --git a/StRoot/StFcsDbMaker/StFcsDb.h b/StRoot/StFcsDbMaker/StFcsDb.h index 19e81e3e59f..dc638f71eec 100644 --- a/StRoot/StFcsDbMaker/StFcsDb.h +++ b/StRoot/StFcsDbMaker/StFcsDb.h @@ -106,6 +106,7 @@ #include "tables/St_fcsPresValley_Table.h" #include "tables/St_vertexSeed_Table.h" #include "tables/St_g2t_track_Table.h" +#include "tables/St_g2t_vertex_Table.h" class StFcsHit; class StFcsCluster; class StFcsPoint; @@ -119,7 +120,6 @@ class StFcsDb : public TDataSet { int Init(); int InitRun(int runNumber); - void SetDebug(int v=1) {mDebug=v;} //! debug level void setDebug(int v=1) {mDebug=v;} //! debug level void setDbAccess(int v=1); //! enable(1) or disable(0) offline DB access void setRun(int run); //! set run# @@ -157,7 +157,15 @@ class StFcsDb : public TDataSet { static unsigned short getIdFromKey(unsigned short key); //! Utility functions related to DetectorPosition - StThreeVectorD getDetectorOffset(int det) const; //! get the offset of the detector + /** @brief get the offset of the detector. + + Get the inside corner of a given detector in global STAR coordinates. The x coordinate refers to the inside edge (closer to beam pipe). The y coordinate refers to the y-center of the detector. z coordinate is the front face of the detector unless zdepth>0. + + @param det detector id to get for offset + @param zdepth depth in z of the detector to get point for. Negative values return z of front face + */ + StThreeVectorD getDetectorOffset(int det, double zdepth=-1) const; + StThreeVectorD getNormal(int det) const; //! This is the vector normal to the detector plane float getDetectorAngle(int det) const; //! get the angle of the detector float getXWidth(int det) const; //! get the X width of the cell float getYWidth(int det) const; //! get the Y width of the cell @@ -275,6 +283,25 @@ class StFcsDb : public TDataSet { const g2t_track_st* getPrimaryG2tTrack(StFcsHit* h, g2t_track_st* g2ttrk, float& fraction, int& ntrk, unsigned int order=0); const g2t_track_st* getPrimaryG2tTrack(StFcsCluster* c, g2t_track_st* g2ttrk, float& fraction, int& ntrk, unsigned int order=0); + StThreeVectorD projectTrackToEcal(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert=0) const;//!< project a g2t track to Ecal with a given track and vertex. If no vertex given assume a vertex of (0,0,0) + StThreeVectorD projectTrackToHcal(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert=0) const;//!< project a g2t track to Hcal with a given track and vertex. If no vertex given assume a vertex of (0,0,0) + StThreeVectorD projectTrackToEcalSMax(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert=0) const; //!< SMax = Shower Max Z + StThreeVectorD projectTrackToHcalSMax(const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert=0) const; //!< SMax = Shower Max Z + StThreeVectorD projectTrack(int det, const g2t_track_st* g2ttrk, const g2t_vertex_st* g2tvert, double showermaxz=-1) const;//!< Generic g2t track projection function but #det and #showermaxz needs to be specified; if #det or #showermaxz not known use corresponding #projectTrackToEcal(), #projectTrackToHcal(), #projectTrackToEcalSMax, #projectTrackToHcalSMax instead + StThreeVectorD projectLine(int det, StThreeVectorD &linedirection, StThreeVectorD &lineorigin, double showermaxz=-1) const;//!< Like #projectLine(det, double*, double*, double) except use StThreeVectorD for line direction and origin + /**@brief XYZ of a projected line to the FCS detector plane + + Get the STAR XYZ that corresponds to the intersection of the FCS plane and a line given by the direction of some azimuthal angle and polar angle. You can also specify the origin of the line in the global STAR XYZ coordinates. + + Note: if you choose the wrong detector for a given polar angle you will get the wrong projection so please use #projectTrackToEcal(), #projectTrackToHcal(), #projectTrackToEcalSMax(), or #projectTrackToHcalSMax() to take into account which polar angle goes to which detector. + + @param det detector id to project line to (needed for correct angle). + @param linedirection size 3 array indicating the direction of the line to project onto #det, first element x-direction, second element y-direction, third element z-direction + @param lineorigin size 3 array indication the origin of the line to project onto #det, first element is x-coordinate, second element is y-coordinate, third element is z-coordinate + @param zhowermax depth in z of the detector to project the line to. Any negative value will use #getShowerMaxZ() + */ + StThreeVectorD projectLine(int det, double* linedirection, double* lineorigin, double showermaxz=-1) const; + private: int mDbAccess=1; //! enable(1) or disabe(0) DB access int mRun=0; //! run# diff --git a/StRoot/StFcsDbMaker/StFcsDbMaker.cxx b/StRoot/StFcsDbMaker/StFcsDbMaker.cxx index 7478d95a523..0d74fc1a3a5 100644 --- a/StRoot/StFcsDbMaker/StFcsDbMaker.cxx +++ b/StRoot/StFcsDbMaker/StFcsDbMaker.cxx @@ -250,9 +250,8 @@ int StFcsDbMaker::InitRun(int runNumber) { }else{ mFcsDb->setFcsPresValley((fcsPresValley_st*) dbFcsPresValley->GetTable()); } - - mFcsDb->InitRun(runNumber); } + mFcsDb->InitRun(runNumber); return kStOK; } diff --git a/StRoot/StFcsFastSimulatorMaker/macro/runSimBfc.C b/StRoot/StFcsFastSimulatorMaker/macro/runSimBfc.C index 727f5642a36..7dcf7696125 100644 --- a/StRoot/StFcsFastSimulatorMaker/macro/runSimBfc.C +++ b/StRoot/StFcsFastSimulatorMaker/macro/runSimBfc.C @@ -5,8 +5,10 @@ TString input_chain = "sdt20211025.120000,fzin,geant,FieldOn,logger,MakeEvent,fc class StFmsSimulatorMaker; -void runSimBfc( Int_t nEvents=1000, Int_t run=1, const char* pid="jet", int TrgVersion=202207, - int debug=0, int e=0, float pt=1.5, float vz=0.0, +void runSimBfc( Int_t nEvents=1000, Int_t run=1, const char* pid="jet", + int e=0, float pt=1.5, float vz=0.0, + int TrgVersion=202209, + int debug=3, char* epdmask="0.0100", int leakyHcal=0, int eventDisplay=0, @@ -82,7 +84,7 @@ void runSimBfc( Int_t nEvents=1000, Int_t run=1, const char* pid="jet", int TrgV fcsTrgSim->setSimMode(1); fcsTrgSim->setTrigger(TrgVersion); fcsTrgSim->setDebug(debug); - fcsTrgSim->setEtGain(1.0); //ET match + fcsTrgSim->setEtGain(1.0); //ET match //fcsTrgSim->setEtGain(0.5); //halfway //fcsTrgSim->setEtGain(0.0); //E match //fcsTrgSim->setReadPresMask(Form("mask/fcs_ecal_epd_mask.ele.pt0.6.vz0.thr%s.txt",epdmask)); diff --git a/StRoot/StFcsWaveformFitMaker/PeakAna.cxx b/StRoot/StFcsWaveformFitMaker/PeakAna.cxx index 5d69cd7fadf..535a433f898 100644 --- a/StRoot/StFcsWaveformFitMaker/PeakAna.cxx +++ b/StRoot/StFcsWaveformFitMaker/PeakAna.cxx @@ -487,12 +487,14 @@ PeakAna* PeakAna::MeanFilter( Int_t sizeavgs, bool copy ) } } ynew[ipoint] = sumvalues/sumweights; + if( GetDebug()>2 ){ std::cout << " - |i:"<ForceInternal(); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Copied PeakAna" << std::endl; } return ana; } if( mInternalSignal ){ @@ -501,11 +503,13 @@ PeakAna* PeakAna::MeanFilter( Int_t sizeavgs, bool copy ) //[July 3, 2022]>Taken from TGraph CtorAllocate(). Setting minimum and maximum to -1111 effectivley resets the minimum and maximum. GetData()->SetMinimum(-1111); GetData()->SetMaximum(-1111); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Internal Graph Modified" << std::endl; } } else{ TGraph* graph = new TGraph(npoints,xdata,ynew ); SetData(graph); ForceInternal(); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Created New Internal Graph" << std::endl; } } ResetPeak(); return this; @@ -578,6 +582,7 @@ PeakAna* PeakAna::GausFilter( Int_t sizeavgs, bool copy ) else{ sumweights += 2; } } ynew[ipoint] = sumvalues/sumweights; + if( GetDebug()>2 ){ std::cout << " - |i:"<ForceInternal(); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Copied PeakAna" << std::endl; } return ana; } if( mInternalSignal ){ @@ -593,11 +599,13 @@ PeakAna* PeakAna::GausFilter( Int_t sizeavgs, bool copy ) //[July 3, 2022]>Taken from TGraph CtorAllocate(). Setting minimum and maximum to -1111 effectivley resets the minimum and maximum. GetData()->SetMinimum(-1111); GetData()->SetMaximum(-1111); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Internal Graph Modified" << std::endl; } } else{ TGraph* graph = new TGraph(npoints,xdata,ynew ); SetData(graph); ForceInternal(); + if( GetDebug()>1 ){ std::cout << "PeakAna::MeanFilter:Created New Internal Graph" << std::endl; } } ResetPeak(); return this; @@ -673,12 +681,14 @@ void PeakAna::GetPossiblePeaks() //Check above will skip bad values if( peak.mStartX1 ){LOG_DEBUG << " + No StartTime" << endm;} - if( LY>baseline+slopecutoff && Slope>0 ){ - //Needs to be checked sequentially since we need to reject any points below the baseline+cutoff that may have a large slope - if( GetDebug()>1 ){LOG_DEBUG << " + Passed Slope and baselineCutoff setting as start time" << endm;} - peak.mStartX=LX;//Set start x-value - peak.mStartY=LY;//Set start y-value - LocalMax=LX;//Start checking local maximums + if( Slope>0){ + if( LY>baseline+slopecutoff || RY>baseline+slopecutoff ){ + //Needs to be checked sequentially since we need to reject any points below the baseline+cutoff that may have a large slope + if( GetDebug()>1 ){LOG_DEBUG << " + Passed Slope and baselineCutoff setting as start time" << endm;} + peak.mStartX=LX;//Set start x-value + peak.mStartY=LY;//Set start y-value + LocalMax=LX;//Start checking local maximums + } } //If didn't pass thresholds for start time then continue to next point } diff --git a/StRoot/StFcsWaveformFitMaker/PeakAna.h b/StRoot/StFcsWaveformFitMaker/PeakAna.h index db6f420e587..d1c66b93ba2 100644 --- a/StRoot/StFcsWaveformFitMaker/PeakAna.h +++ b/StRoot/StFcsWaveformFitMaker/PeakAna.h @@ -1,5 +1,8 @@ /* Author: David Kapukchyan +@[October 20, 2022] +> Added doxygen style comments + @[September 29, 2022] > Got rid of the virtual painter as it is no longer needed @@ -86,7 +89,6 @@ There is a helper data class #PeakWindow which holds the found peak data. //Custom Headers #include "PeakWindow.h" -//#include "PeakAnaVirtualPainter.h" class PeakAnaPainter; class PeakAna : public TObject @@ -192,13 +194,16 @@ class PeakAna : public TObject peak qa drawing options(case insensitive):\n - "R" for range\n - "B" for baselines\n - - "F" found peak qa\n - - "P" for full peak qa\n - - "A" for all, which combines "P" and "B"\n - stats drawing options(case insensitive):\n + - "F" found peak window\n + - "P" for all peak windows\n + - "M" for found peak marker\n + - "W" for all peak markers (upside down M)\n + - "E" combines "P" and "W"\n + - "A" for all, which combines "B", "P", and "W"\n + stats drawing options(case insensitive):\n - "S" is to show just the found peak\n - "A" is to show for all peaks\n - - "D" is whether to show detailed printout or not (works with option "S" or "A") + - "D" is whether to show detailed printout or not (works with option "S" or "A")\n Example1: "APL;FB;S" means draw graph using option "APL", draw only found peak qa and baselines, and create a stats box showing only basic information about the found peak. Example2: ";A;AD" means don't draw graph but draw all peaks and put detailed information of all peaks in a stats box diff --git a/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.cxx b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.cxx index 91922437e12..74ceb97058c 100644 --- a/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.cxx +++ b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.cxx @@ -80,8 +80,10 @@ void PeakAnaPainter::Paint(Option_t* opt) bool drawgraph = true; bool region = false; bool drawbaselines = false; - bool drawfoundpeakqa = false; - bool drawfullpeakqa = false; + bool drawfoundpeakrange = false; + bool drawallpeakranges = false; + bool drawfoundmarker = false; + bool drawallmarkers = false; std::size_t firstcolon = option.find(";"); if( firstcolon!=std::string::npos ){ @@ -99,19 +101,22 @@ void PeakAnaPainter::Paint(Option_t* opt) mPeakOption.ToLower(); if( mGraphOption.Length()==0 ){ drawgraph=false; } - //if( peakopts.Contains("e") ){ drawgraph=false; } if( mPeakOption.Contains("r") ){ region=true; } if( mPeakOption.Contains("b") ){ drawbaselines=true; } - if( mPeakOption.Contains("f") ){ drawfoundpeakqa=true; } - if( mPeakOption.Contains("p") ){ drawfullpeakqa=true; } - if( mPeakOption.Contains("a") ){ drawbaselines=true; drawfullpeakqa=true; } + if( mPeakOption.Contains("f") ){ drawfoundpeakrange=true; } + if( mPeakOption.Contains("p") ){ drawfoundpeakrange=true; drawallpeakranges=true; } + if( mPeakOption.Contains("m") ){ drawfoundmarker=true; } + if( mPeakOption.Contains("w") ){ drawfoundmarker=true; drawallmarkers=true; } + if( mPeakOption.Contains("e") ){ drawfoundpeakrange=true; drawallpeakranges=true; drawfoundmarker=true; drawallmarkers=true; } + if( mPeakOption.Contains("a") ){ drawbaselines=true; drawfoundpeakrange=true; drawallpeakranges=true; drawfoundmarker=true; drawallmarkers=true; } - if( drawfoundpeakqa && drawfullpeakqa ){ drawfoundpeakqa=false; }//Redundant to do both found and all peaks if( drawgraph ) { this->PaintRawData(); } if( region && drawgraph ) { this->PaintFoundPeak(); } //Doesn't make sense to restrict graph range if graph is not being drawn if( drawbaselines ) { this->PaintBaselines(); } - if( drawfoundpeakqa ) { this->PaintFoundPeakQa(); } - if( drawfullpeakqa ) { this->PaintPeakRanges(); } + if( drawfoundpeakrange ) { this->PaintFoundPeakRange(); } + if( drawallpeakranges ) { this->PaintPeakRanges(); } + if( drawfoundmarker ) { this->PaintFoundMarker(); } + if( drawallmarkers ) { this->PaintPeakMarkers(); } if( mStatsOption.Length()!=0 ) { this->PaintStats(); } } @@ -143,37 +148,11 @@ void PeakAnaPainter::PaintRawData( ) void PeakAnaPainter::PaintFoundPeak( ) { if( !ValidGraph()){return;} - Double_t Xmin = mPA->PeakStart(); Double_t Xmax = mPA->PeakEnd(); if( !(Xmin>mPA->MaxX() || Xmax>mPA->MaxX()) ){mPA->GetData()->GetXaxis()->SetRangeUser(Xmin-5,Xmax+5);} } -void PeakAnaPainter::PaintFoundPeakQa() -{ - if( !ValidGraph() ){return;} - - Int_t computedindex = mPA->FoundPeakIndex(); - if( computedindex<0 ){ computedindex = mPA->AnalyzeForPeak(); } - this->PaintBaselines(); - this->PaintFoundRange(); - - return; -} - -void PeakAnaPainter::PaintPeakQa( ) -{ - if( !ValidGraph() ){return;} - - Int_t computedindex = mPA->FoundPeakIndex(); - if( computedindex<0 ){computedindex = mPA->AnalyzeForPeak();} - - this->PaintBaselines(); - this->PaintPeakRanges(); - - return; -} - void PeakAnaPainter::PaintBaselines() { Double_t base = mPA->Baseline(); @@ -189,8 +168,9 @@ void PeakAnaPainter::PaintBaselines() mTheHitLine->Paint(); } -void PeakAnaPainter::PaintFoundRange() +void PeakAnaPainter::PaintFoundPeakRange() { + if( !ValidGraph() ){return;} Int_t computedindex = mPA->FoundPeakIndex(); if( computedindex<0 ){computedindex = mPA->AnalyzeForPeak();} if( computedindex == mPA->NPeaks() ){return;}//If no peak found then computed index is equal to number of peaks in peak vector @@ -198,17 +178,15 @@ void PeakAnaPainter::PaintFoundRange() TLine* sl = mPA->GetPeak(computedindex).GetStartLine(mPA->MinY(),mPA->MaxY()); sl->SetLineColor(kRed); sl->Paint(); - TMarker* mp = mPA->GetPeak(computedindex).GetPeakMarker(); - mp->SetMarkerColor(kViolet); - mp->SetMarkerSize(mPA->GetMarkerSize()*2.0); - mp->Paint(); TLine* el = mPA->GetPeak(computedindex).GetEndLine(mPA->MinY(),mPA->MaxY()); el->SetLineColor(kOrange); el->Paint(); } + void PeakAnaPainter::PaintPeakRanges( ) { + if( !ValidGraph() ){return;} Int_t computedindex = mPA->FoundPeakIndex(); if(computedindex<0 ){computedindex = mPA->AnalyzeForPeak();} @@ -226,11 +204,37 @@ void PeakAnaPainter::PaintPeakRanges( ) mp->Paint(); mPA->GetPeak(ipeak).GetEndLine( mPA->MinY(), mPA->MaxY() )->Paint(); } - this->PaintFoundRange(); return; } +void PeakAnaPainter::PaintFoundMarker() +{ + if( !ValidGraph() ){return;} + Int_t computedindex = mPA->FoundPeakIndex(); + if( computedindex<0 ){computedindex = mPA->AnalyzeForPeak();} + if( computedindex == mPA->NPeaks() ){return;}//If no peak found then computed index is equal to number of peaks in peak vector + + TMarker* mp = mPA->GetPeak(computedindex).GetPeakMarker(); + mp->SetMarkerColor(kViolet); + mp->SetMarkerSize(mPA->GetMarkerSize()*2.0); + mp->Paint(); +} + +void PeakAnaPainter::PaintPeakMarkers() +{ + if( !ValidGraph() ){return;} + Int_t computedindex = mPA->FoundPeakIndex(); + if(computedindex<0 ){computedindex = mPA->AnalyzeForPeak();} + + for( UShort_t ipeak = 0; ipeakNPeaks(); ++ipeak ){ + if( ipeak==computedindex ){continue;} + TMarker* mp = mPA->GetPeak(ipeak).GetPeakMarker(); + mp->SetMarkerSize(mPA->GetMarkerSize()*2.0); + mp->Paint(); + } +} + void PeakAnaPainter::PaintStats() { //@[April 8, 2022]>Need a way to determine size of pavetext from number of peaks as well as information to be added for each peak (this could be as simple as counting the number of lines and scaling the size accordingly) diff --git a/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h index ed4bc96d3c4..8ae820aedfa 100644 --- a/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h +++ b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h @@ -1,5 +1,8 @@ /* Author: David Kapukchyan +@[July 5, 2023] +> Modified paint functions to only paint certain things and added options to select what to paint + @[October 20, 2022] > Added doxygen style comments @@ -46,21 +49,21 @@ Painter class for PeakAna class PeakAna; -class PeakAnaPainter +class PeakAnaPainter : public TObject { public: PeakAnaPainter(); virtual ~PeakAnaPainter(); virtual void Paint(Option_t *opt=""); - virtual void PaintRawData(); //!< Raw data with no modifications - virtual void PaintFoundPeak(); //!< Raw data inside zoomed in on found signal region - virtual void PaintFoundPeakQa(); //!< Draw signal and found signal window - virtual void PaintPeakQa(); //!< Show all found signal windows and signal - virtual void PaintBaselines(); //!< Just draw the baseline and hitlines - virtual void PaintFoundRange(); //!< Just draw the found peak on the current pad - virtual void PaintPeakRanges(); //!< Draw all found peaks on the current pad - virtual void PaintStats(); //!< Draw Stats box for peak finding + virtual void PaintRawData(); //!< Raw data with no modifications + virtual void PaintFoundPeak(); //!< Raw data inside zoomed in on found signal region + virtual void PaintBaselines(); //!< Just draw the baseline and hitlines + virtual void PaintFoundPeakRange(); //!< Just draw the found peak on the current pad + virtual void PaintPeakRanges(); //!< Draw all found peaks on the current pad except the found peak + virtual void PaintFoundMarker(); //!< Draw the marker indicating the found peak + virtual void PaintPeakMarkers(); //!< Draw markers indicating all peaks except the found peak marker + virtual void PaintStats(); //!< Draw Stats box for peak finding virtual void CleanPainter(); //!< Clean up internal objects diff --git a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx index 643ae3d76a5..d2e01307dd0 100644 --- a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx +++ b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx @@ -98,6 +98,11 @@ StFcsWaveformFitMaker::StFcsWaveformFitMaker(const char* name) : StMaker(name) { mEnergySelect[1]=13; //default PulseFit2 for Hcal mEnergySelect[2]=1; //default sum8 for Pres + //Values to divide sum8 method to match the fitted result as determined by looking at data from Run 22 + mEnergySumScale[0] = 1.226; + mEnergySumScale[1] = 1.195; + mEnergySumScale[2] = 1.29; + mAnaWaveform = true; //default is to compute integral for the waveform for( UShort_t i=0; i<7; ++i ){ @@ -365,7 +370,7 @@ int StFcsWaveformFitMaker::InitRun(int runNumber) { } int StFcsWaveformFitMaker::Finish(){ - if(mFilename && mPad>=0){ + if( mFilename ){ char file[200]; sprintf(file,"%s.pdf]",mFilename); mCanvas->Print(file); @@ -505,8 +510,8 @@ int StFcsWaveformFitMaker::Make() { float gain = mDb->getGain(hits[i]); float gaincorr = mDb->getGainCorrection(hits[i]); hits[i]->setEnergy(integral*gain*gaincorr); - if(GetDebug()>0) printf("det=%1d id=%3d integ=%10.2f peak=%8.2f, sig=%8.4f chi2=%8.2f npeak=%2d\n", - det,hits[i]->id(),integral,res[2],res[3],res[4],int(res[5])); + if(GetDebug()>0){ printf("det=%1d id=%3d integ=%10.2f peak=%8.2f, sig=%8.4f chi2=%8.2f npeak=%2d ped=%8.2f pedrms=%4.2f\n", + det,hits[i]->id(),integral,res[2],res[3],res[4],int(res[5]),res[6],res[7]); } if(mMeasureTime){ auto stop=std::chrono::high_resolution_clock::now(); long long usec = chrono::duration_cast(stop-start).count(); @@ -775,6 +780,7 @@ float StFcsWaveformFitMaker::sum8(TGraphAsymmErrors* g, float* res){ } } //res[0]/=1.226; //Compensate for fitting sum in ECal. Only turn on for testing comparisons + if( fabs(res[7]) > 0.000001 ){ sum -= res[6]*8; }//pedestal subtraction for sum8. 8 timebi sum, so pedestal*8 is integrated sum of pedestal. res[0]=sum; if(sum>0) res[2]=tsum/sum; return sum; @@ -795,6 +801,7 @@ float StFcsWaveformFitMaker::sum16(TGraphAsymmErrors* g, float* res){ tsum += a[i] * tb; } } + if( fabs(res[7]) > 0.000001 ){ sum -= res[6]*16; }//pedestal subtraction for sum16. 16 timebin sum, so pedestal*16 is integrated sum of pedestal. res[0]=sum; if(sum>0) res[2]=tsum/sum; return sum; @@ -819,12 +826,14 @@ float StFcsWaveformFitMaker::highest(TGraphAsymmErrors* g, float* res){ } } //! https://www.star.bnl.gov/protected/spin/akio/fcs/pulse/waveformRes.png + if( fabs(res[7]) > 0.000001 ){ maxadc -= res[6]; }//pedestal subtraction for highest. res[0]=maxadc / 0.2; //this is estimated "full integral" res[1]=maxadc; //this is peak height res[2]=maxtb; //this is peak position [timebin] //res[3]=0.0; //no width from this method //res[4]=0.0; //no chi2 from this - //res[5]=0.0; //no # of peaks + //res[5]=0.0; //no # of peaks + return maxadc; //this is the highest } @@ -854,6 +863,7 @@ float StFcsWaveformFitMaker::highest3(TGraphAsymmErrors* g, float* res){ } } //! https://www.star.bnl.gov/protected/spin/akio/fcs/pulse/waveformRes.png + if( fabs(res[7]) > 0.000001 ){ sum -= res[6]*3; }//pedestal subtraction for highest3. Since 3 timebin sum pedestal*3 is integrated pedestal res[0]= sum / 0.555; //this is estimated "full integral" res[1]= maxadc; //this is peak height if(sum>0) res[2]= tsum/sum; //this is averaged peak position [timebin] @@ -922,14 +932,15 @@ float StFcsWaveformFitMaker::gausFit(TGraphAsymmErrors* g, float* res, TF1*& fun } } - //For comparing with pulse fit analysis class - if( mPulseFit==0 ){mPulseFit = new StFcsPulseAna(g); SetupDavidFitterMay2022(); }//Setup only needs to be called once as those values will not get reset when data changes. - else{ mPulseFit->SetData(g); } - Int_t compidx = mPulseFit->FoundPeakIndex(); + Int_t compidx = -1; int myNpeaks = -1; int npeakidx = -1; int mypeakidx = -1; if( mTest==2 || mTest==8 ){ + //For comparing with pulse fit analysis class + if( mPulseFit==0 ){mPulseFit = new StFcsPulseAna(g); SetupDavidFitterMay2022(); }//Setup only needs to be called once as those values will not get reset when data changes. + else{ mPulseFit->SetData(g); } + compidx = mPulseFit->FoundPeakIndex(); mH1_NPeaksAkio->Fill(npeak); if( trgx>=0 ){ mH1_NPeaksFilteredAkio->Fill(npeak); }//peaks inside triggered crossing if( mTest==2 ){ @@ -1012,9 +1023,8 @@ float StFcsWaveformFitMaker::gausFit(TGraphAsymmErrors* g, float* res, TF1*& fun return res[0]; } -void StFcsWaveformFitMaker::drawFit(TGraphAsymmErrors* g, TF1* func){ +void StFcsWaveformFitMaker::drawFit(TGraphAsymmErrors* gg, TF1* func){ const int MAXPAD=4*4; - TGraphAsymmErrors* gg = getGraph(); if(gg==0){ LOG_WARN<<"Found no TGraphAsymmErrors at mHitIdx="<DrawCopy("LP;A",post,gg);//Sets 'kCanDelete' so canvas will delete the copy - ana->GetData()->SetLineColor(kBlue); - ana->GetData()->SetMarkerStyle(kBlue); - ana->GetData()->SetMarkerStyle(4); - ana->GetData()->SetMarkerSize(0.5); + ana->SetLineColor(kBlue); + ana->SetMarkerColor(kBlue); + ana->SetMarkerStyle(4); + ana->SetMarkerSize(0.5); } if(mPad==MAXPAD){ @@ -1081,7 +1091,7 @@ void StFcsWaveformFitMaker::drawCh(UInt_t detid, UInt_t ch) const if( id>=0 && id==static_cast(ch) ){ ggdraw->Draw("APL"); ggdraw->SetLineColor(kBlack); - ggdraw->SetMarkerStyle(kBlack); + ggdraw->SetMarkerColor(kBlack); ggdraw->SetMarkerStyle(4); ggdraw->SetMarkerSize(0.5); ggdraw->GetXaxis()->SetTitle("timebin"); @@ -1092,9 +1102,9 @@ void StFcsWaveformFitMaker::drawCh(UInt_t detid, UInt_t ch) const StFcsDb::getFromName(ggdraw->GetName(),det,ch); char post[50]; sprintf(post,"_D%dC%d",det,ch); - StFcsPulseAna* ana = mPulseFit->DrawCopy("LP;P",post,ggdraw);//Sets 'kCanDelete' so an external canvas will delete this object when "Clear" is called + StFcsPulseAna* ana = mPulseFit->DrawCopy("LP;E",post,ggdraw);//Sets 'kCanDelete' so an external canvas will delete this object when "Clear" is called ana->GetData()->SetLineColor(kBlue); - ana->GetData()->SetMarkerStyle(kBlue); + ana->GetData()->SetMarkerColor(kBlue); ana->GetData()->SetMarkerStyle(4); ana->GetData()->SetMarkerSize(0.5); //ana->ResetPeak(); @@ -1121,15 +1131,15 @@ void StFcsWaveformFitMaker::drawDualFit(UInt_t detid, UInt_t ch) ggdraw->SetTitle(post); ggdraw->Draw("APL"); ggdraw->SetLineColor(kBlack); - ggdraw->SetMarkerStyle(kBlack); + ggdraw->SetMarkerColor(kBlack); ggdraw->SetMarkerStyle(4); ggdraw->SetMarkerSize(0.5); ggdraw->GetXaxis()->SetTitle("timebin"); ggdraw->GetYaxis()->SetTitle("ADC"); if( mPulseFit!=0 ){ - StFcsPulseAna* ana = mPulseFit->DrawCopy("LP;P",post,ggdraw);//Sets 'kCanDelete' so an external canvas will delete this object when "Clear" is called + StFcsPulseAna* ana = mPulseFit->DrawCopy("LP;E",post,ggdraw);//Sets 'kCanDelete' so an external canvas will delete this object when "Clear" is called ana->GetData()->SetLineColor(kBlue); - ana->GetData()->SetMarkerStyle(kBlue); + ana->GetData()->SetMarkerColor(kBlue); ana->GetData()->SetMarkerStyle(4); ana->GetData()->SetMarkerSize(0.5); Int_t compidx = ana->FoundPeakIndex(); @@ -1190,7 +1200,7 @@ void StFcsWaveformFitMaker::drawDualFit(UInt_t detid, UInt_t ch) } float StFcsWaveformFitMaker::gausFitWithPed(TGraphAsymmErrors* g, float* res, TF1*& func){ - AnaPed( g, res[6], res[7] ); + if( fabs(res[7]) < 0.000001 ){AnaPed( g, res[6], res[7] ); } //Only call AnaPed if pedestal hasn't already been calculated and stored in res. res[7] will be nonzero only if AnaPed was already called. LOG_DEBUG << "Pedestal ("<GetPeak(compidx).mPeakY; res[2] = mPulseFit->GetPeak(compidx).mPeakX; res[3] = mDbPulse->GSigma(); @@ -1404,9 +1438,9 @@ float StFcsWaveformFitMaker::PulseFit1(TGraphAsymmErrors* gae, float* res, TF1*& else{//Don't need to fit as other peaks don't contribute to found peak res[0] = sum8(gae,res); //Scale sum8 to match fitted sum (These may need to be confirmed by data year by year) - if( det0==0 || det0==1 ){res[0]/=1.226;} - if( det0==2 || det0==3 ){res[0]/=1.195;} - if( det0==4 || det0==5 ){res[0]/=1.29;} + if( det0==0 || det0==1 ){res[0]/=mEnergySumScale[0];} + if( det0==2 || det0==3 ){res[0]/=mEnergySumScale[1];} + if( det0==4 || det0==5 ){res[0]/=mEnergySumScale[2];} res[1] = mPulseFit->GetPeak(compidx).mPeakY; res[2] = mPulseFit->GetPeak(compidx).mPeakX; res[3] = mDbPulse->GSigma(); @@ -1488,9 +1522,9 @@ float StFcsWaveformFitMaker::PulseFit2(TGraphAsymmErrors* gae, float* res, TF1*& //else if( npeaks<=1 ){ res[0] = sum8(gae,res); //Scale sum8 to match fitted sum (These may need to be confirmed by data year by year) - if( det0==0 || det0==1 ){res[0]/=1.226;} - if( det0==2 || det0==3 ){res[0]/=1.195;} - if( det0==4 || det0==5 ){res[0]/=1.29;} + if( det0==0 || det0==1 ){res[0]/=mEnergySumScale[0];} + if( det0==2 || det0==3 ){res[0]/=mEnergySumScale[1];} + if( det0==4 || det0==5 ){res[0]/=mEnergySumScale[2];} res[1] = mPulseFit->GetPeak(compidx).mPeakY; res[2] = mPulseFit->GetPeak(compidx).mPeakX; res[3] = mDbPulse->GSigma(); @@ -1529,9 +1563,9 @@ float StFcsWaveformFitMaker::PulseFit2(TGraphAsymmErrors* gae, float* res, TF1*& else{//Don't need to fit as other peaks don't contribute to found peak res[0] = sum8(gae,res); //Scale sum8 to match fitted sum (These may need to be confirmed by data year by year) - if( det0==0 || det0==1 ){res[0]/=1.226;} - if( det0==2 || det0==3 ){res[0]/=1.195;} - if( det0==4 || det0==5 ){res[0]/=1.29;} + if( det0==0 || det0==1 ){res[0]/=mEnergySumScale[0];} + if( det0==2 || det0==3 ){res[0]/=mEnergySumScale[1];} + if( det0==4 || det0==5 ){res[0]/=mEnergySumScale[2];} res[1] = mPulseFit->GetPeak(compidx).mPeakY; res[2] = mPulseFit->GetPeak(compidx).mPeakX; res[3] = mDbPulse->GSigma(); @@ -1614,9 +1648,9 @@ float StFcsWaveformFitMaker::PulseFitAll(TGraphAsymmErrors* gae, float* res, TF1 if( compidx==npeaks || npeaks==0 ){ res[0] = sum8(gae,res); //Scale sum8 to match fitted sum (These may need to be confirmed by data year by year) - if( det0==0 || det0==1 ){res[0]/=1.226;} - if( det0==2 || det0==3 ){res[0]/=1.195;} - if( det0==4 || det0==5 ){res[0]/=1.29;} + if( det0==0 || det0==1 ){res[0]/=mEnergySumScale[0];} + if( det0==2 || det0==3 ){res[0]/=mEnergySumScale[1];} + if( det0==4 || det0==5 ){res[0]/=mEnergySumScale[2];} res[1] = mPulseFit->Baseline()+mPulseFit->BaselineSigma()*mPulseFit->BaselineSigmaScale(); res[2] = mCenterTB; res[3] = mDbPulse->GSigma(); @@ -1645,13 +1679,13 @@ float StFcsWaveformFitMaker::PulseFitAll(TGraphAsymmErrors* gae, float* res, TF1 float StFcsWaveformFitMaker::PulseFit2WithPed(TGraphAsymmErrors* gae, float* res, TF1*& func) { - AnaPed(gae,res[6],res[7]); + if( fabs(res[7]) < 0.000001 ){AnaPed( gae, res[6], res[7] ); } //Only call AnaPed if pedestal hasn't already been calculated and stored in res. res[7] will be nonzero only if AnaPed was already called. return PulseFit2(gae,res,func,res[6]); } float StFcsWaveformFitMaker::PulseFitAllWithPed(TGraphAsymmErrors* gae, float* res, TF1*& func) { - AnaPed(gae,res[6],res[7]); + if( fabs(res[7]) < 0.000001 ){AnaPed( gae, res[6], res[7] ); } //Only call AnaPed if pedestal hasn't already been calculated and stored in res. res[7] will be nonzero only if AnaPed was already called. return PulseFitAll(gae,res,func,res[6]); } diff --git a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h index a27d71a186e..8ddf41dac7f 100644 --- a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h +++ b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h @@ -77,7 +77,8 @@ class StFcsWaveformFitMaker : public StMaker { void setDebug(int v=1) {SetDebug(v);} void setTest(int v); //!< Set test level. Intended to be used for single files. Output file name can be changed with #writeFile(), see #mTest for meaning of values - void setEnergySelect(int ecal=10, int hcal=10, int pres=1) {mEnergySelect[0]=ecal; mEnergySelect[1]=hcal; mEnergySelect[2]=pres;} + void setEnergySelect(int ecal=13, int hcal=13, int pres=1) {mEnergySelect[0]=ecal; mEnergySelect[1]=hcal; mEnergySelect[2]=pres;} + void setEnergySumScale(double ecal=1.0, double hcal=1.0, double pres=1.0) {mEnergySumScale[0]=ecal; mEnergySumScale[1]=hcal; mEnergySumScale[2]=pres;} void setCenterTimeBins(int v, int min=0, int max=512) {mCenterTB=v; mMinTB=min; mMaxTB=max;} void setAdcSaturation(int v) {mAdcSaturation=(double)v;} void setError(double v) {mError=v;} @@ -134,7 +135,10 @@ class StFcsWaveformFitMaker : public StMaker { - 11 = Figure out pedestal and do a Gaussian fit, #gausFitWithPed() - 12 = Use #StFcsPulseAna to find peaks and fit to Gaussian except those peaks from #PeakCompare=0, #PulseFit1() - 13 = Use #StFcsPulseAna to find peaks and fit to Gaussian those peaks from #NPeaksPrePost, #PulseFit2() - - 14 = Use #StFcsPulseAna to find peaks and fit all found peaks to Gaussian, #PulseFitAll() + - 14 = Use #StFcsPulseAna to find peaks and fit all found peaks to Gaussian, #PulseFitAll() + - 15 = Compute pedestal using #AnaPed() then call #PulseFit2(), #PulseFit2WithPed() + - 16 = Compute pedestal using #AnaPed() then call #PulseFitAll(), #PulseFitAllWithPed() + - 17 = Find pedestal by making a histogram of ADC values and then doing a Gaussian fit to the histogram and use the mean as the pedestal value, #StFcsPulseAna::AnalyzeForPedestal(), then call #PulseFitAll(), #PedFitPulseFit() @param g TGraphAsymmErrors data to use in the analysis method @param res array of determined values from analysis method, max is 8 @@ -261,10 +265,11 @@ class StFcsWaveformFitMaker : public StMaker { void drawDualFit(UInt_t detid, UInt_t ch); void printArray() const; //!< Print contents of #mChWaveData, excluding timebin and adc information + void printSetup() const; //!< Print contents of internal variables protected: TClonesArray mChWaveData; //!< Contains all graph data - void drawFit(TGraphAsymmErrors* g, TF1* func); //!< Draw a single TGraph + void drawFit(TGraphAsymmErrors* gg, TF1* func); //!< Draw a single TGraph StFcsPulseAna* mPulseFit; //!< Pointer to peak finder used by some analysis methods /**@brief Variable to use when testing #StFcsWaveformFitMaker algorithms @@ -359,6 +364,7 @@ class StFcsWaveformFitMaker : public StMaker { char *mMeasureTime=0; //!< output file for measuring fitting time int mEnergySelect[3]; //!< 0=MC (straight from dE), >0 see #analyzeWaveform() + double mEnergySumScale[3]; //!< Amount to divide sum8 method sum to match fitted sum for each detector (0=ecal,1=hcal,2=preshower). This may need to be determined year by year by running test level 6 and running the corresponding macro bool mAnaWaveform; //!< if true (default) call #anlayzeWaveform() to integrate the waveform data, if false read integral from StFcsHit and only recompute energy using gain, and gain correction factors int mCenterTB=50; //!< center timebin for triggered crossing int mMinTB=0; //!< center timebin for triggered crossing diff --git a/StRoot/StFcsWaveformFitMaker/macros/Plot6.cc b/StRoot/StFcsWaveformFitMaker/macros/Plot6.cc new file mode 100644 index 00000000000..93e1086a87e --- /dev/null +++ b/StRoot/StFcsWaveformFitMaker/macros/Plot6.cc @@ -0,0 +1,291 @@ +/* + Author:David Kapukchyan + @[August 26, 2022] + > First instance + + A macro to plot the results from testing the StFcsWaveformFitMaker methods using StFcsWaveformFitMaker set to test level 6. The "prefix" is to set the output save file names prefix. + + How to determine the sum8 vs. Fit scale factor. + + 1. Run StFcsWaveformFitMaker on a microdst file `root4star -b -q testWff6MuDst.C'(nevents,"OutFileName.root","InFile.MuDst.root")'` + - Before running check to make sure that the line that sets the energy sum scale reads *wff->setEnergySumScale(1.0,1.0,1.0)* + 2. Take output root file "OutFileName.root" and run this macro giving it the file name and a prefix for the saved image files + - `root -b -q Plot6.C'("OutFileName.root","TestScale1")'` + 3. Look at *TestScale1_sum8vfit.png* to check what values to scale by. slope of fitted line is the value to use + 4. Change the line in *testWff6MuDst.C* that sets the energy sum scale to the values you get from the slopes of the fit. + - *wff->setEnergySumScale(slopecal,slopehcal,slopepres)* + 5. Run StFcsWaveformFitMaker on the same microdst file with same number of events `root4star -b -q testWff6MuDst.C'(nevents,"OutFileNameNew.root","InFile.MuDst.root")'` + - You can change the output file name if you want + 6. Go to step 2 and repeat for new output file + +*/ + +//#include "Rtools.h" +//#include "HistColl2.h" + +void Plot6(std::string filename="test.root",std::string prefix="test") +{ + gStyle->SetOptStat(111111); + gStyle->SetOptDate(0); + + TFile* infile = TFile::Open(filename.c_str()); + if( infile==0 || infile->IsZombie() ){ std::cout << "ERROR:Unable to open: " << filename << std::endl; return 0; } + else{ std::cout << "Opened file:"<GetName() << std::endl; } + + TH1F* npeaks[7] = {0}; + TH1F* npeaksfiltered[7] = {0}; + TH1F* res0[7] = {0}; + TH1F* res0zoom[7] = {0}; + TH1F* sum8res0[7] = {0}; + TH1F* sum8res0zoom[7] = {0}; + TH1F* fitres0[7] = {0}; + TH1F* fitres0zoom[7] = {0}; + TH2F* sum8vfit[7] = {0}; + for( UInt_t i=0; i<7; ++i ){ + char name[100]; + + sprintf(name,"H1_NPeaks_%d",i); + npeaks[i] = (TH1F*)infile->Get(name); + npeaks[i]->SetTitle(";number of peaks"); + + sprintf(name,"H1_NPeaksFiltered_%d",i); + npeaksfiltered[i] = (TH1F*)infile->Get(name); + npeaksfiltered[i]->SetTitle(";number of peaks"); + + sprintf(name,"H1_Res0_%d",i); + res0[i] = (TH1F*)infile->Get(name); + res0[i]->SetTitle(";ADC sum"); + + sprintf(name,"H1_Res0Zoom_%d",i); + res0zoom[i] = (TH1F*)infile->Get(name); + res0zoom[i]->SetTitle(";ADC sum"); + + sprintf(name,"H1_Sum8Res0_%d",i); + sum8res0[i] = (TH1F*)infile->Get(name); + sum8res0[i]->SetTitle(";ADC sum"); + + sprintf(name,"H1_Sum8Res0Zoom_%d",i); + sum8res0zoom[i] = (TH1F*)infile->Get(name); + sum8res0zoom[i]->SetTitle(";ADC sum"); + + sprintf(name,"H1_FitRes0_%d",i); + fitres0[i] = (TH1F*)infile->Get(name); + fitres0[i]->SetTitle(";ADC sum"); + + sprintf(name,"H1_FitRes0Zoom_%d",i); + fitres0zoom[i] = (TH1F*)infile->Get(name); + fitres0zoom[i]->SetTitle(";ADC sum"); + + sprintf(name,"H2_Sum8vFit_%d",i); + sum8vfit[i] = (TH2F*)infile->Get(name); + sum8vfit[i]->SetTitle(";Sum8;FitSum"); + + res0[i] ->SetLineColor(kBlack); + sum8res0[i] ->SetLineColor(kBlue); + fitres0[i] ->SetLineColor(kGreen); + res0zoom[i] ->SetLineColor(kBlack); + sum8res0zoom[i]->SetLineColor(kBlue); + fitres0zoom[i] ->SetLineColor(kGreen); + res0[i] ->SetStats(0); + sum8res0[i] ->SetStats(0); + fitres0[i] ->SetStats(0); + res0zoom[i] ->SetStats(0); + sum8res0zoom[i]->SetStats(0); + fitres0zoom[i] ->SetStats(0); + } + res0[6]->SetTitle(""); + sum8res0[6]->SetTitle(""); + fitres0[6]->SetTitle(""); + res0zoom[6]->SetTitle(""); + sum8res0zoom[6]->SetTitle(""); + fitres0zoom[6]->SetTitle(""); + + //Rtools::HistColl1F* npeaks = new Rtools::HistColl1F(infile,"NPeaks",";number of peaks"); + //Rtools::HistColl1F* npeaksfiltered = new Rtools::HistColl1F(infile,"NPeaksFiltered",";number of peaks"); + //Rtools::HistColl1F* res0 = new Rtools::HistColl1F(infile,"Res0",";ADC sum"); + //Rtools::HistColl1F* res0zoom = new Rtools::HistColl1F(infile,"Res0Zoom", ";ADC sum"); + //Rtools::HistColl1F* sum8res0 = new Rtools::HistColl1F(infile,"Sum8Res0", ";ADC sum"); + //Rtools::HistColl1F* sum8res0zoom = new Rtools::HistColl1F(infile,"Sum8Res0Zoom",";ADC sum"); + //Rtools::HistColl1F* fitres0 = new Rtools::HistColl1F(infile,"FitRes0",";ADC sum"); + //Rtools::HistColl1F* fitres0zoom = new Rtools::HistColl1F(infile,"FitRes0Zoom",";ADC sum"); + + //Rtools::HistColl2F* sum8vfit = new Rtools::HistColl2F(infile,"Sum8vFit",";Sum8;FitSum"); + //sum8vfit->Print(); + + TH1F* timefit = (TH1F*)infile->Get("H1_TimeFitPulse"); + TH1F* measuretime = (TH1F*)infile->Get("FitTime"); + + int width = 1280; + int height = 960; + + //Rtools::DrawTools* dt0 = new Rtools::DrawTools("dt0","",width,height); + TCanvas* canv = new TCanvas("canv","",width,height); + npeaks[6]->SetTitle(""); + npeaks[6]->SetStats(0); + npeaks[6]->GetXaxis()->SetTitle("Found number of peaks"); + npeaks[6]->Draw("hist e"); + canv->SaveAs( (prefix+"_Npeaks.png").c_str() ); + + canv->Clear(); + npeaksfiltered[6]->Draw("hist e"); + canv->SaveAs( (prefix+"_NpeaksFiltered.png").c_str() ); + + canv->Clear(); + canv->Divide(3,2); + for( UInt_t i=0; i<6; ++i ){ + canv->cd(i+1); + npeaks[i]->Draw("hist e"); + } + canv->SaveAs( (prefix+"_detNpeaks.png").c_str() ); + + canv->Clear(); + canv->Divide(3,2); + for( UInt_t i=0; i<6; ++i ){ + canv->cd(i+1); + npeaksfiltered[i]->Draw("hist e"); + } + canv->SaveAs( (prefix+"_detNpeaksFiltered.png").c_str() ); + + //Draw sum8 result, fitted result, and final result on top of each other + canv->Clear(); + //TPad* pad = dt0->DrawCanv(width,height); + canv->Divide(2,1); + canv->cd(1)->SetLogy(1); + res0[6]->Draw("hist e"); + res0[6]->GetXaxis()->SetTitle("Signal Integral"); + sum8res0[6]->Draw("hist e sames"); + fitres0[6]->Draw("hist e sames"); + canv->cd(2)->SetLogy(1); + res0zoom[6]->Draw("hist e"); + res0zoom[6]->GetXaxis()->SetTitle("Signal Integral"); + sum8res0zoom[6]->Draw("hist e sames"); + fitres0zoom[6]->Draw("hist e sames"); + TLegend* legres = 0;//new TLegend(0.5,0.5,0.99,0.99,"Sum Comparison","nbNDC"); + //Rtools::AddHistStats(legres,res0->At(6)); + //Rtools::AddHistStats(legres,sum8res0->At(6)); + //Rtools::AddHistStats(legres,fitres0->At(6)); + //legres->Draw(); + canv->SaveAs( (prefix+"_res0.png").c_str() ); + + canv->Clear(); + canv->Divide(3,2); + for( UInt_t i=0; i<6; ++i ){ + canv->cd(i+1)->SetLogy(1); + res0[i]->Draw("hist e"); + sum8res0[i]->Draw("hist e same"); + fitres0[i]->Draw("hist e same"); + } + canv->SaveAs( (prefix+"_detres0.png").c_str() ); + + canv->Clear(); + canv->Divide(3,2); + for( UInt_t i=0; i<6; ++i ){ + canv->cd(i+1)->SetLogy(1); + res0zoom[i]->Draw("hist e"); + sum8res0zoom[i]->Draw("hist e same"); + fitres0zoom[i]->Draw("hist e same"); + } + canv->SaveAs( (prefix+"_detres0zoom.png").c_str() ); + + //Draw just sum8 and fitted result on top of each other + canv->Clear(); + canv->Divide(2,1); + canv->cd(1)->SetLogy(1); + sum8res0[6]->Draw("hist e"); + sum8res0[6]->GetXaxis()->SetTitle("Signal Integral"); + fitres0[6]->Draw("hist e same"); + fitres0[6]->GetXaxis()->SetTitle("Signal Integral"); + canv->cd(2)->SetLogy(1); + sum8res0zoom[6]->Draw("hist e"); + sum8res0zoom[6]->GetXaxis()->SetTitle("Signal Integral"); + fitres0zoom[6]->Draw("hist e same"); + fitres0zoom[6]->GetXaxis()->SetTitle("Signal Integral"); + TLegend* legres2 = 0;//new TLegend(0.5,0.5,0.99,0.99,"Comparing Sum Methods","nbNDC"); + //Rtools::AddHistStats(legres2,sum8res0->At(6)); + //Rtools::AddHistStats(legres2,fitres0->At(6)); + //legres2->Draw(); + canv->SaveAs( (prefix+"_s8fit.png").c_str() ); + + canv->Clear(); + TF1* linfit[7] = {0}; + linfit[6] = new TF1("linfit","[0]+[1]*x",0,2000); + canv->SetLogz(1); + sum8vfit[6]->Fit(linfit[6]); + sum8vfit[6]->Draw("colz"); + canv->SaveAs( (prefix+"_sum8vfit.png").c_str() ); + + canv->Clear(); + canv->Divide(3,2); + for( UInt_t i=0; i<6; ++i ){ + linfit[i] = new TF1("linfit","[0]+[1]*x",0,2000); + canv->cd(i+1)->SetLogz(1); + sum8vfit[i]->Fit(linfit[i]); + sum8vfit[i]->Draw("colz"); + } + canv->SaveAs( (prefix+"_detsum8vfit.png").c_str() ); + + + canv->Clear(); + timefit->SetLineColor(kBlue); + timefit->GetXaxis()->SetRangeUser(0,100); + timefit->GetXaxis()->SetTitle("time (ms)"); + timefit->Draw("hist e"); + double timeintegral = timefit->Integral(1,timefit->GetNbinsX()); + gPad->Update();//h1 should be on the current pad otherwise won't work + TPaveStats* TPS_timefit = timefit->FindObject("stats"); + TPS_timefit->SetName("timefitstats"); + //TPaveStats* TPS_timefit = Rtools::GetStats(timefit,111111); + //std::cout<< "|TPS:"<GetName() << "|S:"<< TPS_timefit->GetListOfLines()->GetEntries() << std::endl; + timefit->SetStats(0); + std::stringstream ss_tinttext; + ss_tinttext << "Integral = " << timeintegral; + TLatex* ttimeint = new TLatex(0,0, ss_tinttext.str().c_str() ); + //ttimeint->SetTextFont(42); + ttimeint->SetTextSize(0.03); + TPS_timefit->GetListOfLines()->Add(ttimeint); + TPS_timefit->Draw(); + canv->SaveAs( (prefix+"_timefit.png").c_str() ); + + if( measuretime!=0 ){ + canv->Clear(); + canv->SetLogy(); + measuretime->SetLineColor(kBlue); + //measuretime->GetXaxis()->SetRangeUser(0,100); + measuretime->GetXaxis()->SetTitle("time (ms)"); + measuretime->Draw("hist e"); + double totaltime = measuretime->Integral(1,measuretime->GetNbinsX()); + gPad->Update();//h1 should be on the current pad otherwise won't work + TPaveStats* TPS_measuretime = measuretime->FindObject("stats"); + TPS_measuretime->SetName("measuretimestats"); + measuretime->SetStats(0); + std::stringstream ss_minttext; + ss_minttext << "Integral = " << totaltime; + TLatex* mtimeint = new TLatex(0,0, ss_minttext.str().c_str() ); + //mtimeint->SetTextFont(42); + mtimeint->SetTextSize(0.03); + TPS_measuretime->GetListOfLines()->Add(mtimeint); + TPS_measuretime->Draw(); + canv->SaveAs( (prefix+"_measuretime.png").c_str() ); + } + + /* + delete npeaks; + delete npeaksfiltered; + delete res0; + delete res0zoom; + delete sum8res0; + delete sum8res0zoom; + delete fitres0; + delete fitres0zoom; + delete sum8vfit; + delete timefit; + delete measuretime; + delete legres; + delete legres2; + */ + infile->Close(); + delete infile; + delete canv; + +} + diff --git a/StRoot/StFcsWaveformFitMaker/macros/testWff6MuDst.C b/StRoot/StFcsWaveformFitMaker/macros/testWff6MuDst.C new file mode 100644 index 00000000000..c570268a25e --- /dev/null +++ b/StRoot/StFcsWaveformFitMaker/macros/testWff6MuDst.C @@ -0,0 +1,84 @@ +/* + Orig Author: Akio Ogawa + Edited: David Kapukchyan + @[May 18, 2022](David Kapukchyan) + > Copied from $STAR/StRoot/StFcsFastSimulatorMaker/macros/runMudst.C and modified so that I can test my own StFcsWaveformFitMaker. + + Macro to run micro dst from fast production of FCS data for Run 22 data. +*/ + +void testWff(int nevt = 1, + const char* outdir="test.root", + const char* file="st_fwd_23080044_raw_1000019.MuDst.root", + int readMuDst=1 + ) +{ + gROOT->Macro("Load.C"); + gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C"); + gSystem->Load("StEventMaker"); + gSystem->Load("StFcsDbMaker"); + gSystem->Load("StFcsRawHitMaker"); + gSystem->Load("StFcsWaveformFitMaker"); + gSystem->Load("libMinuit"); + + //gMessMgr->SetLimit("I", 0); + //gMessMgr->SetLimit("Q", 0); + //gMessMgr->SetLimit("W", 0); + + gStyle->SetOptDate(0); + gStyle->SetOptFit(0); + + StChain* chain = new StChain("StChain"); chain->SetDEBUG(0); + StMuDstMaker* muDstMaker = new StMuDstMaker(0, 0, "", file,".", 1000, "MuDst"); + int n=muDstMaker->tree()->GetEntries(); + printf("Found %d entries in Mudst\n",n); + + St_db_Maker* dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb"); + if(dbMk){ + dbMk->SetAttr("blacklist", "tpc"); + dbMk->SetAttr("blacklist", "svt"); + dbMk->SetAttr("blacklist", "ssd"); + dbMk->SetAttr("blacklist", "ist"); + dbMk->SetAttr("blacklist", "pxl"); + dbMk->SetAttr("blacklist", "pp2pp"); + dbMk->SetAttr("blacklist", "ftpc"); + dbMk->SetAttr("blacklist", "emc"); + dbMk->SetAttr("blacklist", "eemc"); + dbMk->SetAttr("blacklist", "mtd"); + dbMk->SetAttr("blacklist", "pmd"); + dbMk->SetAttr("blacklist", "tof"); + dbMk->SetAttr("blacklist", "etof"); + dbMk->SetAttr("blacklist", "rhicf"); + } + + StFcsDbMaker *fcsDbMkr= new StFcsDbMaker(); + StFcsDb* fcsDb = (StFcsDb*) chain->GetDataSet("fcsDb"); + fcsDb->setReadGainCorrFromText(); + StFcsDbPulse* fcsDbPulse = (StFcsDbPulse*) chain->GetDataSet("fcsPulse"); + StEventMaker* eventMk = new StEventMaker(); + StFcsRawHitMaker* hit = new StFcsRawHitMaker(); + //hit->setDebug(); + hit->setReadMuDst(readMuDst); + StFcsWaveformFitMaker *wff= new StFcsWaveformFitMaker(); + wff->writeFile(outdir); + wff->setTest(6);//Sets energy select to proper value if not set already + wff->setEnergySumScale(1.0,1.0,1.0); + //wff->setMeasureTime("measure.png"); //Turn on if you want to measure the time for fitting + //wff->SetDebug(); //Turn on for debug output + + chain->Init(); + + TStopwatch clock; + //Event loop + for( UInt_t i=0; iMake(); + chain->Clear(); + } + std::cout << "========================================" << std::endl; + std::cout << clock.RealTime() << " seconds" << std::endl; + std::cout << "========================================" << std::endl; + + chain->Finish(); + delete chain; +} + diff --git a/StRoot/StFgtPool/StFgtQaMakers/StFgtPedStatQA.cxx b/StRoot/StFgtPool/StFgtQaMakers/StFgtPedStatQA.cxx index 998a7047e66..7648d0c158b 100644 --- a/StRoot/StFgtPool/StFgtQaMakers/StFgtPedStatQA.cxx +++ b/StRoot/StFgtPool/StFgtQaMakers/StFgtPedStatQA.cxx @@ -80,6 +80,7 @@ #include "StRoot/StFgtUtil/StFgtConsts.h" #include +#include #include #include #include diff --git a/StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx b/StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx index af418cde498..c47344cc4db 100644 --- a/StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx +++ b/StRoot/StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx @@ -66,6 +66,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect while ( !rawHitsVec[sensorIdx][phiIdx].empty() ) { rawHitTemp = rawHitsVec[sensorIdx][phiIdx].back(); + delete rawHitsVec[sensorIdx][phiIdx].back(); rawHitsVec[sensorIdx][phiIdx].pop_back(); rawHitsToMerge.push_back(rawHitTemp); //count number to merge @@ -77,6 +78,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect // put all raw hits in one phi strip to rawHitsToMerge while (rawHitsToMergePtr != rawHitsToMerge.end() && !rawHitsVec[sensorIdx][phiIdx].empty()) { rawHitTemp = rawHitsVec[sensorIdx][phiIdx].back(); + delete rawHitsVec[sensorIdx][phiIdx].back(); rawHitsVec[sensorIdx][phiIdx].pop_back(); ++nToMerge; @@ -137,14 +139,14 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect totCharge = tempSumCharge; totChargeErr = sqrt(tempSumChargeErrSquare / nToMerge); - newCluster = new StFstCluster((int)wedge * 10000 + clusterLabel, disk, wedge, sensor, apv, meanRStrip, meanPhiStrip, totCharge, totChargeErr, clusterType); - newCluster->setNRawHits(clusterSize); - newCluster->setNRawHitsR(clusterSizeR); - newCluster->setNRawHitsPhi(clusterSizePhi); - newCluster->setMaxTimeBin(maxTb); - newCluster->setIdTruth(idTruth); - if(nToSeedhit>0) { + newCluster = new StFstCluster((int)wedge * 10000 + clusterLabel, disk, wedge, sensor, apv, meanRStrip, meanPhiStrip, totCharge, totChargeErr, clusterType); + newCluster->setNRawHits(clusterSize); + newCluster->setNRawHitsR(clusterSizeR); + newCluster->setNRawHitsPhi(clusterSizePhi); + newCluster->setMaxTimeBin(maxTb); + newCluster->setIdTruth(idTruth); + clustersVec[sensorIdx][phiIdx].push_back(newCluster); clusterLabel++; } @@ -200,6 +202,7 @@ Int_t StFstScanRadiusClusterAlgo::doClustering(const StFstCollection &fstCollect (*clusterIt2)->setApv(apv); int distance1 = std::distance(clustersVec[sensorIdx][phiIdx1].begin(), clusterIt1); + delete *clusterIt1; clustersVec[sensorIdx][phiIdx1].erase(clusterIt1); if (distance1 == 0) diff --git a/StRoot/StFwdTrackMaker/StFwdTrackMaker.cxx b/StRoot/StFwdTrackMaker/StFwdTrackMaker.cxx index 12b0041872a..46d9313eb16 100644 --- a/StRoot/StFwdTrackMaker/StFwdTrackMaker.cxx +++ b/StRoot/StFwdTrackMaker/StFwdTrackMaker.cxx @@ -258,7 +258,7 @@ int StFwdTrackMaker::Finish() { mForwardTracker->finish(); - gDirectory = prevDir; + prevDir->cd(); if (mGenTree) { mTreeFile->cd(); @@ -299,6 +299,12 @@ int StFwdTrackMaker::Init() { mTree->Branch("fstZ", &mTreeData. fstZ ); mTree->Branch("fstTrackId", &mTreeData. fstTrackId ); + mTree->Branch("fcsN", &mTreeData. fcsN, "fcsN/I"); + mTree->Branch("fcsX", &mTreeData. fcsX ); + mTree->Branch("fcsY", &mTreeData. fcsY ); + mTree->Branch("fcsZ", &mTreeData. fcsZ ); + mTree->Branch("fcsDet", &mTreeData. fcsDet ); + // mc tracks mTree->Branch("mcN", &mTreeData. mcN, "mcN/I"); mTree->Branch("mcPt", &mTreeData. mcPt ); @@ -349,64 +355,65 @@ int StFwdTrackMaker::Init() { mTree->Branch("tprojPy", &mTreeData. tprojPy); mTree->Branch("tprojPz", &mTreeData. tprojPz); - std::string path = "TrackFinder.Iteration[0].SegmentBuilder"; std::vector paths = mFwdConfig.childrenOf(path); - for (string p : paths) { - string name = mFwdConfig.get(p + ":name", ""); - mTreeData.Crits[name]; // create the entry - mTree->Branch(name.c_str(), &mTreeData.Crits[name]); - mTree->Branch((name + "_trackIds").c_str(), &mTreeData.CritTrackIds[name]); + if (mTreeData.saveCrit){ + for (string p : paths) { + string name = mFwdConfig.get(p + ":name", ""); + mTreeData.Crits[name]; // create the entry + mTree->Branch(name.c_str(), &mTreeData.Crits[name]); + mTree->Branch((name + "_trackIds").c_str(), &mTreeData.CritTrackIds[name]); - if ( name == "Crit2_RZRatio" ){ - string n = name + "_x1"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + if ( name == "Crit2_RZRatio" ){ + string n = name + "_x1"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_y1"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_y1"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_z1"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_z1"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_x2"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_x2"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_y2"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_y2"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_z2"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_z2"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_h1"; - mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); - n = name + "_h2"; - mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); - n = name + "_h3"; - mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); - } + n = name + "_h1"; + mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); + n = name + "_h2"; + mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); + n = name + "_h3"; + mTreeData.CritTrackIds[(n)]; mTree->Branch(n.c_str(), &mTreeData.CritTrackIds[n]); + } - if ( name == "Crit2_BDT" ){ - string n = name + "_DeltaPhi"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_DeltaRho"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_RZRatio"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); - n = name + "_StraightTrackRatio"; - mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + if ( name == "Crit2_BDT" ){ + string n = name + "_DeltaPhi"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_DeltaRho"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_RZRatio"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + n = name + "_StraightTrackRatio"; + mTreeData.Crits[(n)]; mTree->Branch(n.c_str(), &mTreeData.Crits[n]); + } } - } - // Three hit criteria - path = "TrackFinder.Iteration[0].ThreeHitSegments"; - paths = mFwdConfig.childrenOf(path); + // Three hit criteria + path = "TrackFinder.Iteration[0].ThreeHitSegments"; + paths = mFwdConfig.childrenOf(path); - for (string p : paths) { - string name = mFwdConfig.get(p + ":name", ""); - mTreeData.Crits[name]; // create the entry - mTree->Branch(name.c_str(), &mTreeData.Crits[name]); - mTree->Branch((name + "_trackIds").c_str(), &mTreeData.CritTrackIds[name]); + for (string p : paths) { + string name = mFwdConfig.get(p + ":name", ""); + mTreeData.Crits[name]; // create the entry + mTree->Branch(name.c_str(), &mTreeData.Crits[name]); + mTree->Branch((name + "_trackIds").c_str(), &mTreeData.CritTrackIds[name]); + } } mTree->SetAutoFlush(0); @@ -586,10 +593,10 @@ void StFwdTrackMaker::loadFttHitsFromStEvent( FwdDataSource::McTrackMap_t &mcTra if ( col && col->numberOfPoints() > 0 ){ LOG_DEBUG << "The Ftt Collection has " << col->numberOfPoints() << " points" << endm; TMatrixDSym hitCov3(3); - const double sigXY = 1; // + const double sigXY = 0.2; // hitCov3(0, 0) = sigXY * sigXY; hitCov3(1, 1) = sigXY * sigXY; - hitCov3(2, 2) = 1; // unused since they are loaded as points on plane + hitCov3(2, 2) = 4; // unused since they are loaded as points on plane for ( auto point : col->points() ){ FwdHit *hit = new FwdHit(count++, point->xyz().x()/10.0, point->xyz().y()/10.0, point->xyz().z(), -point->plane(), 0, hitCov3, nullptr); @@ -601,8 +608,7 @@ void StFwdTrackMaker::loadFttHitsFromStEvent( FwdDataSource::McTrackMap_t &mcTra hitMap[hit->getSector()].push_back(hit); if (mGenTree && (unsigned)mTreeData.fttN < MAX_TREE_ELEMENTS) { - LOG_DEBUG << "Adding FTT Point to TTrees" << endm; - LOG_DEBUG << "FttPoint( " << point->xyz().x()/10.0 << ", " << point->xyz().y()/10.0 << ", " << point->xyz().z() << " )" << endm; + LOG_DEBUG << "FttPoint( " << TString::Format( "[plane=%d, quad=%d, nClu=%d]", point->plane(), point->quadrant(), point->nClusters() ) << point->xyz().x()/10.0 << ", " << point->xyz().y()/10.0 << ", " << point->xyz().z() << " )" << endm; mTreeData.fttX.push_back( point->xyz().x()/10.0 ); mTreeData.fttY.push_back( point->xyz().y()/10.0 ); mTreeData.fttZ.push_back( point->xyz().z() ); @@ -638,7 +644,7 @@ void StFwdTrackMaker::loadFttHitsFromGEANT( FwdDataSource::McTrackMap_t &mcTrack const double sigXY = 0.01; hitCov3(0, 0) = sigXY * sigXY; hitCov3(1, 1) = sigXY * sigXY; - hitCov3(2, 2) = 0.0; // unused since they are loaded as points on plane + hitCov3(2, 2) = 1.0; // unused since they are loaded as points on plane int nstg = g2t_stg_hits->GetNRows(); @@ -740,7 +746,6 @@ void StFwdTrackMaker::loadFstHits( FwdDataSource::McTrackMap_t &mcTrackMap, FwdD StSPtrVecFstHit fsthits = sc->hits(); mTreeData.fstN = 0; - LOG_DEBUG << "fsthits.size() == " << fsthits.size() << endm; for ( unsigned int ih = 0; ih < fsthits.size(); ih++ ){ float vR = fsthits[ih]->localPosition(0); float vPhi = fsthits[ih]->localPosition(1); @@ -1023,7 +1028,8 @@ void StFwdTrackMaker::loadFcs( ) { StEpdGeom epdgeo; - + mTreeData.fcsN = 0; + // LOAD ECAL / HCAL CLUSTERS for ( int idet = 0; idet < 4; idet++ ){ StSPtrVecFcsCluster& clusters = fcsCol->clusters(idet); @@ -1033,6 +1039,11 @@ void StFwdTrackMaker::loadFcs( ) { StThreeVectorD xyz = fcsDb->getStarXYZfromColumnRow(clu->detectorId(),clu->x(),clu->y()); mFcsClusters.push_back( TVector3( xyz.x(), xyz.y(), xyz.z() - 2 ) ); mFcsClusterEnergy.push_back( clu->energy() ); + + mTreeData.fcsX.push_back( xyz.x() ); + mTreeData.fcsY.push_back( xyz.y() ); + mTreeData.fcsZ.push_back( xyz.z() - 2 ); + mTreeData.fcsDet.push_back( idet ); } } @@ -1045,16 +1056,22 @@ void StFwdTrackMaker::loadFcs( ) { StFcsHit* hit=hits[i]; if(det==kFcsPresNorthDetId || det==kFcsPresSouthDetId){ //EPD - double zepd=375.0; - int pp,tt,n; - double x[5],y[5]; - - if ( hit->energy() < 0.2 ) continue; - fcsDb->getEPDfromId(det,hit->id(),pp,tt); - epdgeo.GetCorners(100*pp+tt,&n,x,y); - double x0 = (x[0] + x[1] + x[2] + x[3]) / 4.0; - double y0 = (y[0] + y[1] + y[2] + y[3]) / 4.0; - mFcsPreHits.push_back( TVector3( x0, y0, zepd ) ); + double zepd=375.0; + int pp,tt,n; + double x[5],y[5]; + + if ( hit->energy() < 0.2 ) continue; + fcsDb->getEPDfromId(det,hit->id(),pp,tt); + epdgeo.GetCorners(100*pp+tt,&n,x,y); + double x0 = (x[0] + x[1] + x[2] + x[3]) / 4.0; + double y0 = (y[0] + y[1] + y[2] + y[3]) / 4.0; + mFcsPreHits.push_back( TVector3( x0, y0, zepd ) ); + + mTreeData.fcsX.push_back( x0 ); + mTreeData.fcsY.push_back( y0 ); + mTreeData.fcsZ.push_back( zepd ); + mTreeData.fcsDet.push_back( det ); + } } } @@ -1077,7 +1094,7 @@ int StFwdTrackMaker::Make() { mFcsPreHits.clear(); mFcsClusters.clear(); mFwdTracks.clear(); - + // default event vertex mForwardTracker->setEventVertex( TVector3( 0, 0, 0 ) ); @@ -1146,12 +1163,11 @@ int StFwdTrackMaker::Make() { LOG_DEBUG << "Skipping visualization, too many FWD tracks" << endm; } + // Fill Track Deltas in ttree for helpful alignment info FillTrackDeltas(); - LOG_INFO << "Forward tracking on this event took " << (FwdTrackerUtils::nowNanoSecond() - itStart) * 1e-6 << " ms" << endm; - if ( true && IAttr("fillEvent") ) { if (!stEvent) { @@ -1160,9 +1176,6 @@ int StFwdTrackMaker::Make() { } FillEvent(); - - - } // IAttr FillEvent LOG_DEBUG << "Filling fwd Tree for event: " << GetIventNumber() << endm; @@ -1172,24 +1185,33 @@ int StFwdTrackMaker::Make() { StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t indexTrack ){ + LOG_DEBUG << "StFwdTrackMaker::makeStFwdTrack()" << endm; StFwdTrack *fwdTrack = new StFwdTrack( ); auto track = gtr.track; // if FST refit is available save that - if ( gtr.nFST > 0 ){ + if ( gtr.nFST > 0 && gtr.fstTrack != nullptr){ + LOG_DEBUG << "\tSave FST refit track since we have FST points" << endm; track = gtr.fstTrack; + } else if (gtr.nFST > 0 && gtr.fstTrack == nullptr) { + LOG_WARN << "\tFST refit failed even though we have " << gtr.nFST << " FST points" << endm; + } + + // Fit failed beyond use + if ( track == nullptr ){ + LOG_DEBUG << "Track is nullptr, not saving StFwdTrack" << endm; + return nullptr; } auto fitStatus = track->getFitStatus(); if ( !fitStatus ) return nullptr; - // Fill charge and quality info fwdTrack->setDidFitConverge( fitStatus->isFitConverged() ); fwdTrack->setDidFitConvergeFully( fitStatus->isFitConvergedFully() ); fwdTrack->setNumberOfFailedPoints( fitStatus->getNFailedPoints() ); - // fwdTrack->setNumberOfSeedPoints( ); + fwdTrack->setNumberOfFitPoints( track->getNumPoints() ); fwdTrack->setChi2( fitStatus->getChi2() ); fwdTrack->setNDF( fitStatus->getNdf() ); @@ -1197,14 +1219,17 @@ StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t ind auto cr = track->getCardinalRep(); // charge at first point - fwdTrack->setCharge( cr->getCharge(track->getFittedState(0, cr)) ); + fwdTrack->setCharge( gtr.charge ); TVector3 p = cr->getMom( track->getFittedState( 0, cr )); - fwdTrack->setPrimaryMomentum( StThreeVectorD( p.X(), p.Y(), p.Z() ) ); + fwdTrack->setPrimaryMomentum( StThreeVectorD( gtr.momentum.X(), gtr.momentum.Y(), gtr.momentum.Z() ) ); + LOG_DEBUG << "Making StFwdTrack with " << TString::Format( "p=(%f, %f, %f)", fwdTrack->momentum().x(), fwdTrack->momentum().y(), fwdTrack->momentum().z() ) << endm; + int nSeedPoints = 0; // store the seed points from FTT for ( auto s : gtr.trackSeed ){ FwdHit * fh = static_cast( s ); + if (!fh) continue; float cov[9]; cov[0] = fh->_covmat(0,0); cov[3] = fh->_covmat(1,0); cov[6] = fh->_covmat(2,0); cov[1] = fh->_covmat(0,1); cov[4] = fh->_covmat(1,1); cov[7] = fh->_covmat(2,1); @@ -1212,10 +1237,12 @@ StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t ind StFwdTrackSeedPoint p( StThreeVectorD( fh->getX(), fh->getY(), fh->getZ() ), fh->getSector(), fh->getTrackId(), cov ); fwdTrack->mFTTPoints.push_back( p ); + nSeedPoints++; } for ( auto s : gtr.fstSeed ){ FwdHit * fh = static_cast( s ); + if (!fh) continue; float cov[9]; cov[0] = fh->_covmat(0,0); cov[3] = fh->_covmat(1,0); cov[6] = fh->_covmat(2,0); cov[1] = fh->_covmat(0,1); cov[4] = fh->_covmat(1,1); cov[7] = fh->_covmat(2,1); @@ -1223,9 +1250,11 @@ StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t ind StFwdTrackSeedPoint p( StThreeVectorD( fh->getX(), fh->getY(), fh->getZ() ), fh->getSector(), fh->getTrackId(), cov ); fwdTrack->mFSTPoints.push_back( p ); + nSeedPoints++; } - + // set total number of seed points + fwdTrack->setNumberOfSeedPoints( nSeedPoints ); // compute projections to z-planes of various detectors vector zPlanes = { @@ -1269,7 +1298,7 @@ StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t ind int detIndex = 0; for ( float z : zPlanes ){ detIndex = detMap[ zIndex]; - LOG_DEBUG << "Calculating Projection for detId=" << detIndex << " @ z=" << z << endm; + // LOG_DEBUG << "Calculating Projection for detId=" << detIndex << " @ z=" << z << endm; TVector3 mom(0, 0, 0); float cov[9]; @@ -1296,6 +1325,7 @@ StFwdTrack * StFwdTrackMaker::makeStFwdTrack( GenfitTrackResult >r, size_t ind } void StFwdTrackMaker::FillEvent() { + LOG_DEBUG << "StFwdTrackMaker::FillEvent()" << endm; // Now fill StEvent StEvent *stEvent = static_cast(GetInputDS("StEvent")); @@ -1362,9 +1392,10 @@ void StFwdTrackMaker::FitVertex(){ genfit::GFRaveVertexFactory gfrvf; TMatrixDSym bscm(3); - bscm(0, 0) = 1.1*1.1; - bscm(1, 1) = 1.1*1.1; - bscm(2, 2) = 10.5 * 10.5; + const double bssXY = 2.0; + bscm(0, 0) = bssXY*bssXY; + bscm(1, 1) = bssXY*bssXY; + bscm(2, 2) = 50.5 * 50.5; gfrvf.setBeamspot( TVector3( 0, 0, 0 ), bscm ); // std::vector< genfit::GFRaveVertex * > vertices; const auto &genfitTracks = mForwardTracker -> globalTracks(); @@ -1411,7 +1442,7 @@ void StFwdTrackMaker::FillTTree(){ - if (mForwardTracker->getSaveCriteriaValues()) { + if (mForwardTracker->getSaveCriteriaValues() && mTreeData.saveCrit ) { for (auto crit : mForwardTracker->getTwoHitCriteria()) { string name = crit->getName(); @@ -1516,7 +1547,6 @@ void StFwdTrackMaker::FillTTree(){ // SAVE RECO tracks mTreeData.rcN = 0; - const auto &fittedTracks = mForwardTracker -> getTrackResults(); LOG_INFO << "There are " << fittedTracks.size() << " seed tracks to save" << endm; @@ -1555,7 +1585,6 @@ void StFwdTrackMaker::FillTTree(){ mTreeData.rcEta.push_back( fittedTracks[i].momentum.Eta() ); mTreeData.rcPhi.push_back( fittedTracks[i].momentum.Phi() ); - mTreeData.rcNumPV.push_back( fittedTracks[i].nPV ); mTreeData.rcNumFTT.push_back( fittedTracks[i].nFTT ); mTreeData.rcNumFST.push_back( fittedTracks[i].nFST ); @@ -1574,22 +1603,74 @@ void StFwdTrackMaker::Clear(const Option_t *opts) { mForwardData->clear(); if (mGenTree){ - mTreeData.thdN = mTreeData.fttN = mTreeData.rcN = mTreeData.mcN = mTreeData.vmcN = mTreeData.vrcN = 0; + mTreeData.thdN = mTreeData.fttN = mTreeData.rcN = mTreeData.mcN = mTreeData.vmcN = mTreeData.vrcN = mTreeData.fcsN = 0; mTreeData.fttX.clear(); mTreeData.fttY.clear(); mTreeData.fttZ.clear(); mTreeData.fttTrackId.clear(); + mTreeData.fttVolumeId.clear(); + mTreeData.fttPt.clear(); + mTreeData.fttVertexId.clear(); mTreeData.fstX.clear(); mTreeData.fstY.clear(); mTreeData.fstZ.clear(); mTreeData.fstTrackId.clear(); + mTreeData.fcsX.clear(); + mTreeData.fcsY.clear(); + mTreeData.fcsZ.clear(); + mTreeData.fcsDet.clear(); + + mTreeData.rcPt.clear(); + mTreeData.rcEta.clear(); + mTreeData.rcPhi.clear(); + mTreeData.rcQuality.clear(); + mTreeData.rcTrackId.clear(); + mTreeData.rcNumFST.clear(); + mTreeData.rcCharge.clear(); + mTreeData.rcNumFTT.clear(); + mTreeData.rcNumPV.clear(); + + + mTreeData.mcPt.clear(); + mTreeData.mcEta.clear(); + mTreeData.mcPhi.clear(); + mTreeData.mcVertexId.clear(); + mTreeData.mcCharge.clear(); + mTreeData.vmcX.clear(); + mTreeData.vmcY.clear(); + mTreeData.vmcZ.clear(); + + mTreeData.tprojX.clear(); + mTreeData.tprojY.clear(); + mTreeData.tprojZ.clear(); + mTreeData.tprojPx.clear(); + mTreeData.tprojPy.clear(); + mTreeData.tprojPz.clear(); + mTreeData.vrcX.clear(); + mTreeData.vrcY.clear(); + mTreeData.vrcZ.clear(); + mTreeData.thdX.clear(); + mTreeData.thdY.clear(); + mTreeData.thaX.clear(); + mTreeData.thaY.clear(); + mTreeData.thaZ.clear(); + mTreeData.thdX.clear(); mTreeData.thdY.clear(); mTreeData.thaX.clear(); mTreeData.thaY.clear(); mTreeData.thaZ.clear(); + + mTreeData.fttN = 0; + mTreeData.fstN = 0; + mTreeData.rcN = 0; + mTreeData.mcN = 0; + mTreeData.vmcN = 0; + mTreeData.tprojN = 0; + mTreeData.vrcN = 0; + mTreeData.thdN = 0; } } //________________________________________________________________________ @@ -1599,7 +1680,7 @@ void StFwdTrackMaker::ProcessFwdTracks( ){ StEvent *stEvent = static_cast(GetInputDS("StEvent")); StFwdTrackCollection * ftc = stEvent->fwdTrackCollection(); for ( auto fwdTrack : ftc->tracks() ){ - LOG_DEBUG << TString::Format("StFwdTrack[ nProjections=%lu, nFTTSeeds=%lu, nFSTSeeds=%lu ]", fwdTrack->mProjections.size(), fwdTrack->mFTTPoints.size(), fwdTrack->mFSTPoints.size()) << endm; + LOG_DEBUG << TString::Format("StFwdTrack[ nProjections=%lu, nFTTSeeds=%lu, nFSTSeeds=%lu, mPt=%f ]", fwdTrack->mProjections.size(), fwdTrack->mFTTPoints.size(), fwdTrack->mFSTPoints.size(), fwdTrack->momentum().perp()) << endm; for ( auto proj : fwdTrack->mProjections ) { LOG_DEBUG << TString::Format("Proj[ %d, %f, %f, %f ]", proj.mDetId, proj.mXYZ.x(), proj.mXYZ.y(), proj.mXYZ.z() ) << endm; } diff --git a/StRoot/StFwdTrackMaker/StFwdTrackMaker.h b/StRoot/StFwdTrackMaker/StFwdTrackMaker.h index e88d685eaad..5be3f4f0f11 100644 --- a/StRoot/StFwdTrackMaker/StFwdTrackMaker.h +++ b/StRoot/StFwdTrackMaker/StFwdTrackMaker.h @@ -62,6 +62,10 @@ struct FwdTreeData { vector fstX, fstY, fstZ; vector fstTrackId; + int fcsN; + vector fcsX, fcsY, fcsZ; + vector fcsDet; + // RC tracks int rcN; vector rcPt, rcEta, rcPhi, rcQuality; @@ -89,6 +93,7 @@ struct FwdTreeData { int thdN; vector thdX, thdY, thaX, thaY, thaZ; + bool saveCrit = false; std::map> Crits; std::map> CritTrackIds; diff --git a/StRoot/StFwdTrackMaker/include/Tracker/FwdTracker.h b/StRoot/StFwdTrackMaker/include/Tracker/FwdTracker.h index 8a526d61572..1316f9eca61 100644 --- a/StRoot/StFwdTrackMaker/include/Tracker/FwdTracker.h +++ b/StRoot/StFwdTrackMaker/include/Tracker/FwdTracker.h @@ -73,7 +73,7 @@ class GenfitTrackResult { this->trackSeed = seedTrack; try { - this->track = new genfit::Track(*track); + this->track = track; this->status = *(this->track->getFitStatus()); this->trackRep = this->track->getCardinalRep(); @@ -86,9 +86,10 @@ class GenfitTrackResult { this->nPV = this->track->getNumPoints() - (nFTT + nFST); this->momentum = this->trackRep->getMom( this->track->getFittedState(0, this->trackRep) ); + LOG_DEBUG << "GenfitTrackResult::set Track successful" << endm; } catch ( genfit::Exception &e ) { - LOG_ERROR << "CANNOT GET TRACK" << endm; + LOG_ERROR << "GenfitTrackResult cannot get track" << endm; this->track = nullptr; this->trackRep = nullptr; @@ -109,11 +110,14 @@ class GenfitTrackResult { } void setFst( Seed_t &seedFst, genfit::Track *track ){ + LOG_DEBUG << "GenfitTrackResult::setFSt" << endm; nFST = seedFst.size(); fstSeed = seedFst; try { this->fstTrack = new genfit::Track(*track); + // make sure the McTrackId is set correctly + this->fstTrack->setMcTrackId( this->track->getMcTrackId() ); this->fstStatus = *(this->fstTrack->getFitStatus()); this->fstTrackRep = this->fstTrack->getCardinalRep(); @@ -125,7 +129,7 @@ class GenfitTrackResult { this->fstMomentum = this->fstTrackRep->getMom( this->fstTrack->getFittedState(0, this->fstTrackRep) ); } catch ( genfit::Exception &e ) { - LOG_ERROR << "CANNOT GET TRACK" << endm; + LOG_ERROR << "CANNOT GET FST TRACK" << endm; this->fstTrack = nullptr; this->fstTrackRep = nullptr; @@ -528,6 +532,7 @@ class ForwardTrackMaker { if (mConfig.get("TrackFitter:refitSi", true)) { addSiHitsMc(); } else { + LOG_DEBUG << "Skipping FST Hits" << endm; // skip Si refit } /***********************************************/ @@ -656,13 +661,13 @@ class ForwardTrackMaker { } - GenfitTrackResult gtr( track.size(), 0, track, mTrackFitter->getTrack() ); + genTrack = new genfit::Track(*mTrackFitter->getTrack()); + genTrack->setMcTrackId(idt); + GenfitTrackResult gtr( track.size(), 0, track, genTrack ); // assign the fit results to be saved fitStatus = mTrackFitter->getStatus(); - genTrack = new genfit::Track(*mTrackFitter->getTrack()); trackRep = mTrackFitter->getTrackRep()->clone(); // Clone the track rep - genTrack->setMcTrackId(idt); if ( mGenHistograms && genTrack->getFitStatus(genTrack->getCardinalRep())->isFitConverged() && p.Perp() > 1e-3) { mHist["FitStatus"]->Fill("GoodCardinal", 1); @@ -679,6 +684,7 @@ class ForwardTrackMaker { mTrackResults.push_back( gtr ); + LOG_DEBUG << "FwdTracker::fitTrack complete" << endm; } // if (mDoTrackFitting && !bailout) } @@ -774,6 +780,9 @@ class ForwardTrackMaker { */ vector doTrackingOnHitmapSubset( size_t iIteration, FwdDataSource::HitMap_t &hitmap ) { long long itStart = FwdTrackerUtils::nowNanoSecond(); + + std::vector acceptedTracks; + std::vector rejectedTracks; /*************************************************************/ // Step 2 // build 2-hit segments (setup parent child relationships) @@ -812,6 +821,11 @@ class ForwardTrackMaker { LOG_DEBUG << TString::Format( "nSegments=%lu", automaton.getSegments().size() ).Data() << endm; LOG_DEBUG << TString::Format( "nConnections=%u", automaton.getNumberOfConnections() ).Data() << endm; + if (automaton.getNumberOfConnections() > 900 ){ + LOG_ERROR << "Got too many connections, bailing out of tracking" << endm; + return acceptedTracks; + } + // at any point we can get a list of tracks out like this: // std::vector < std::vector< KiTrack::IHit* > > tracks = automaton.getTracks(); // we can apply an optional parameter to only get tracks with >=nHits in them @@ -853,7 +867,7 @@ class ForwardTrackMaker { duration = (FwdTrackerUtils::nowNanoSecond() - itStart) * 1e-6; // milliseconds if (mGenHistograms) mHist["Step3Duration"]->Fill( duration ); - if (duration > 200){ + if (duration > 200 || automaton.getNumberOfConnections() > 900){ LOG_WARN << "The Three Hit Criteria took more than 200ms to process, duration: " << duration << " ms" << endm; LOG_WARN << "bailing out (skipping subset HNN)" << endm; std::vector acceptedTracks; @@ -878,8 +892,6 @@ class ForwardTrackMaker { // only for debug really bool findSubsets = mConfig.get(subsetPath + ":active", true); - std::vector acceptedTracks; - std::vector rejectedTracks; if (findSubsets) { size_t minHitsOnTrack = mConfig.get(subsetPath + ":min-hits-on-track", 7); @@ -1023,13 +1035,14 @@ class ForwardTrackMaker { void addSiHitsMc() { FwdDataSource::HitMap_t hitmap = mDataSource->getFstHits(); - for (size_t i = 0; i < mGlobalTracks.size(); i++) { - - if (mGlobalTracks[i]->getFitStatus(mGlobalTracks[i]->getCardinalRep())->isFitConverged() == false || mFitMoms[i].Perp() < 1e-3) { + for (size_t i = 0; i < mTrackResults.size(); i++) { + GenfitTrackResult >r = mTrackResults[i]; + + if ( gtr.status.isFitConverged() == false || gtr.momentum.Perp() < 1e-3) { + LOG_DEBUG << "Skipping addSiHitsMc, fit failed" << endm; return; } - if ( mGenHistograms){ mHist["FitStatus"]->Fill("PossibleReFit", 1); } @@ -1038,7 +1051,7 @@ class ForwardTrackMaker { for (size_t j = 0; j < 3; j++) { for (auto h0 : hitmap[j]) { - if (dynamic_cast(h0)->_tid == mGlobalTracks[i]->getMcTrackId()) { + if (dynamic_cast(h0)->_tid == gtr.track->getMcTrackId()) { si_hits_for_this_track[j] = h0; break; } @@ -1049,6 +1062,7 @@ class ForwardTrackMaker { if ( si_hits_for_this_track[0] != nullptr ) nSiHitsFound++; if ( si_hits_for_this_track[1] != nullptr ) nSiHitsFound++; if ( si_hits_for_this_track[2] != nullptr ) nSiHitsFound++; + LOG_DEBUG << "Found " << nSiHitsFound << " FST Hits on this track (MC lookup)" << endm; if ( mGenHistograms ){ this->mHist[ "nSiHitsFound" ]->Fill( 1, ( si_hits_for_this_track[0] != nullptr ? 1 : 0 ) ); @@ -1060,14 +1074,15 @@ class ForwardTrackMaker { if ( mGenHistograms ){ mHist["FitStatus"]->Fill("AttemptReFit", 1); } - TVector3 p = mTrackFitter->refitTrackWithSiHits(mGlobalTracks[i], si_hits_for_this_track); + TVector3 p = mTrackFitter->refitTrackWithSiHits(gtr.track, si_hits_for_this_track); if ( mGenHistograms ){ if (p.Perp() == mFitMoms[i].Perp()) { mHist["FitStatus"]->Fill("BadReFit", 1); - + LOG_DEBUG << "refitTrackWithSiHits failed refit" << endm; } else { mHist["FitStatus"]->Fill("GoodReFit", 1); + gtr.setFst( si_hits_for_this_track, mTrackFitter->getTrack() ); } } diff --git a/StRoot/StFwdTrackMaker/include/Tracker/TrackFitter.h b/StRoot/StFwdTrackMaker/include/Tracker/TrackFitter.h index 1d6c7b4181d..de55a2a53e1 100644 --- a/StRoot/StFwdTrackMaker/include/Tracker/TrackFitter.h +++ b/StRoot/StFwdTrackMaker/include/Tracker/TrackFitter.h @@ -74,8 +74,23 @@ class TrackFitter { gMan = gGeoManager; // Set up the material interface and set material effects on/off from the config genfit::MaterialEffects::getInstance()->init(new genfit::TGeoMaterialInterface()); - genfit::MaterialEffects::getInstance()->setNoEffects(mConfig.get("TrackFitter::noMaterialEffects", false)); // false means defaul ON + // Set Material Stepper debug level + genfit::MaterialEffects::getInstance()->setDebugLvl( mConfig.get("TrackFitter.MaterialEffects:DebugLvl", 0) ); + + genfit::MaterialEffects::getInstance()->setEnergyLossBetheBloch( mConfig.get("TrackFitter.MaterialEffects.EnergyLossBetheBloch", true) ); + genfit::MaterialEffects::getInstance()->setNoiseBetheBloch( mConfig.get("TrackFitter.MaterialEffects.NoiseBetheBloch", true) ); + genfit::MaterialEffects::getInstance()->setNoiseCoulomb( mConfig.get("TrackFitter.MaterialEffects.NoiseCoulomb", true) ); + genfit::MaterialEffects::getInstance()->setEnergyLossBrems( mConfig.get("TrackFitter.MaterialEffects.EnergyLossBrems", true) ); + genfit::MaterialEffects::getInstance()->setNoiseBrems( mConfig.get("TrackFitter.MaterialEffects.NoiseBrems", true) ); + genfit::MaterialEffects::getInstance()->ignoreBoundariesBetweenEqualMaterials( mConfig.get("TrackFitter.MaterialEffects.ignoreBoundariesBetweenEqualMaterials", true) ); + + // do this last to override + genfit::MaterialEffects::getInstance()->setNoEffects( !mConfig.get("TrackFitter:MaterialEffects", false)); // negated, true means defaul is all effects on (noEffects off) + if (!mConfig.get("TrackFitter:MaterialEffects", false)){ + LOG_INFO << "Turning OFF GenFit Material Effects in stepper" << endm; + } + // Determine which Magnetic field to use // Either constant field or real field from StarFieldAdaptor if (mConfig.get("TrackFitter:constB", false)) { @@ -171,7 +186,7 @@ class TrackFitter { // Now load FTT // mConfig.getVector<>(...) requires a default, hence the mFTTZLocations = fwdGeoUtils.fttZ( - mConfig.getVector("TrackFitter.Geometry:ftt", {0.0f, 0.0f, 0.0f, 0.0f}) + mConfig.getVector("TrackFitter.Geometry:ftt", {281.082,304.062,325.058,348.068}) ); if ( fwdGeoUtils.fttZ( 0 ) < 1.0 ) { // returns 0.0 on failure @@ -772,8 +787,8 @@ class TrackFitter { } // create the track representations - auto trackRepPos = new genfit::RKTrackRep(mPdgPositron); - auto trackRepNeg = new genfit::RKTrackRep(mPdgElectron); + auto trackRepPos = new genfit::RKTrackRep(mPdgMuon); + auto trackRepNeg = new genfit::RKTrackRep(mPdgAntiMuon); // Create the track mFitTrack = new genfit::Track(trackRepPos, seedPos, seedMom); @@ -950,6 +965,8 @@ class TrackFitter { const int mPdgPiMinus = -211; const int mPdgPositron = 11; const int mPdgElectron = -11; + const int mPdgMuon = 13; + const int mPdgAntiMuon = -13; // det z locations loaded from geom or config diff --git a/StRoot/StFwdTrackMaker/macro/sim/fast_track.xml b/StRoot/StFwdTrackMaker/macro/sim/fast_track.xml index 0879685daf9..f56e725df69 100644 --- a/StRoot/StFwdTrackMaker/macro/sim/fast_track.xml +++ b/StRoot/StFwdTrackMaker/macro/sim/fast_track.xml @@ -1,11 +1,19 @@ - fGeom.root - + + - - + + + false + false + false + false + false + true + + diff --git a/StRoot/StFwdTrackMaker/macro/sim/full_track.xml b/StRoot/StFwdTrackMaker/macro/sim/full_track.xml index f322237a876..533fbebefab 100644 --- a/StRoot/StFwdTrackMaker/macro/sim/full_track.xml +++ b/StRoot/StFwdTrackMaker/macro/sim/full_track.xml @@ -1,7 +1,7 @@ - fGeom.root + @@ -33,7 +33,7 @@ - - + + diff --git a/StRoot/StFwdTrackMaker/macro/sim/fwd_tracking.C b/StRoot/StFwdTrackMaker/macro/sim/fwd_tracking.C index bbf81ad20bc..1a1b4923e03 100755 --- a/StRoot/StFwdTrackMaker/macro/sim/fwd_tracking.C +++ b/StRoot/StFwdTrackMaker/macro/sim/fwd_tracking.C @@ -2,7 +2,7 @@ // that is a valid shebang to run script as executable, but with only one arg -// Run very fast fwd tracking with only track seed finding +// Run very fast fwd tracking // generate some input data using genfzd TFile *output = 0; @@ -10,20 +10,20 @@ TFile *output = 0; void fwd_tracking( int n = 500, const char *inFile = "simu/seed.fzd", std::string configFile = "simu/seed.xml", - const char *geom = "dev2022") { + const char *geom = "y2023") { TString _geom = geom; bool SiIneff = false; bool useConstBz = false; - - bool useFCS = false; + bool useFCS = true; // Setup the chain for reading an FZD TString _chain; - // fcsWFF fcsCluster if ( useFCS ) - _chain = Form("fzin %s sdt20211016 StEvent ReverseField agml usexgeom bigbig fstFastSim fttFastSim fcsSim fcsWFF fcsCluster fwdTrack", _geom.Data()); + _chain = Form("fzin %s sdt20211016 fstFastSim fcsSim fcsWFF fcsCluster fwdTrack MakeEvent StEvent ReverseField agml usexgeom bigbig evout cmudst tree", _geom.Data()); else - _chain = Form("fzin %s sdt20211016 StEvent ReverseField agml usexgeom bigbig fstFastSim fttFastSim fcsSim fwdTrack", _geom.Data()); + _chain = Form("fzin %s sdt20211016 MakeEvent StEvent ReverseField agml usexgeom bigbig fstFastSim fcsSim fwdTrack evout cmudst tree", _geom.Data()); + + //_chain = Form("fzin %s sdt20230202 MakeEvent StEvent ReverseField agml usexgeom bigbig evout cmudst tree", _geom.Data()); gSystem->Load( "libStarRoot.so" ); gROOT->SetMacroPath(".:/star-sw/StRoot/macros/:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials"); @@ -34,30 +34,38 @@ void fwd_tracking( int n = 500, StarMagField::setConstBz(true); - StFcsDbMaker* fcsdbmkr = (StFcsDbMaker*) chain->GetMaker("fcsDbMkr"); - cout << "fcsdbmkr="<GetDataSet("fcsDb"); - cout << "fcsdb="<setDbAccess(1); - - StFcsFastSimulatorMaker *fcssim = (StFcsFastSimulatorMaker*) chain->GetMaker("fcsSim"); - //fcssim->setDebug(1); - //fcssim->setLeakyHcal(0); + gSystem->Load( "libStFttSimMaker" ); + + gSystem->Load( "libStFcsTrackMatchMaker" ); +// StFttSlowSimMaker *fttSlowSim = new StFttSlowSimMaker(); +// cout << "Adding StFttSlowSimMaker to chain" << endl; +// chain->AddMaker(fttSlowSim); +//goto chain_loop; if (useFCS) { + + StFcsDbMaker* fcsdbmkr = (StFcsDbMaker*) chain->GetMaker("fcsDbMkr"); + cout << "fcsdbmkr="<GetDataSet("fcsDb"); + cout << "fcsdb="<setDbAccess(1); + + // Configure FCS simulator + StFcsFastSimulatorMaker *fcssim = (StFcsFastSimulatorMaker*) chain->GetMaker("fcsSim"); + fcssim->setDebug(1); + //fcssim->setLeakyHcal(0); + StFcsWaveformFitMaker *fcsWFF= (StFcsWaveformFitMaker*) chain->GetMaker("StFcsWaveformFitMaker"); fcsWFF->setEnergySelect(0); StFcsClusterMaker *fcsclu = (StFcsClusterMaker*) chain->GetMaker("StFcsClusterMaker"); - fcsclu->setDebug(1); + fcsclu->setDebug(1); } // Configure FTT FastSim - StFttFastSimMaker *fttFastSim = (StFttFastSimMaker*) chain->GetMaker( "fttSim" ); - cout << "Adding StFttFastSimMaker to chain" << endl; - chain->AddMaker(fttFastSim); - - + // StFttFastSimMaker *fttFastSim = (StFttFastSimMaker*) chain->GetMaker( "fttSim" ); + // cout << "Adding StFttFastSimMaker to chain" << endl; + // chain->AddMaker(fttFastSim); // Configure FST FastSim TString qaoutname(gSystem->BaseName(inFile)); @@ -74,25 +82,40 @@ void fwd_tracking( int n = 500, // Configure the Forward Tracker - StFwdTrackMaker * fwdTrack = (StFwdTrackMaker*) chain->GetMaker( "fwdTrack" );; + StFwdTrackMaker * fwdTrack = (StFwdTrackMaker*) chain->GetMaker( "fwdTrack" ); // config file set here overides chain opt cout << "Running FwdTracking with config: " << configFile << endl; fwdTrack->SetConfigFile( configFile ); fwdTrack->SetGenerateTree( true ); fwdTrack->SetGenerateHistograms( true ); - - chain->AddMaker(fwdTrack); + fwdTrack->SetDebug(); + + gSystem->Load("StFwdUtils.so"); + if (!useFCS){ + StFwdAnalysisMaker *fwdAna = new StFwdAnalysisMaker(); + fwdAna->SetDebug(); + chain->AddAfter("fwdTrack", fwdAna); + } if (useFCS) { // FwdTrack and FcsCluster assciation gSystem->Load("StFcsTrackMatchMaker"); StFcsTrackMatchMaker *match = new StFcsTrackMatchMaker(); - match->setMaxDistance(6,10); + match->setMaxDistance(6,10); match->setFileName("fcstrk.root"); match->SetDebug(); + chain->AddMaker(match); + + StFwdAnalysisMaker *fwdAna = new StFwdAnalysisMaker(); + fwdAna->SetDebug(); + chain->AddAfter("FcsTrkMatch", fwdAna); } + StMuDstMaker * muDstMaker = (StMuDstMaker*)chain->GetMaker( "MuDst" ); + chain->AddAfter( "FcsTrkMatch", muDstMaker ); + +chain_loop: chain->Init(); //_____________________________________________________________________________ @@ -101,9 +124,23 @@ void fwd_tracking( int n = 500, //_____________________________________________________________________________ for (int i = 0; i < n; i++) { + cout << "--------->START EVENT: " << i << endl; + chain->Clear(); if (kStOK != chain->Make()) break; + + + // StMuDst * mds = muDstMaker->muDst(); + // StMuFwdTrackCollection * ftc = mds->muFwdTrackCollection(); + // cout << "Number of StMuFwdTracks: " << ftc->numberOfFwdTracks() << endl; + // for ( size_t iTrack = 0; iTrack < ftc->numberOfFwdTracks(); iTrack++ ){ + // StMuFwdTrack * muFwdTrack = ftc->getFwdTrack( iTrack ); + // cout << "muFwdTrack->mPt = " << muFwdTrack->momentum().Pt() << endl; + + // } + + cout << "<---------- END EVENT" << endl; } } diff --git a/StRoot/StFwdTrackMaker/macro/sim/gen.C b/StRoot/StFwdTrackMaker/macro/sim/gen.C new file mode 100644 index 00000000000..5056662f861 --- /dev/null +++ b/StRoot/StFwdTrackMaker/macro/sim/gen.C @@ -0,0 +1,168 @@ +// macro to instantiate the Geant3 from within +// STAR C++ framework and get the starsim prompt +// To use it do +// root4star starsim.C + +class St_geant_Maker; +St_geant_Maker *geant_maker = 0; + +class StarGenEvent; +StarGenEvent *event = 0; + +class StarPrimaryMaker; +StarPrimaryMaker *_primary = 0; + +class StarKinematics; +StarKinematics *kinematics = 0; + + +TH1F* hNumHits = 0; +TString nameParticle = "mu+"; +float numParticles = 5; + +// ---------------------------------------------------------------------------- +void geometry( TString tag, Bool_t agml=true ) +{ + TString cmd = "DETP GEOM "; cmd += tag + " field=-5.0"; + if ( !geant_maker ) geant_maker = (St_geant_Maker *)chain->GetMaker("geant"); + geant_maker -> LoadGeometry(cmd); + // if ( agml ) command("gexec $STAR_LIB/libxgeometry.so"); +} +// ---------------------------------------------------------------------------- +void command( TString cmd ) +{ + if ( !geant_maker ) geant_maker = (St_geant_Maker *)chain->GetMaker("geant"); + geant_maker -> Do( cmd ); +} +// ---------------------------------------------------------------------------- +void trig( Int_t n=1 ) +{ + + + for ( Int_t i=0; iClear(); + + kinematics->Kine( numParticles, nameParticle.Data(), 0.2, 5.0, 2.0, 4.50 ); + // kinematics->Kine( numParticles, nameParticle.Data(), 10.2, 12.0, 2.5, 4.00 ); + + // Generate the event + chain->Make(); + + TTable* hits = chain->GetDataSet("bfc/.make/geant/.data/g2t_stg_hit"); + if ( hits ) { + double nhits = hits->GetNRows(); + hNumHits->Fill( double(i), nhits / 4.0 / numParticles ); + std::cout << "N hits = " << nhits << std::endl; + } + + // Print the event + // command("gprint hits stgh"); + + } +} +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +void Kinematics() +{ + + // gSystem->Load( "libStarGeneratorPoolPythia6_4_23.so" ); + gSystem->Load( "libKinematics.so"); + kinematics = new StarKinematics(); + + _primary->AddGenerator(kinematics); +} +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +void gen( Int_t nevents=100, Int_t rngSeed=12352342 ) +{ + + cout << "Generating: " << nevents << " events with seed: " << rngSeed << endl; + gSystem->Load( "libStarRoot.so" ); + gROOT->SetMacroPath(".:/star-sw/StRoot/macros/:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials"); + + gROOT->ProcessLine(".L bfc.C"); + { + TString simple = "sdt20211016 y2023 geant gstar usexgeom agml "; + bfc(0, simple ); + } + + gSystem->Load( "libVMC.so"); + + gSystem->Load( "StarGeneratorUtil.so" ); + gSystem->Load( "StarGeneratorEvent.so" ); + gSystem->Load( "StarGeneratorBase.so" ); + + gSystem->Load( "libMathMore.so" ); + gSystem->Load( "xgeometry.so" ); + + // Setup RNG seed and map all ROOT TRandom here + StarRandom::seed( rngSeed ); + StarRandom::capture(); + + // + // Create the primary event generator and insert it + // before the geant maker + // + // StarPrimaryMaker * + _primary = new StarPrimaryMaker(); + { + _primary -> SetFileName( "sim.root"); + chain -> AddBefore( "geant", _primary ); + } + + Kinematics(); + + // + // Initialize primary event generator and all sub makers + // + _primary -> Init(); + _primary->SetSigma( 0.1, 0.1, 0.1 ); // 1mm x 1mm x 1mm smearing at the vertex + _primary->SetVertex(0.0, 0.0, 0.0 ); + + // + // Setup geometry and set starsim to use agusread for input + // + //geometry("y2012"); + command("gkine -4 0"); + command("gfile o sim.fzd"); + + + hNumHits = new TH1F("hNumEvents","Nhits/plane/incident track vs event number",nevents + 1, -0.5, (float)( nevents ) + 0.5 ); + // hNumHits->SetBit(TH1::kCanRebin); + + + // command( "DCAY 0" ); + // command( "ANNI 0" ); + // command( "BREM 0" ); + // command( "COMP 0" ); + // command( "HADR 0" ); + // command( "MUNU 0" ); + // command( "PAIR 0" ); + // command( "PFIS 0" ); + // command( "PHOT 0" ); + // command( "RAYL 0" ); + // command( "LOSS 4" ); + // command( "DRAY 0" ); + // command( "MULS 0" ); + // command( "STRA 0" ); + // command( "physi" ); + + // + // Trigger on nevents + // + trig( nevents ); + + // TFile * f = new TFile( "gen.root", "RECREATE" ); + // f->cd(); + // hNumHits->Write(); + // f->Write(); + + command("call agexit"); // Make sure that STARSIM exits properly + +} +// ---------------------------------------------------------------------------- + diff --git a/StRoot/StFwdTrackMaker/macro/sim/runPythia.C b/StRoot/StFwdTrackMaker/macro/sim/runPythia.C index d6b01bca1ed..595b848a2a9 100644 --- a/StRoot/StFwdTrackMaker/macro/sim/runPythia.C +++ b/StRoot/StFwdTrackMaker/macro/sim/runPythia.C @@ -120,10 +120,11 @@ void runPythia( Int_t nevents=100, Int_t run=1, char* particle="JPsi", float vz= cout<<"Random seed : "<ProcessLine(".L bfc.C");{ - TString simple = "y2017 geant gstar agml usexgeom "; + TString simple = "y2023 geant gstar agml usexgeom "; bfc(0, simple ); } + gSystem->Load("libfastjet.so"); gSystem->Load( "libVMC.so"); gSystem->Load( "StarGeneratorUtil.so" ); gSystem->Load( "StarGeneratorEvent.so" ); @@ -238,7 +239,7 @@ void runPythia( Int_t nevents=100, Int_t run=1, char* particle="JPsi", float vz= // //geometry("fwddev1a"); //geometry("ftsref6a"); - geometry("dev2022"); + geometry("y2023"); //geometry("sitrver0"); command("gkine -4 0"); command(Form("gfile o pythia_%s_vz%d_run%d.fzd",particle,int(vz),run)); diff --git a/StRoot/StFwdTrackMaker/macro/sim/run_batch_fast b/StRoot/StFwdTrackMaker/macro/sim/run_batch_fast index 8d2c7244bae..5a52567498b 100755 --- a/StRoot/StFwdTrackMaker/macro/sim/run_batch_fast +++ b/StRoot/StFwdTrackMaker/macro/sim/run_batch_fast @@ -1,21 +1,62 @@ -jobId=${1:-0} -pid=${2:-5} -### pid : 3=e- 5=mu+ 8=pi+ +#!/usr/bin/bash -echo "jobId=${jobId}, pid=${pid}" -nEvents=10 +# +# Setup arguments +# -strongrandom=`od -vAn -N3 -tu4 < /dev/urandom | tr -d '[:space:]'` -#echo starsim -w 0 -b sim/testg.kumac g3id=${pid} seed=${strongrandom} nevents=${nEvents} ntrack=1 etamn=3.0 etamx=3.5 ptmn=2.9 ptmx=3.1 ofn=sim.fzd -# starsim -w 0 -b sim/testg.kumac g3id=${pid} seed=${strongrandom} nevents=${nEvents} ntrack=5 etamn=2.5 etamx=4.5 ptmn=14.5 ptmx=15.0 ofn=sim.fzd +jobId=${1:-FAST} # default FAST +nEvents=${2:-10} +sim=${3:-true} +pid=${4:-5} # default muon -# FZD_FILE="/gpfs01/star/pwg/youqi/runPythia/out/${jIndex}.fzd" + +# +# Print job parameters +# +echo "Usage:\n rbfast " +echo "jobId=${jobId}, nEvents=${nEvents}, run_sim=${sim}, pid=${pid}" +source env.sh + +# +# Run simulation if needed +# +if [ "$sim" = true ] ; then + strongrandom=`od -vAn -N3 -tu4 < /dev/urandom | tr -d '[:space:]'` + echo "strong random ${strongrandom}" + echo root4star -b -q -l 'sim/gen.C( '"${nEvents}"','"${strongrandom}"')' + time root4star -b -q -l 'sim/gen.C( '"${nEvents}"','"${strongrandom}"')' +else + echo "Skipping simulation - use existing sim.fzd" +fi + + +# +# Run tracking +# echo root4star -b -q -l 'sim/fwd_tracking.C( '"${nEvents}"', "sim.fzd", "sim/fast_track.xml" )' time root4star -b -q -l 'sim/fwd_tracking.C( '"${nEvents}"', "sim.fzd", "sim/fast_track.xml" )' -# mkdir -p out/fast_track_pid${pid} -# mv sim.fzd out/fast_track_pid${pid}/${jobId}.fzd -# mv fast_track.root out/fast_track_pid${pid}/job${jobId}_qa.root -# mv fwdtree.root out/fast_track_pid${pid}/job${jobId}_fwdtree.root -# mv fcstrk.root out/fast_track_pid${pid}/job${jobId}_fcstrk.root + +# +# Copy output files into JOB prefixed names +# +if [ -f "fwdtree.root" ]; then + mv fwdtree.root ${jobId}_fwdtree.root +else + echo "WARNING: no fwdtree.root produced" +fi + +if [ -f "fast_track.root" ]; then + mv fast_track.root ${jobId}_trackingQA.root +else + echo "WARNING: no fast_track.root produced (tracking QA)" +fi + +if [ -f "fcstrk.root" ]; then + mv fcstrk.root ${jobId}_fcstrk.root +else + echo "No fcstrk.root output found, double check if FCS is included" +fi + + diff --git a/StRoot/StFwdTrackMaker/macro/sim/run_batch_full b/StRoot/StFwdTrackMaker/macro/sim/run_batch_full index 038e15079bf..2757323a11f 100755 --- a/StRoot/StFwdTrackMaker/macro/sim/run_batch_full +++ b/StRoot/StFwdTrackMaker/macro/sim/run_batch_full @@ -1,16 +1,62 @@ +#!/usr/bin/bash -nEvents=5 -strongrandom=`od -vAn -N3 -tu4 < /dev/urandom | tr -d '[:space:]'` -echo starsim -w 0 -b sim/testg.kumac g3id=5 seed=${strongrandom} nevents=${nEvents} ntrack=5 etamn=2.5 etamx=4.0 ptmn=0.2 ptmx=5.0 ofn=sim.fzd -starsim -w 0 -b sim/testg.kumac g3id=5 seed=${strongrandom} nevents=${nEvents} ntrack=5 etamn=3.0 etamx=3.5 ptmn=0.2 ptmx=1.0 ofn=sim.fzd +# +# Setup arguments +# -jobId=$1 +jobId=${1:-FULL} # default FAST +nEvents=${2:-10} +sim=${3:-true} +pid=${4:-5} # default muon + + +# +# Print job parameters +# +echo "Usage:\n rbfull " +echo "jobId=${jobId}, nEvents=${nEvents}, run_sim=${sim}, pid=${pid}" +source env.sh + +# +# Run simulation if needed +# +if [ "$sim" = true ] ; then + strongrandom=`od -vAn -N3 -tu4 < /dev/urandom | tr -d '[:space:]'` + echo "strong random ${strongrandom}" + echo root4star -b -q -l 'sim/gen.C( '"${nEvents}"','"${strongrandom}"')' + time root4star -b -q -l 'sim/gen.C( '"${nEvents}"','"${strongrandom}"')' +else + echo "Skipping simulation - use existing sim.fzd" +fi + + +# +# Run tracking +# echo root4star -b -q -l 'sim/fwd_tracking.C( '"${nEvents}"', "sim.fzd", "sim/full_track.xml" )' time root4star -b -q -l 'sim/fwd_tracking.C( '"${nEvents}"', "sim.fzd", "sim/full_track.xml" )' -mkdir -p out/full_track -mv sim.fzd out/full_track/${jobId}.fzd -mv full_track.root out/full_track/job${jobId}_qa.root -mv mltree.root out/full_track/job${jobId}_mltree.root \ No newline at end of file +# +# Copy output files into JOB prefixed names +# +if [ -f "fwdtree.root" ]; then + mv fwdtree.root ${jobId}_fwdtree.root +else + echo "WARNING: no fwdtree.root produced" +fi + +if [ -f "fast_track.root" ]; then + mv full_track.root ${jobId}_trackingQA.root +else + echo "WARNING: no full_track.root produced (tracking QA)" +fi + +if [ -f "fcstrk.root" ]; then + mv fcstrk.root ${jobId}_fcstrk.root +else + echo "No fcstrk.root output found, double check if FCS is included" +fi + + diff --git a/StRoot/StFwdTrackMaker/macro/sim/run_batch_pythia b/StRoot/StFwdTrackMaker/macro/sim/run_batch_pythia index a45e4400528..77103fb96a3 100755 --- a/StRoot/StFwdTrackMaker/macro/sim/run_batch_pythia +++ b/StRoot/StFwdTrackMaker/macro/sim/run_batch_pythia @@ -1,3 +1,4 @@ +#!/usr/bin/bash nEvents=100 fzd=$1 diff --git a/StRoot/StFwdUtils/StFwdAnalysisMaker.cxx b/StRoot/StFwdUtils/StFwdAnalysisMaker.cxx new file mode 100644 index 00000000000..06c0697efc8 --- /dev/null +++ b/StRoot/StFwdUtils/StFwdAnalysisMaker.cxx @@ -0,0 +1,121 @@ +#include "StFwdUtils/StFwdAnalysisMaker.h" +#include "StFwdTrackMaker/Common.h" + +#include +#include +#include +#include +#include + +#include "StEvent/StEvent.h" +#include "StEvent/StGlobalTrack.h" +#include "StEvent/StHelixModel.h" +#include "StEvent/StPrimaryTrack.h" +#include "StEvent/StRnDHit.h" +#include "StEvent/StRnDHitCollection.h" +#include "StEvent/StTrack.h" +#include "StEvent/StTrackGeometry.h" +#include "StEvent/StTrackNode.h" +#include "StEvent/StPrimaryVertex.h" +#include "StEvent/StEnumerations.h" +#include "StEvent/StTrackDetectorInfo.h" +#include "StEvent/StFttPoint.h" +#include "StEvent/StFcsHit.h" +#include "StEvent/StFcsCluster.h" +#include "StEvent/StFttCollection.h" +#include "StEvent/StFcsCollection.h" +#include "StEvent/StTriggerData.h" +#include "StEvent/StFstHitCollection.h" +#include "StEvent/StFstHit.h" +#include "StEvent/StFwdTrackCollection.h" +#include "StChain/StChainOpt.h" + +#include "StEventUtilities/StEventHelper.h" + +#include "StMuDSTMaker/COMMON/StMuDstMaker.h" +#include "StMuDSTMaker/COMMON/StMuDst.h" +#include "StMuDSTMaker/COMMON/StMuFwdTrack.h" + + +#include "tables/St_g2t_fts_hit_Table.h" +#include "tables/St_g2t_track_Table.h" +#include "tables/St_g2t_vertex_Table.h" +#include "tables/St_g2t_event_Table.h" + +#include "StarMagField/StarMagField.h" + +#include "St_base/StMessMgr.h" +#include "StarClassLibrary/StPhysicalHelix.hh" +#include "StarClassLibrary/SystemOfUnits.h" + + +#include "StEvent/StFwdTrack.h" + +//________________________________________________________________________ +StFwdAnalysisMaker::StFwdAnalysisMaker() : StMaker("fwdAna"){}; +int StFwdAnalysisMaker::Finish() { return kStOk; } +//________________________________________________________________________ +int StFwdAnalysisMaker::Init() { LOG_DEBUG << "StFwdAnalysisMaker::Init" << endm; return kStOK;}; +//________________________________________________________________________ +int StFwdAnalysisMaker::Make() { + LOG_DEBUG << "StFwdAnalysisMaker::Make" << endm; + StEvent *event = (StEvent *)GetDataSet("StEvent"); + if (!event){ + LOG_INFO << "Cannot find StEvent" << endm; + return kStOK; + } + long long itStart = FwdTrackerUtils::nowNanoSecond(); + + StFttCollection *fttCol = event->fttCollection(); + if (fttCol){ + LOG_INFO << "The Ftt Collection has " << fttCol->numberOfPoints() << " points" << endm; + } + + ProcessFwdTracks(); + ProcessFwdMuTracks(); + LOG_DEBUG << "Processing Fwd Tracks took: " << (FwdTrackerUtils::nowNanoSecond() - itStart) * 1e6 << " ms" << endm; + return kStOK; +} // Make +//________________________________________________________________________ +void StFwdAnalysisMaker::Clear(const Option_t *opts) { LOG_DEBUG << "StFwdAnalysisMaker::CLEAR" << endm; } +//________________________________________________________________________ +void StFwdAnalysisMaker::ProcessFwdTracks( ){ + // This is an example of how to process fwd track collection + LOG_INFO << "StFwdAnalysisMaker::ProcessFwdTracks" << endm; + StEvent *stEvent = static_cast(GetInputDS("StEvent")); + if (!stEvent) + return; + StFwdTrackCollection * ftc = stEvent->fwdTrackCollection(); + if (!ftc) + return; + for ( auto fwdTrack : ftc->tracks() ){ + LOG_INFO << TString::Format("StFwdTrack[ nProjections=%lu, nFTTSeeds=%lu, nFSTSeeds=%lu, mPt=%f ]", fwdTrack->mProjections.size(), fwdTrack->mFTTPoints.size(), fwdTrack->mFSTPoints.size(), fwdTrack->momentum().perp()) << endm; + for ( auto proj : fwdTrack->mProjections ) { + LOG_DEBUG << TString::Format("Proj[ %d, %f, %f, %f ]", proj.mDetId, proj.mXYZ.x(), proj.mXYZ.y(), proj.mXYZ.z() ) << endm; + } + } +} + +//________________________________________________________________________ +void StFwdAnalysisMaker::ProcessFwdMuTracks( ){ + // This is an example of how to process fwd track collection + LOG_INFO << "StFwdAnalysisMaker::ProcessFwdMuTracks" << endm; + StMuDstMaker *mMuDstMaker = (StMuDstMaker *)GetMaker("MuDst"); + if(!mMuDstMaker) { + LOG_WARN << " No MuDstMaker ... bye-bye" << endm; + return; + } + StMuDst *mMuDst = mMuDstMaker->muDst(); + if(!mMuDst) { + LOG_WARN << " No MuDst ... bye-bye" << endm; + return; + } + StMuFwdTrackCollection * ftc = mMuDst->muFwdTrackCollection(); + if (!ftc) return; + cout << "Number of StMuFwdTracks: " << ftc->numberOfFwdTracks() << endl; + + for ( size_t iTrack = 0; iTrack < ftc->numberOfFwdTracks(); iTrack++ ){ + StMuFwdTrack * muFwdTrack = ftc->getFwdTrack( iTrack ); + LOG_INFO << TString::Format("StMuFwdTrack[ nProjections=%lu, nFTTSeeds=%lu, nFSTSeeds=%lu, mPt=%f ]", muFwdTrack->mProjections.size(), muFwdTrack->mFTTPoints.size(), muFwdTrack->mFSTPoints.size(), muFwdTrack->momentum().Pt()) << endm; + } +} diff --git a/StRoot/StFwdUtils/StFwdAnalysisMaker.h b/StRoot/StFwdUtils/StFwdAnalysisMaker.h new file mode 100644 index 00000000000..0af1223f5a0 --- /dev/null +++ b/StRoot/StFwdUtils/StFwdAnalysisMaker.h @@ -0,0 +1,32 @@ +#ifndef ST_FWD_ANALYSIS_MAKER_H +#define ST_FWD_ANALYSIS_MAKER_H + +#include "StChain/StMaker.h" +#include "TVector3.h" +// ROOT includes +#include "TNtuple.h" +#include "TTree.h" +// STL includes +#include +#include + +class StFwdTrack; + + +class StFwdAnalysisMaker : public StMaker { + + ClassDef(StFwdAnalysisMaker, 0); + + public: + StFwdAnalysisMaker(); + ~StFwdAnalysisMaker(){/* nada */}; + + int Init(); + int Finish(); + int Make(); + void Clear(const Option_t *opts = ""); + void ProcessFwdTracks(); + void ProcessFwdMuTracks(); +}; + +#endif diff --git a/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx b/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx index adbf5d6fb15..17c81fdc73d 100644 --- a/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx +++ b/StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx @@ -19,11 +19,17 @@ #include "StGenericVertexMaker/StGenericVertexMaker.h" #include "StGenericVertexMaker/StiPPVertex/StPPVertexFinder.h" #include "StGenericVertexMaker/StppLMVVertexFinder.h" -#include "StGenericVertexMaker/StvPPVertex/StPPVertexFinder.h" +#include "StGenericVertexMaker/StvPPVertex/StPPVertexFinder.h" #include "St_base/StMessMgr.h" #include "St_db_Maker/St_db_Maker.h" #include "tables/St_g2t_vertex_Table.h" +// Historical Note 10/17/23. Jason Webb +// ------------------------------------- +// The StvPPVertex appears to be an equivalent set of vertex +// finding algorithms using tracks from the StEvent data model +// rather than the internal data structures of the Sti tracker. + class StMuDst; class TClonesArray; @@ -140,8 +146,7 @@ Int_t StGenericVertexMaker::Init() useBTOF = 1; } - } else if ( IAttr("VFPPVEv") || IAttr("VFPPVEvNoBTof") - ||(IAttr("VFPPV") && IAttr("Stv")) ) { // 2 version of PPV w/ & w/o Btof + } else if ( IAttr("VFPPVEv") || IAttr("VFPPVEvNoBTof") ) { // 2 version of PPV w/ & w/o Btof LOG_INFO << "StGenericVertexMaker::Init: uses StvPPVertex finder(StEvent based)"<< endm; LOG_INFO << "StPPVertexFinder::StPPVertexFinder is in use" << endm; diff --git a/StRoot/StGenericVertexMaker/StiPPVertex/BtofHitList.cxx b/StRoot/StGenericVertexMaker/StiPPVertex/BtofHitList.cxx index 1dec5065f78..30f3fe42560 100644 --- a/StRoot/StGenericVertexMaker/StiPPVertex/BtofHitList.cxx +++ b/StRoot/StGenericVertexMaker/StiPPVertex/BtofHitList.cxx @@ -19,7 +19,7 @@ //========================================================== //========================================================== -BtofHitList::BtofHitList() : +BtofHitList::BtofHitList() : geometry(0), // phi, 60 bins // eta, 32*2 bins not with the same width, so eta0,deta are really not used ScintHitList(0.,M_PI/60,60, -0.9,0.028125,64,"Btof",4,0.75) diff --git a/StRoot/StJetMaker/StAnaPars.h b/StRoot/StJetMaker/StAnaPars.h index ecfab2d29ad..d160b00c1a5 100644 --- a/StRoot/StJetMaker/StAnaPars.h +++ b/StRoot/StJetMaker/StAnaPars.h @@ -28,6 +28,8 @@ class StAnaPars : public TObject { , useBemc(false) , useEemc(false) , useFms(false) + , useFcsECal(false) //Currently no track List Cuts + , useFcsHCal(false) , useMonteCarlo(false) , randomSelectorProb(1.0) , randomSelectorAt(false) @@ -74,6 +76,8 @@ class StAnaPars : public TObject { void addTpcCut(StjTrackCut* c) { mTpcCuts.addCut(c); } void addBemcCut(StjTowerEnergyCut* c) { mBemcCuts.addCut(c); } void addEemcCut(StjTowerEnergyCut* c) { mEemcCuts.addCut(c); } + void addFCSEcalemcCut(StjTowerEnergyCut* c) { mFCSECalemcCuts.addCut(c); } + void addFCSHcalhcCut(StjTowerEnergyCut* c) { mFCSHcalhcCuts.addCut(c); } void addMcCut(StjMCParticleCut* c) { mMcCuts.addCut(c); } void addJetCut(StProtoJetCut* c) { mJetCuts.addCut(c); } @@ -82,10 +86,12 @@ class StAnaPars : public TObject { // StjAbstractTower& changeTowers() { return *mChangeTowers; } StjAbstractTrackRegion& trackRegion() { return *mtrackRegion; } StjAbstractTowerRegion& towerRegion() { return *mtowerRegion; } - StjAbstractMCParticleRegion& particleRegion(){ return *mparticleRegion; } + StjAbstractMCParticleRegion& particleRegion() { return *mparticleRegion; } StjTrackListCut& tpcCuts() { return mTpcCuts; } StjTowerEnergyListCut& bemcCuts() { return mBemcCuts; } StjTowerEnergyListCut& eemcCuts() { return mEemcCuts; } + StjTowerEnergyListCut& FCSEcalemcCuts() { return mFCSECalemcCuts; } + StjTowerEnergyListCut& FCSHcalhcCuts() { return mFCSHcalhcCuts; } StjMCParticleListCut& mcCuts() { return mMcCuts; } StProtoJetListCut& jetCuts() { return mJetCuts; } @@ -99,6 +105,8 @@ class StAnaPars : public TObject { StjTrackListCut mTpcCuts; StjTowerEnergyListCut mBemcCuts; StjTowerEnergyListCut mEemcCuts; + StjTowerEnergyListCut mFCSECalemcCuts; + StjTowerEnergyListCut mFCSHcalhcCuts; StjMCParticleListCut mMcCuts; StProtoJetListCut mJetCuts; @@ -107,6 +115,8 @@ class StAnaPars : public TObject { bool useBemc; bool useEemc; bool useFms; + bool useFcsECal; + bool useFcsHCal; bool useMonteCarlo; double randomSelectorProb; double randomSelectorAt; diff --git a/StRoot/StJetMaker/StJetMaker2012.cxx b/StRoot/StJetMaker/StJetMaker2012.cxx index 366fa65b04c..ce897f5166b 100644 --- a/StRoot/StJetMaker/StJetMaker2012.cxx +++ b/StRoot/StJetMaker/StJetMaker2012.cxx @@ -21,6 +21,7 @@ #include "StjBEMCMuDst.h" #include "StjEEMCMuDst.h" #include "StjFMSMuDst.h" +#include "StjFCSMuDst.h" #include "StjMCMuDst.h" #include "StjTPCNull.h" #include "StjBEMCNull.h" @@ -37,6 +38,8 @@ #include "StMuTowerEmu.h" #include "StMcTrackEmu.h" +#include "StarGenerator/StarGenEventReader/StarGenEventReader.h" + #include "StSpinPool/StUeEvent/StUeOffAxisConesEvent.h" #include "StSpinPool/StUeEvent/StUeVertex.h" #include "StSpinPool/StUeEvent/StUeOffAxisConesJet.h" @@ -152,31 +155,55 @@ int StJetMaker2012::Make() // Get FMS towers StjTowerEnergyList fmsEnergyList; - if (jetbranch->anapars->useFms) { StjFMSMuDst fms; fmsEnergyList = fms.getEnergyList(); } + // Get FCS Towers + + StjTowerEnergyList fcsECalEnergyList; //FCS ECAL + if(jetbranch->anapars->useFcsECal){ + StjFCSMuDst fcsECal; + fcsECal.useECAL(); + fcsECalEnergyList = fcsECal.getEnergyList(); + fcsECalEnergyList = jetbranch->anapars->FCSEcalemcCuts()(fcsECalEnergyList); + + } + StjTowerEnergyList fcsHCalEnergyList; //FCS HCAL + if(jetbranch->anapars->useFcsHCal){ + StjFCSMuDst fcsHCal; + fcsHCal.useHCAL(); + fcsHCalEnergyList = fcsHCal.getEnergyList(); + fcsHCalEnergyList = jetbranch->anapars->FCSHcalhcCuts()(fcsHCalEnergyList); + + } + // Merge BEMC and EEMC towers StjTowerEnergyList energyList; copy(bemcEnergyList.begin(),bemcEnergyList.end(),back_inserter(energyList)); copy(eemcEnergyList.begin(),eemcEnergyList.end(),back_inserter(energyList)); copy(fmsEnergyList.begin(),fmsEnergyList.end(),back_inserter(energyList)); - - // Apply hadronic correction to towers - energyList = jetbranch->anapars->correctTowerEnergyForTracks()(energyList,trackList); - + + // Apply hadronic correction to towers + energyList = jetbranch->anapars->correctTowerEnergyForTracks()(energyList,trackList); + + //Merge FCS towers with general energyList + copy(fcsECalEnergyList.begin(),fcsECalEnergyList.end(),back_inserter(energyList)); + copy(fcsHCalEnergyList.begin(),fcsHCalEnergyList.end(),back_inserter(energyList)); + + // Currently no hadronic corrections to towers for FCS + // Convert tracks and towers to Lorentz vectors FourList tpc4pList = StjeTrackListToStMuTrackFourVecList()(trackList); FourList energy4pList = StjeTowerEnergyListToStMuTrackFourVecList()(energyList); - + // Merge tracks and towers StProtoJet::FourVecList particles; // vector copy(tpc4pList.begin(),tpc4pList.end(),back_inserter(particles)); - copy(energy4pList.begin(),energy4pList.end(),back_inserter(particles)); + copy(energy4pList.begin(),energy4pList.end(), back_inserter(particles)); // Run jet finder StJetFinder::JetList protojets; // list @@ -243,6 +270,25 @@ int StJetMaker2012::Make() StjFMSMuDst fms; fmsEnergyList = fms.getEnergyList(); } + + // Get FCS Towers + + StjTowerEnergyList fcsECalEnergyList; //FCS ECAL + if(jetbranch->anapars->useFcsECal){ + StjFCSMuDst fcsECal; + fcsECal.useECAL(); + fcsECalEnergyList = fcsECal.getEnergyList(); + fcsECalEnergyList = jetbranch->anapars->FCSEcalemcCuts()(fcsECalEnergyList); + + } + StjTowerEnergyList fcsHCalEnergyList; //FCS HCAL + if(jetbranch->anapars->useFcsHCal){ + StjFCSMuDst fcsHCal; + fcsHCal.useHCAL(); + fcsHCalEnergyList = fcsHCal.getEnergyList(); + fcsHCalEnergyList = jetbranch->anapars->FCSHcalhcCuts()(fcsHCalEnergyList); + + } // Merge BEMC and EEMC towers StjTowerEnergyList energyList; @@ -250,11 +296,13 @@ int StJetMaker2012::Make() copy(bemcEnergyList.begin(),bemcEnergyList.end(),back_inserter(energyList)); copy(eemcEnergyList.begin(),eemcEnergyList.end(),back_inserter(energyList)); copy(fmsEnergyList.begin(),fmsEnergyList.end(),back_inserter(energyList)); + copy(fcsECalEnergyList.begin(),fcsECalEnergyList.end(),back_inserter(energyList)); + copy(fcsHCalEnergyList.begin(),fcsHCalEnergyList.end(),back_inserter(energyList)); // Convert towers to Lorentz vectors FourList energy4pList = StjeTowerEnergyListToStMuTrackFourVecList()(energyList); - // Merge tracks and towers + // Merge tracks and towers StProtoJet::FourVecList particles; // vector copy(energy4pList.begin(),energy4pList.end(),back_inserter(particles)); @@ -283,13 +331,22 @@ int StJetMaker2012::Make() tpc.setVertexIndex(savedVertexIndex); } // End useTpc - + + if (jetbranch->anapars->useMonteCarlo) { - StjMCMuDst mc(this); - StjPrimaryVertex mcvertex = mc.getMCVertex(); - StjMCParticleList mcparticles = jetbranch->anapars->mcCuts()(mc.getMCParticleList()); - StProtoJet::FourVecList particles; // vector - transform(mcparticles.begin(),mcparticles.end(),back_inserter(particles),StjMCParticleToStMuTrackFourVec()); + + StjMCMuDst mc(this); + + if(GetMaker("genEvent")){ // To be used with .genevent.root for MC particle from StarGenEventReader + eventreader = (StarGenEventReader*)GetMaker("genEvent"); + sEvent = eventreader->Event(); + mc.setGenEvent(sEvent); // In case no geant on chain + } + + StjPrimaryVertex mcvertex = mc.getMCVertex(); + StjMCParticleList mcparticles = jetbranch->anapars->mcCuts()(mc.getMCParticleList()); + StProtoJet::FourVecList particles; // vector + transform(mcparticles.begin(),mcparticles.end(),back_inserter(particles),StjMCParticleToStMuTrackFourVec()); // Run jet finder StJetFinder::JetList protojets; // list diff --git a/StRoot/StJetMaker/StJetMaker2012.h b/StRoot/StJetMaker/StJetMaker2012.h index aafa03bf0aa..345f79bd070 100644 --- a/StRoot/StJetMaker/StJetMaker2012.h +++ b/StRoot/StJetMaker/StJetMaker2012.h @@ -19,6 +19,9 @@ #include "StSpinPool/StUeEvent/StUeOffAxisConesEvent.h" +class StarGenEvent; +class StarGenEventReader; + class StOffAxisConesPars : public TObject{ public: StOffAxisConesPars() : mConeR(0.5){ @@ -56,6 +59,10 @@ class StJetMaker2012 : public StJetMaker2009 { StUeOffAxisConesEvent* eventUe(const char* branchname); protected: + + StarGenEventReader *eventreader; + StarGenEvent *sEvent; + double DeltaR(double etaA, double phiA, double etaB, double phiB); double addJetUe(StProtoJet::FourVecList particles, StUeOffAxisConesEvent *ueEvent, const StProtoJet &jet, double radius = 0.5); diff --git a/StRoot/StJetMaker/macros/RunJetFinder2012pro_fcs.C b/StRoot/StJetMaker/macros/RunJetFinder2012pro_fcs.C new file mode 100644 index 00000000000..4b53c7110e7 --- /dev/null +++ b/StRoot/StJetMaker/macros/RunJetFinder2012pro_fcs.C @@ -0,0 +1,246 @@ +void RunJetFinder2012pro_fcs(int nevents = 100, +const char* indir = "./", +const char* MuDst = "_e45.MuDst.root", +const char* Jetfile = "test.jets.root", +const char* Uefile = "test.ueoc.root", +const char* Skimfile = "test.skim.root", +const char* geneventfile = "pi+_e45.vz0.run0.genevent.root") +{ + + + cout<<"MuDst file is "<Macro("loadMuDst.C"); + gROOT->Macro("LoadLogger.C"); + + gSystem->Load("StDetectorDbMaker"); + gSystem->Load("StTpcDb"); + gSystem->Load("StDbUtilities"); + gSystem->Load("StMcEvent"); + gSystem->Load("StMcEventMaker"); + gSystem->Load("StDaqLib"); + gSystem->Load("StEmcRawMaker"); + gSystem->Load("StEmcADCtoEMaker"); + gSystem->Load("StEmcSimulatorMaker"); + gSystem->Load("StDbBroker"); + gSystem->Load("St_db_Maker"); + gSystem->Load("StEEmcUtil"); + gSystem->Load("StEEmcDbMaker"); + gSystem->Load("StSpinDbMaker"); + gSystem->Load("StEmcTriggerMaker"); + gSystem->Load("StTriggerUtilities"); + gSystem->Load("StMCAsymMaker"); + gSystem->Load("StRandomSelector"); + gSystem->Load("libfastjet.so"); + gSystem->Load("libsiscone.so"); + gSystem->Load("libsiscone_spherical.so"); + gSystem->Load("libfastjetplugins.so"); + + gSystem->Load("StJetFinder"); + gSystem->Load("StJetSkimEvent"); + gSystem->Load("StJets"); + gSystem->Load("StJetEvent"); + gSystem->Load("StUeEvent"); + gSystem->Load("StJetMaker"); + + gSystem->Load("libMinuit.so"); + + gSystem->Load("StFcsUtil"); + gSystem->Load("StFcsDbMaker"); + + gSystem->Load( "libVMC.so"); + gSystem->Load( "St_g2t.so" ); + gSystem->Load( "St_geant_Maker.so" ); + + gSystem->Load( "StarGeneratorUtil.so" ); + gSystem->Load( "StarGeneratorEvent.so" ); + gSystem->Load( "StarGeneratorBase.so" ); + + gSystem->Load( "libMathMore.so" ); + gSystem->Load( "libStarGenEventReader.so" ); + + + StChain *chain = new StChain; + + // I/O maker to be used with .geant.root MC truth information + +// StIOMaker* ioMaker = new StIOMaker; +// ioMaker->SetFile(geantFile); //add as input parameter +// ioMaker->SetIOMode("r"); +// ioMaker->SetBranch("*",0,"0"); // Deactivate all branches +// ioMaker->SetBranch("genevents",0,"r"); // Activate geant Branch +// ioMaker->SetBranch("geantBranch",0,"r"); // Activate geant Branch + + // Truth Particle information under new StarGenerator format + if(geneventfile){ + StarGenEventReader *eventreader = new StarGenEventReader("genEvent"); + eventreader->SetInputFile(geneventfile,"genevents","primaryEvent"); + } + + // MuDst reader + StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,indir, MuDst,"",1000,"MuDst"); + + // MuDst DB + StMuDbReader* muDstDb = StMuDbReader::instance(); + +// StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker; +// //JP0 +// filterMaker->addTrigger(380401); +// //JP1 +// filterMaker->addTrigger(380402); +// //JP2 +// filterMaker->addTrigger(380403); +// //AJP +// filterMaker->addTrigger(380404); + + // star database + St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb"); +// starDb->SetDateTime(20090628,53220); + + // FCS DB Maker + StFcsDbMaker* fcsdbMaker = new StFcsDbMaker; + + // Endcap database + StEEmcDbMaker* eemcDb = new StEEmcDbMaker; + + // star spin database + StSpinDbMaker* spinDb = new StSpinDbMaker; + + // Barrel ADC to energy maker + StEmcADCtoEMaker* adc = new StEmcADCtoEMaker; + adc->saveAllStEvent(true); + + // FMS no longer in use + // StFmsDbMaker* fmsDb = new StFmsDbMaker; + // StFmsHitMaker* fmshitMk = new StFmsHitMaker(); + // StFmsPointMaker* fmsptMk = new StFmsPointMaker("StFmsPointMaker"); + +// StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker; +// simuTrig->useOnlineDB(); +// simuTrig->setMC(0); +// //simuTrig->useBbc(); +// simuTrig->useBemc(); +// simuTrig->useEemc(); +// simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline); +// + StJetSkimEventMaker* skimEventMaker = new StJetSkimEventMaker("StJetSkimEventMaker", muDstMaker, Skimfile); + + // Get Pythia record + StMCAsymMaker* asym = new StMCAsymMaker; + + +//------------------------------------------------------------------------------------ + // StJetMaker2012 + StJetMaker2012* jetmaker = new StJetMaker2012; + jetmaker->setJetFile(Jetfile); + jetmaker->setJetFileUe(Uefile); + +//------------------------------------------------------------------------------------ + //StAnaPars Detect Level + StAnaPars* anapars12 = new StAnaPars; + anapars12->useTpc = true; + anapars12->useBemc = false; + anapars12->useEemc = false; + anapars12->useFms = false; + anapars12->useFcsECal = true; + anapars12->useFcsHCal = true; + anapars12->randomSelectorProb = 1.00; + + // The classes available for correcting tower energy for tracks are: + // 1. StjTowerEnergyCorrectionForTracksMip + // 2. StjTowerEnergyCorrectionForTracksFraction + // 3. StjTowerEnergyCorrectionForTracksNull (default: no correction) + anapars12->setTowerEnergyCorrection(new StjTowerEnergyCorrectionForTracksFraction(1.00)); + + //TPC Cuts + anapars12->addTpcCut(new StjTrackCutFlag(0)); + anapars12->addTpcCut(new StjTrackCutNHits(12)); + anapars12->addTpcCut(new StjTrackCutPossibleHitRatio(0.51)); + anapars12->addTpcCut(new StjTrackCutDca(3)); + + //DcaD pT dependent cut for pp200 run9 + // anapars12->addTpcCut(new StjTrackCutDcaPtDependent); + //DcaT pT dependent cut for pp500 run11, run12 + anapars12->addTpcCut(new StjTrackCutTdcaPtDependent); + //Don't Need Chi2 cut for Run12 either + //anapars12->addTpcCut(new StjTrackCutChi2(0,4)); + anapars12->addTpcCut(new StjTrackCutPt(.2,200)); + anapars12->addTpcCut(new StjTrackCutEta(-2.5,2.5)); + anapars12->addTpcCut(new StjTrackCutLastPoint(125)); + + // BEMC cuts + anapars12->addBemcCut(new StjTowerEnergyCutBemcStatus(1)); + anapars12->addBemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS + anapars12->addBemcCut(new StjTowerEnergyCutEt(0.2)); + + // EEMC cuts + anapars12->addEemcCut(new StjTowerEnergyCutBemcStatus(1)); + anapars12->addEemcCut(new StjTowerEnergyCutAdc(4,3)); // ADC-ped>4 AND ADC-ped>3*RMS + anapars12->addEemcCut(new StjTowerEnergyCutEt(0.2)); + + // FCS Cuts +// anapars12->addFCSEcalemcCut(new StjTowerEnergyCutEt(0.1)); +// anapars12->addFCSHcalhcCut(new StjTowerEnergyCutEt(0.1)); + + anapars12->addFCSEcalemcCut(new StjTowerEnergyCutEnergy(0.1)); + anapars12->addFCSHcalhcCut(new StjTowerEnergyCutEnergy(0.1)); + + // Jet cuts +// anapars12->addJetCut(new StProtoJetCutPt(1.5,1000000)); + anapars12->addJetCut(new StProtoJetCutEta(-100,100)); + +//------------------------------------------------------------------------------------ + + + // Set analysis cuts for particle jets branch + StAnaPars* anaparsParticle = new StAnaPars; + anaparsParticle->useMonteCarlo = true; + + // MC cuts + anaparsParticle->addMcCut(new StjMCParticleCutStatus(1)); // final state particles + + // Jet cuts + anaparsParticle->addJetCut(new StProtoJetCutPt(1.5,1000000)); + anaparsParticle->addJetCut(new StProtoJetCutEta(-100,100)); + +//------------------------------------------------------------------------------------ + + // Jet Area + StFastJetAreaPars *JetAreaPars = new StFastJetAreaPars; + + //Anti-kT R=0.6 for run12 jet finding + StFastJetPars* AntiKtR050Pars = new StFastJetPars; + AntiKtR050Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm); + AntiKtR050Pars->setRparam(0.5); // 0.6 + AntiKtR050Pars->setRecombinationScheme(StFastJetPars::E_scheme); + AntiKtR050Pars->setStrategy(StFastJetPars::Best); + AntiKtR050Pars->setPtMin(.1); + AntiKtR050Pars->setJetArea(JetAreaPars); + + //Anti-kT R=0.5 for run12 jet finding + StFastJetPars* AntiKtR040Pars = new StFastJetPars; + AntiKtR040Pars->setJetAlgorithm(StFastJetPars::antikt_algorithm); + AntiKtR040Pars->setRparam(0.4); // 0.5 + AntiKtR040Pars->setRecombinationScheme(StFastJetPars::E_scheme); + AntiKtR040Pars->setStrategy(StFastJetPars::Best); + AntiKtR040Pars->setPtMin(.1); + AntiKtR040Pars->setJetArea(JetAreaPars); + + jetmaker->addBranch("AntiKtR050NHits12",anapars12,AntiKtR050Pars); + jetmaker->addBranch("AntiKtR040NHits12",anapars12,AntiKtR040Pars); + jetmaker->addBranch("AntiKtR050Particle",anaparsParticle,AntiKtR050Pars); + jetmaker->addBranch("AntiKtR040Particle",anaparsParticle,AntiKtR040Pars); + StOffAxisConesPars *off050 = new StOffAxisConesPars(0.5); + StOffAxisConesPars *off060 = new StOffAxisConesPars(0.6); + jetmaker->addUeBranch("OffAxisConesR050", off050); + jetmaker->addUeBranch("OffAxisConesR060", off060); + + // Run + chain->Init(); + chain->EventLoop(nevents); +} diff --git a/StRoot/StJetMaker/mudst/StjFCSMuDst.cxx b/StRoot/StJetMaker/mudst/StjFCSMuDst.cxx new file mode 100644 index 00000000000..ba7ab3def33 --- /dev/null +++ b/StRoot/StJetMaker/mudst/StjFCSMuDst.cxx @@ -0,0 +1,115 @@ +#include "StjFCSMuDst.h" + +#include "StMaker.h" +#include "StChain.h" +#include "StMuDSTMaker/COMMON/StMuDst.h" +#include "StMuDSTMaker/COMMON/StMuEvent.h" +#include "StMuDSTMaker/COMMON/StMuEmcCollection.h" + +#include "StMuDSTMaker/COMMON/StMuFcsCollection.h" +#include "StMuDSTMaker/COMMON/StMuFcsHit.h" + +#include "StFcsDbMaker/StFcsDbMaker.h" +#include "StFcsDbMaker/StFcsDb.h" +#include "StEventTypes.h" +#include "StEvent/StEvent.h" +#include "StEvent/StFcsCollection.h" +#include "StEvent/StFcsHit.h" +#include "StEvent/StFcsPoint.h" +#include "StMuDSTMaker/COMMON/StMuTypes.hh" + +#include +#include +#include "StMessMgr.h" +#include "StEventTypes.h" +using namespace std; + +StjFCSMuDst::StjFCSMuDst() +{ + _setVertex = false; + + _vx = 0.0; + _vy = 0.0; + _vz = 0.0; + + useECal = false; + useHCal = false; + + mFcsDb = nullptr; + StMaker* chain = StMaker::GetChain(); + if (chain) { + if(chain->GetDataSet("fcsDb")){ + mFcsDb = static_cast(chain->GetDataSet("fcsDb")); + mFcsDb->setDbAccess(0); + }else{ + LOG_ERROR << "No fcdDb found in chain. Please initialize StFcsDbMaker within your chain." << endm; + } + } + if (!chain) { + LOG_ERROR << "StjFCSMuDst Initializing failed due to missing chain." << endm; + } +} + +StjTowerEnergyList StjFCSMuDst::getEnergyList(){ + StjTowerEnergyList fcsEnergyList; + + mMuFcsColl = StMuDst::muFcsCollection(); + + if(mMuFcsColl->numberOfHits()!=0){ + + StjTowerEnergy energyDeposit; + for(int det = 0; det <= kFcsHcalSouthDetId; det++){ + + int nhits = mMuFcsColl->numberOfHits(det); + int det_hit_index = mMuFcsColl->indexOfFirstHit(det); + + for(int hit_i = 0 ; hit_i < nhits; hit_i++){ + + int hit_index = hit_i + det_hit_index; + StMuFcsHit* hit = mMuFcsColl->getHit(hit_index); + + if(det <= 1 && useECal){ + fcsEnergyList.push_back(hitenergyDeposit(*hit)); + } + if(det >= 2 && useHCal){ + fcsEnergyList.push_back(hitenergyDeposit(*hit)); + } + + }// Hit loop + + }//Det Loop + } + + return fcsEnergyList; +} + +StjTowerEnergy StjFCSMuDst::hitenergyDeposit(const StMuFcsHit& hit){ + StjTowerEnergy energyDeposit; + + StThreeVectorD xyz = mFcsDb->getStarXYZ(hit.detectorId(),hit.id()); + + float x = xyz.x(); + float y = xyz.y(); + float z = xyz.z(); + + energyDeposit.runNumber = StMuDst::event()->runId(); + energyDeposit.eventId = StMuDst::event()->eventId(); + + energyDeposit.towerId = hit.id(); + energyDeposit.detectorId = hit.detectorId(); + energyDeposit.towerR = TMath::Sqrt(x*x + y*y); + energyDeposit.towerEta = xyz.pseudoRapidity(); + energyDeposit.towerPhi = xyz.phi(); + energyDeposit.vertexX = _vx; + energyDeposit.vertexY = _vy; + energyDeposit.vertexZ = _vz; + energyDeposit.energy = hit.energy(); + energyDeposit.adc = hit.adcSum(); + energyDeposit.pedestal = 0; + energyDeposit.rms = 0; + energyDeposit.status = 1; + + return energyDeposit; +} + + diff --git a/StRoot/StJetMaker/mudst/StjFCSMuDst.h b/StRoot/StJetMaker/mudst/StjFCSMuDst.h new file mode 100644 index 00000000000..1d9cbf74350 --- /dev/null +++ b/StRoot/StJetMaker/mudst/StjFCSMuDst.h @@ -0,0 +1,51 @@ + +#ifndef STJFCSMUDST_H +#define STJFCSMUDST_H + +#include "StjFCS.h" + +//FCS +class StFcsCollection; +class StMuFcsCollection; +class StFcsDbMaker; +class StMuDstMaker; +class StFcsDb; +class StMuFcsHit; + +class StjFCSMuDst : public StjFCS { + +public: + StjFCSMuDst(); + virtual ~StjFCSMuDst() {} + + void setVertex(double vx, double vy, double vz) + { + _setVertex = true; + _vx = vx; + _vy = vy; + _vz = vz; + }; + void useECAL(){useECal = true;}; + void useHCAL(){useHCal = true;}; + + StjTowerEnergyList getEnergyList(); + StjTowerEnergy hitenergyDeposit(const StMuFcsHit& hit); + +private: + + StFcsDbMaker* mFcsDbMaker; + StFcsCollection* mFcsColl; + StMuFcsCollection* mMuFcsColl; + StFcsDb* mFcsDb=0; + + bool _setVertex; + + double _vx; + double _vy; + double _vz; + + bool useECal; + bool useHCal; +}; + +#endif //STJFCSMUDST_H diff --git a/StRoot/StJetMaker/mudst/StjMCMuDst.cxx b/StRoot/StJetMaker/mudst/StjMCMuDst.cxx index c4b35e04b68..72e2c4e164e 100644 --- a/StRoot/StJetMaker/mudst/StjMCMuDst.cxx +++ b/StRoot/StJetMaker/mudst/StjMCMuDst.cxx @@ -12,6 +12,8 @@ #include #include +#include "StarGenerator/StarGenEventReader/StarGenEventReader.h" +#include "StarGenerator/EVENT/StarGenParticle.h" StjPrimaryVertex StjMCMuDst::getMCVertex() const { @@ -22,7 +24,7 @@ StjPrimaryVertex StjMCMuDst::getMCVertex() const if (const g2t_vertex_st* g2t_vertex_table = g2t_vertex_descriptor->GetTable()) { const float* geantvertex = g2t_vertex_table[0].ge_x; - vertex.mPosition.SetXYZ(geantvertex[0],geantvertex[1],geantvertex[2]); + vertex.mPosition.SetXYZ(geantvertex[0],geantvertex[1],geantvertex[2]); } } return vertex; @@ -81,7 +83,45 @@ StjMCParticleList StjMCMuDst::getMCParticleList() } } } - } + }else if(genEvent){ + + LOG_INFO <<"There is no geant in _maker. Proceed with Particle info from StarGenEventReader. " << endm; + + StarGenParticle* particle = 0; + + int nparts = genEvent->GetNumberOfParticles(); + + int runNumber = -1; + int eventNumber = -1; + runNumber = genEvent->GetRunNumber(); + eventNumber = genEvent->GetEventNumber(); + + for(int ipar = 0; ipar < nparts; ipar++){ + particle = (StarGenParticle*)(genEvent->operator[](ipar)); + + StjMCParticle mcParticle; + mcParticle.runNumber = runNumber; + mcParticle.eventId = eventNumber; + + mcParticle.status = particle->GetStatus(); + mcParticle.mcparticleId = ipar+1; + mcParticle.pdg = particle->GetId(); + mcParticle.firstMotherId = particle->GetFirstMother(); + mcParticle.lastMotherId = particle->GetLastMother(); + mcParticle.firstDaughterId = particle->GetFirstDaughter(); + mcParticle.lastDaughterId = particle->GetLastDaughter(); + mcParticle.vertexZ = particle->GetVz(); + + TLorentzVector p4 = particle->momentum(); + mcParticle.pt = p4.Pt(); + mcParticle.eta = p4.Eta(); + mcParticle.phi = p4.Phi(); + mcParticle.m = p4.M(); + mcParticle.e = p4.E(); + + theList.push_back(mcParticle); + } + } return theList; } diff --git a/StRoot/StJetMaker/mudst/StjMCMuDst.h b/StRoot/StJetMaker/mudst/StjMCMuDst.h index cca51fffad6..fb62a20042c 100644 --- a/StRoot/StJetMaker/mudst/StjMCMuDst.h +++ b/StRoot/StJetMaker/mudst/StjMCMuDst.h @@ -7,6 +7,9 @@ #include class StMaker; +class StarGenEvent; +class StarGenEventReader; +class StarGenParticle; class StjMCMuDst : public StjMC { @@ -17,11 +20,14 @@ class StjMCMuDst : public StjMC { StjPrimaryVertex getMCVertex() const; StjMCParticleList getMCParticleList(); + void setGenEvent(StarGenEvent* ev){genEvent = ev;}; private: StMaker* _maker; - + StarGenEvent* genEvent; }; #endif // STJMCMUDST_H + + diff --git a/StRoot/StJetMaker/towers/StjFCS.cxx b/StRoot/StJetMaker/towers/StjFCS.cxx new file mode 100644 index 00000000000..de9cc27925a --- /dev/null +++ b/StRoot/StJetMaker/towers/StjFCS.cxx @@ -0,0 +1,4 @@ + +#include "StjFCS.h" + +ClassImp(StjFCS) diff --git a/StRoot/StJetMaker/towers/StjFCS.h b/StRoot/StJetMaker/towers/StjFCS.h new file mode 100644 index 00000000000..31e082a5752 --- /dev/null +++ b/StRoot/StJetMaker/towers/StjFCS.h @@ -0,0 +1,21 @@ +#ifndef STJFCS_H +#define STJFCS_H + +#include + +#include "StjTowerEnergyList.h" + +class StjFCS : public TObject { + +public: + StjFCS() {} + virtual ~StjFCS() {} + + virtual void Init() {} + + virtual StjTowerEnergyList getEnergyList() = 0; + + ClassDef(StjFCS, 1) +}; + +#endif //STJFCS_H diff --git a/StRoot/StMuDSTMaker/COMMON/StMuArrays.cxx b/StRoot/StMuDSTMaker/COMMON/StMuArrays.cxx index 72387ac0551..c8aae039ebb 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuArrays.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuArrays.cxx @@ -28,10 +28,11 @@ const char* StMuArrays::arrayNames [__NALLARRAYS__ ] = {"MuEvent","PrimaryVer "EEmcPrs","EEmcSmdu","EEmcSmdv", /*pmdArrayNames [__NPMDARRAYS__ ]*/ "PmdHit","CpvHit", "PmdCluster", "CpvCluster", /*fmsArrayNames [__NFMSARRAYS__ ]*/ "FmsHit","FmsCluster","FmsPoint","FmsInfo", -/*rhicfArrayNames [__NRHICFARRAYS__ ]*/ "RHICfRawHit","RHICfHit","RHICfPoint", +/*rhicfArrayNames [__NRHICFARRAYS__ ]*/ "RHICfRawHit","RHICfHit","RHICfPoint", /*fcsArrayNames [__NFCSARRAYS__ ]*/ "FcsHit","FcsCluster","FcsPoint", "FcsInfo", /*fttArrayNames [__NFTTARRAYS__ ]*/ "FttRawHit","FttCluster","FttPoint", /*fstArrayNames [__NFSTARRAYS__ ]*/ "FstRawHit", "FstHit", +/*fwdTrackArrayNames [__NFWDTRACKARRAYS__ ]*/ "FwdTrack", /*tofArrayNames [__NTOFARRAYS__ ]*/ "TofHit","TofData", "TofRawData", /*btofArrayNames [__NBTOFARRAYS__ ]*/ "BTofHit","BTofRawHit","BTofHeader", // dongx /*etofArrayNames [__NETOFARRAYS__ ]*/ "ETofDigi","ETofHit","ETofHeader", // jdb @@ -53,7 +54,8 @@ const char** StMuArrays::rhicfArrayNames = StMuArrays::fmsArrayNames +__NFMSARR const char** StMuArrays::fcsArrayNames = StMuArrays::rhicfArrayNames +__NRHICFARRAYS__; const char** StMuArrays::fttArrayNames = StMuArrays::fcsArrayNames +__NFCSARRAYS__; const char** StMuArrays::fstArrayNames = StMuArrays::fttArrayNames +__NFTTARRAYS__; -const char** StMuArrays::tofArrayNames = StMuArrays::fstArrayNames +__NFSTARRAYS__; +const char** StMuArrays::fwdTrackArrayNames = StMuArrays::fstArrayNames +__NFSTARRAYS__; +const char** StMuArrays::tofArrayNames = StMuArrays::fwdTrackArrayNames +__NFWDTRACKARRAYS__; const char** StMuArrays::btofArrayNames = StMuArrays::tofArrayNames +__NTOFARRAYS__; // dongx const char** StMuArrays::etofArrayNames = StMuArrays::btofArrayNames +__NBTOFARRAYS__; // jdb const char** StMuArrays::epdArrayNames = StMuArrays::etofArrayNames +__NETOFARRAYS__; // MALisa @@ -80,10 +82,11 @@ const char* StMuArrays::arrayTypes [__NALLARRAYS__ ] = {"StMuEvent","StMuPrim "StMuEmcHit","StMuEmcHit","StMuEmcHit","StMuEmcHit","StMuEmcHit", /*pmdArrayTypes [__NPMDARRAYS__ ]*/ "StMuPmdHit","StMuPmdHit","StMuPmdCluster","StMuPmdCluster", /*fmsArrayTypes [__NFMSARRAYS__ ]*/ "StMuFmsHit","StMuFmsCluster","StMuFmsPoint","StMuFmsInfo", -/*rhicfArrayTypes [__NRHICfARRAYS__ ]*/ "StMuRHICfRawHit","StMuRHICfHit","StMuRHICfPoint", +/*rhicfArrayTypes [__NRHICfARRAYS__ ]*/ "StMuRHICfRawHit","StMuRHICfHit","StMuRHICfPoint", /*fcsArrayTypes [__NFCSARRAYS__ ]*/ "StMuFcsHit","StMuFcsCluster","StMuFcsPoint","StMuFcsInfo", /*fttArrayTypes [__NFTTARRAYS__ ]*/ "StMuFttRawHit","StMuFttCluster","StMuFttPoint", /*fstArrayTypes [__NFSTARRAYS__ ]*/ "StMuFstRawHit","StMuFstHit", +/*fwdTrackArrayTypes [__NFWDTRACKARRAYS__ ]*/ "StMuFwdTrack", /*tofArrayTypes [__NTOFARRAYS__ ]*/ "StMuTofHit","StTofData","StTofRawData", /*btofArrayTypes [__NBTOFARRAYS__ ]*/ "StMuBTofHit","StBTofRawHit","StBTofHeader", // dongx /*etofArrayTypes [__NETOFARRAYS__ ]*/ "StMuETofDigi","StMuETofHit","StMuETofHeader", // jdb+fseck @@ -104,7 +107,8 @@ const char** StMuArrays::rhicfArrayTypes = StMuArrays::fmsArrayTypes +__NFMSAR const char** StMuArrays::fcsArrayTypes = StMuArrays::rhicfArrayTypes +__NRHICFARRAYS__; const char** StMuArrays::fttArrayTypes = StMuArrays::fcsArrayTypes +__NFCSARRAYS__; const char** StMuArrays::fstArrayTypes = StMuArrays::fttArrayTypes +__NFTTARRAYS__; -const char** StMuArrays::tofArrayTypes = StMuArrays::fstArrayTypes +__NFSTARRAYS__; +const char** StMuArrays::fwdTrackArrayTypes = StMuArrays::fstArrayTypes +__NFSTARRAYS__; +const char** StMuArrays::tofArrayTypes = StMuArrays::fwdTrackArrayTypes +__NFWDTRACKARRAYS__; const char** StMuArrays::btofArrayTypes = StMuArrays::tofArrayTypes +__NTOFARRAYS__; // dongx const char** StMuArrays::etofArrayTypes = StMuArrays::btofArrayTypes +__NBTOFARRAYS__; // jdb const char** StMuArrays::epdArrayTypes = StMuArrays::etofArrayTypes +__NETOFARRAYS__; // MALisa @@ -125,10 +129,11 @@ int StMuArrays::arraySizes [__NALLARRAYS__ ] = {1,10,1000,1000,1000,1 /*emcArraySizes [__NEMCARRAYS__ ]*/ 1,1000,1000,1000,1000,1000,1000, /*pmdArraySizes [__NPMDARRAYS__ ]*/ 1000,1000,1000,1000, /*fmsArraySizes [__NFMSARRAYS__ ]*/ 1,1,1,1, -/*rhicfArraySizes [__NRHICFARRAYS__ ]*/ 1,1,1, +/*rhicfArraySizes [__NRHICFARRAYS__ ]*/ 1,1,1, /*fcsArraySizes [__NFCSARRAYS__ ]*/ 1,1,1,1, /*fttArraySizes [__NFTTARRAYS__ ]*/ 1,1,1, /*fstArraySizes [__NFSTARRAYS__ ]*/ 1,1, +/*fwdTrackArraySizes [__NFWDTRACKARRAYS__ ]*/ 1, /*tofArraySizes [__NTOFARRAYS__ ]*/ 100, 200, 1000, /*btofArraySizes [__NBTOFARRAYS__ ]*/ 1000,1000,1, // dongx /*etofArraySizes [__NETOFARRAYS__ ]*/ 1000,1000,1, // jdb @@ -149,7 +154,8 @@ int* StMuArrays::rhicfArraySizes = StMuArrays::fmsArraySizes +__NFMSARRAYS__; int* StMuArrays::fcsArraySizes = StMuArrays::rhicfArraySizes +__NRHICFARRAYS__; int* StMuArrays::fttArraySizes = StMuArrays::fcsArraySizes +__NFCSARRAYS__; int* StMuArrays::fstArraySizes = StMuArrays::fttArraySizes +__NFTTARRAYS__; -int* StMuArrays::tofArraySizes = StMuArrays::fstArraySizes +__NFSTARRAYS__; +int* StMuArrays::fwdTrackArraySizes = StMuArrays::fstArraySizes +__NFSTARRAYS__; +int* StMuArrays::tofArraySizes = StMuArrays::fwdTrackArraySizes +__NFWDTRACKARRAYS__; int* StMuArrays::btofArraySizes = StMuArrays::tofArraySizes +__NTOFARRAYS__; // dongx int* StMuArrays::etofArraySizes = StMuArrays::btofArraySizes +__NBTOFARRAYS__; // jdb int* StMuArrays::epdArraySizes = StMuArrays::etofArraySizes +__NETOFARRAYS__; // MALisa @@ -167,10 +173,11 @@ int StMuArrays::arrayCounters [__NALLARRAYS__ ] = {0,0,0,0,0,0,0,0,0,0,0 /*emcArrayCounters [__NEMCARRAYS__ ]*/ 0,0,0,0,0,0,0, /*pmdArrayCounters [__NPMDARRAYS__ ]*/ 0,0,0,0, /*fmsArrayCounters [__NFMSARRAYS__ ]*/ 0,0,0,0, -/*rhicfArrayCounters [__NRHICFARRAYS__ ]*/ 0,0,0, +/*rhicfArrayCounters [__NRHICFARRAYS__ ]*/ 0,0,0, /*fcsArrayCounters [__NFCSARRAYS__ ]*/ 0,0,0,0, /*fttArrayCounters [__NFTTARRAYS__ ]*/ 0,0,0, /*fstArrayCounters [__NFSTARRAYS__ ]*/ 0,0, +/*fwdTrackArrayCounters [__NFWDTRACKARRAYS__ ]*/ 0, /*tofArrayCounters [__NTOFARRAYS__ ]*/ 0, 0, 0, /*btofArrayCounters [__NBTOFARRAYS__ ]*/ 0, 0, 0, // dongx /*etofArrayCounters [__NETOFARRAYS__ ]*/ 0, 0, 0, // jdb @@ -193,7 +200,8 @@ int* StMuArrays::rhicfArrayCounters = StMuArrays::fmsArrayCounters +__NFMSARRA int* StMuArrays::fcsArrayCounters = StMuArrays::rhicfArrayCounters +__NRHICFARRAYS__; int* StMuArrays::fttArrayCounters = StMuArrays::fcsArrayCounters +__NFCSARRAYS__; int* StMuArrays::fstArrayCounters = StMuArrays::fttArrayCounters +__NFTTARRAYS__; -int* StMuArrays::tofArrayCounters = StMuArrays::fstArrayCounters +__NFSTARRAYS__; +int* StMuArrays::fwdTrackArrayCounters = StMuArrays::fstArrayCounters +__NFSTARRAYS__; +int* StMuArrays::tofArrayCounters = StMuArrays::fwdTrackArrayCounters +__NFWDTRACKARRAYS__; int* StMuArrays::btofArrayCounters = StMuArrays::tofArrayCounters +__NTOFARRAYS__; // dongx int* StMuArrays::etofArrayCounters = StMuArrays::btofArrayCounters +__NBTOFARRAYS__; // jdb int* StMuArrays::epdArrayCounters = StMuArrays::etofArrayCounters +__NETOFARRAYS__; // MALisa diff --git a/StRoot/StMuDSTMaker/COMMON/StMuArrays.h b/StRoot/StMuDSTMaker/COMMON/StMuArrays.h index af84ca38ece..0e1d6cc256d 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuArrays.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuArrays.h @@ -28,6 +28,8 @@ enum fcsTypes {muFcsHit=0, muFcsCluster, muFcsPoint, muFcsInfo}; enum fttTypes {muFttRawHit=0, muFttCluster, muFttPoint}; +enum fwdTrackTypes {muFwdTrack=0}; + enum fstTypes {muFstRawHit=0, muFstHit}; #ifndef __NO_STRANGE_MUDST__ /// @enum strangeTypes enumeration to to index the strangeArrays @@ -67,10 +69,11 @@ __NMCARRAYS__ =2, ///< size of the MCness arrays, i.e. number of TClonesArr __NEMCARRAYS__ =7 , ///< size of the emc arrays, i.e. number of TClonesArrays __NPMDARRAYS__ =4 , ///< size of the pmd arrays, i.e. number of TClonesArrays __NFMSARRAYS__ =4 , ///< size of the fms arrays, i.e. number of TClonesArrays -__NRHICFARRAYS__ =3 , ///< size of the RHICf arrays, i.e. number of TClonesArrays -__NFCSARRAYS__ =4 , ///< size of the fcs arrays, i.e. number of TClonesArrays -__NFTTARRAYS__ =3 , ///< size of the ftt arrays, i.e. number of TClonesArrays -__NFSTARRAYS__ =2 , ///< size of the fst arrays, i.e. number of TClonesArrays +__NRHICFARRAYS__ =3 , ///< size of the RHICf arrays, i.e. number of TClonesArrays +__NFCSARRAYS__ =4 , ///< size of the fcs arrays, i.e. number of TClonesArrays +__NFTTARRAYS__ =3 , ///< size of the ftt arrays, i.e. number of TClonesArrays +__NFSTARRAYS__ =2 , ///< size of the fst arrays, i.e. number of TClonesArrays +__NFWDTRACKARRAYS__ =1 , ///< size of the fwd track arrays, i.e. number of TClonesArrays // run 5 - dongx __NTOFARRAYS__ =3 , ///< size of the tof arrays > __NBTOFARRAYS__ =3 , /// dongx @@ -82,9 +85,9 @@ __NEZTARRAYS__ =5 , ///< size of the ez arrays > /// dongx #ifndef __NO_STRANGE_MUDST__ -__NALLARRAYS__ = __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NPMDARRAYS__+__NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__+__NEZTARRAYS__ +__NALLARRAYS__ = __NARRAYS__+__NSTRANGEARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NFWDTRACKARRAYS__+__NPMDARRAYS__+__NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__+__NEZTARRAYS__ #else -__NALLARRAYS__ = __NARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NPMDARRAYS__+__NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__+__NEZTARRAYS__ +__NALLARRAYS__ = __NARRAYS__+__NMCARRAYS__+__NEMCARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NFWDTRACKARRAYS__+__NPMDARRAYS__+__NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__+__NEZTARRAYS__ #endif }; class StMuArrays { @@ -100,10 +103,11 @@ class StMuArrays { static const char** emcArrayNames;//[__NEMCARRAYS__ ] static const char** pmdArrayNames;//[__NPMDARRAYS__ ] static const char** fmsArrayNames;//[__NFMSARRAYS__ ] - static const char** rhicfArrayNames;//[__NRHICFARRAYS__ ] + static const char** rhicfArrayNames;//[__NRHICFARRAYS__ ] static const char** fcsArrayNames;//[__NFCSARRAYS__ ] static const char** fttArrayNames;//[__NFTTARRAYS__ ] static const char** fstArrayNames;//[__NFSTARRAYS__ ] + static const char** fwdTrackArrayNames;//[__NFWDTRACKARRAYS__ ] static const char** tofArrayNames;//[__NTOFARRAYS__ ] static const char** btofArrayNames;//[__NBTOFARRAYS__ ] // dongx static const char** etofArrayNames;//[__NETOFARRAYS__ ] // jdb @@ -121,10 +125,11 @@ class StMuArrays { static const char** emcArrayTypes;// [__NEMCARRAYS__ ] static const char** pmdArrayTypes;// [__NPMDARRAYS__ ] static const char** fmsArrayTypes;// [__NFMSARRAYS__ ] - static const char** rhicfArrayTypes;// [__NRHICFARRAYS__ ] + static const char** rhicfArrayTypes;// [__NRHICFARRAYS__ ] static const char** fcsArrayTypes;// [__NFCSARRAYS__ ] static const char** fttArrayTypes;// [__NFTTARRAYS__ ] static const char** fstArrayTypes;// [__NFSTARRAYS__ ] + static const char** fwdTrackArrayTypes;// [__NFWDTRACKARRAYS__ ] static const char** tofArrayTypes;// [__NTOFARRAYS__ ] static const char** btofArrayTypes;// [__NBTOFARRAYS__ ] // dongx static const char** etofArrayTypes;// [__NETOFARRAYS__ ] // jdb @@ -142,10 +147,11 @@ class StMuArrays { static int* emcArraySizes;// [__NEMCARRAYS__ ] static int* pmdArraySizes;// [__NPMDARRAYS__ ] static int* fmsArraySizes;// [__NFMSARRAYS__ ] - static int* rhicfArraySizes;// [__NRHICfARRAYS__ ] + static int* rhicfArraySizes;// [__NRHICfARRAYS__ ] static int* fcsArraySizes;// [__NFCSARRAYS__ ] static int* fttArraySizes;// [__NFTTARRAYS__ ] static int* fstArraySizes;// [__NFSTARRAYS__ ] + static int* fwdTrackArraySizes;// [__NFWDTRACKARRAYS__ ] static int* tofArraySizes;// [__NTOFARRAYS__ ] static int* btofArraySizes;// [__NBTOFARRAYS__ ] // dongx static int* etofArraySizes;// [__NETOFARRAYS__ ] // jdb @@ -163,10 +169,11 @@ class StMuArrays { static int* emcArrayCounters;// [__NEMCARRAYS__ ] static int* pmdArrayCounters;// [__NPMDARRAYS__ ] static int* fmsArrayCounters;// [__NFMSARRAYS__ ] - static int* rhicfArrayCounters;// [__NRHICFARRAYS__ ] + static int* rhicfArrayCounters;// [__NRHICFARRAYS__ ] static int* fcsArrayCounters;// [__NFCSARRAYS__ ] static int* fttArrayCounters;// [__NFTTARRAYS__ ] static int* fstArrayCounters;// [__NFSTARRAYS__ ] + static int* fwdTrackArrayCounters;// [__NFWDTRACKARRAYS__ ] static int* tofArrayCounters;// [__NTOFARRAYS__ ] static int* btofArrayCounters;// [__NBTOFARRAYS__ ] // dongx static int* etofArrayCounters;// [__NETOFARRAYS__ ] // jdb diff --git a/StRoot/StMuDSTMaker/COMMON/StMuDst.cxx b/StRoot/StMuDSTMaker/COMMON/StMuDst.cxx index a633308e6c0..2849cf2e86c 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuDst.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuDst.cxx @@ -33,6 +33,7 @@ #include "StMuFcsUtil.h" #include "StMuFttUtil.h" #include "StMuFstUtil.h" +#include "StMuFwdTrackUtil.h" #include "StMuPmdUtil.h" ///dongx #include "StBTofCollection.h" @@ -62,36 +63,38 @@ TClonesArray** StMuDst::strangeArrays= 0; #endif #include "StMuMcVertex.h" #include "StMuMcTrack.h" -TClonesArray** StMuDst::mcArrays = 0; -TClonesArray** StMuDst::emcArrays = 0; -TClonesArray** StMuDst::fmsArrays = 0; -TClonesArray** StMuDst::rhicfArrays = 0; -TClonesArray** StMuDst::fcsArrays = 0; -TClonesArray** StMuDst::fttArrays = 0; -TClonesArray** StMuDst::fstArrays = 0; -TClonesArray** StMuDst::pmdArrays = 0; -TClonesArray** StMuDst::tofArrays = 0; -TClonesArray** StMuDst::btofArrays = 0; /// dongx -TClonesArray** StMuDst::etofArrays = 0; /// jdb -TClonesArray** StMuDst::epdArrays = 0; /// MALisa -TClonesArray** StMuDst::mtdArrays = 0; -TClonesArray** StMuDst::fgtArrays = 0; -TClonesArray *StMuDst::mMuEmcCollectionArray = 0; -StMuEmcCollection *StMuDst::mMuEmcCollection = 0; -StMuFmsCollection *StMuDst::mMuFmsCollection = 0; +TClonesArray** StMuDst::mcArrays = 0; +TClonesArray** StMuDst::emcArrays = 0; +TClonesArray** StMuDst::fmsArrays = 0; +TClonesArray** StMuDst::rhicfArrays = 0; +TClonesArray** StMuDst::fcsArrays = 0; +TClonesArray** StMuDst::fttArrays = 0; +TClonesArray** StMuDst::fstArrays = 0; +TClonesArray** StMuDst::fwdTrackArrays = 0; +TClonesArray** StMuDst::pmdArrays = 0; +TClonesArray** StMuDst::tofArrays = 0; +TClonesArray** StMuDst::btofArrays = 0; /// dongx +TClonesArray** StMuDst::etofArrays = 0; /// jdb +TClonesArray** StMuDst::epdArrays = 0; /// MALisa +TClonesArray** StMuDst::mtdArrays = 0; +TClonesArray** StMuDst::fgtArrays = 0; +TClonesArray *StMuDst::mMuEmcCollectionArray = 0; +StMuEmcCollection *StMuDst::mMuEmcCollection = 0; +StMuFmsCollection *StMuDst::mMuFmsCollection = 0; StMuRHICfCollection *StMuDst::mMuRHICfCollection = 0; -StMuFcsCollection *StMuDst::mMuFcsCollection = 0; -StMuFttCollection *StMuDst::mMuFttCollection = 0; -StMuFstCollection *StMuDst::mMuFstCollection = 0; -TClonesArray *StMuDst::mMuPmdCollectionArray = 0; -StMuPmdCollection *StMuDst::mMuPmdCollection = 0; -StEmcCollection *StMuDst::mEmcCollection = 0; -StFmsCollection *StMuDst::mFmsCollection = 0; -StRHICfCollection *StMuDst::mRHICfCollection = 0; -TClonesArray** StMuDst::eztArrays = 0; - -Int_t StMuDst::mCurrVertexId = -2; -TObjArray* StMuDst::mCurrPrimaryTracks = 0; +StMuFcsCollection *StMuDst::mMuFcsCollection = 0; +StMuFttCollection *StMuDst::mMuFttCollection = 0; +StMuFstCollection *StMuDst::mMuFstCollection = 0; +StMuFwdTrackCollection *StMuDst::mMuFwdTrackCollection = 0; +TClonesArray *StMuDst::mMuPmdCollectionArray = 0; +StMuPmdCollection *StMuDst::mMuPmdCollection = 0; +StEmcCollection *StMuDst::mEmcCollection = 0; +StFmsCollection *StMuDst::mFmsCollection = 0; +StRHICfCollection *StMuDst::mRHICfCollection = 0; +TClonesArray** StMuDst::eztArrays = 0; + +Int_t StMuDst::mCurrVertexId = -2; +TObjArray* StMuDst::mCurrPrimaryTracks = 0; StMuDst::StMuDst() { DEBUGMESSAGE(""); @@ -113,6 +116,7 @@ void StMuDst::unset() { fcsArrays = 0; fttArrays = 0; fstArrays = 0; + fwdTrackArrays= 0; pmdArrays = 0; tofArrays = 0; btofArrays = 0; // dongx @@ -122,15 +126,16 @@ void StMuDst::unset() { fgtArrays = 0; mMuEmcCollectionArray = 0; mMuEmcCollection = 0; - mMuFmsCollection = 0; + mMuFmsCollection = 0; mMuRHICfCollection = 0; mMuFcsCollection = 0; mMuFttCollection = 0; mMuFstCollection = 0; + mMuFwdTrackCollection = 0; mMuPmdCollectionArray = 0; mMuPmdCollection = 0; mEmcCollection = 0; - mFmsCollection = 0; + mFmsCollection = 0; mRHICfCollection = 0; eztArrays = 0; mtdArrays = 0; @@ -152,6 +157,7 @@ void StMuDst::set(StMuDstMaker* maker) { fcsArrays = maker->mFcsArrays; fttArrays = maker->mFttArrays; fstArrays = maker->mFstArrays; + fwdTrackArrays= maker->mFwdTrackArrays; pmdArrays = maker->mPmdArrays; tofArrays = maker->mTofArrays; btofArrays = maker->mBTofArrays; // dongx @@ -161,14 +167,15 @@ void StMuDst::set(StMuDstMaker* maker) { fgtArrays = maker->mFgtArrays; - mMuEmcCollectionArray = maker->mEmcCollectionArray; + mMuEmcCollectionArray = maker->mEmcCollectionArray; mMuEmcCollection = maker->mEmcCollection; mMuFmsCollection = maker->mFmsCollection; mMuRHICfCollection = maker->mRHICfCollection; mMuFcsCollection = maker->mFcsCollection; mMuFttCollection = maker->mFttCollection; mMuFstCollection = maker->mFstCollection; - mMuPmdCollectionArray = maker->mPmdCollectionArray; + mMuFwdTrackCollection = maker->mFwdTrackCollection; + mMuPmdCollectionArray = maker->mPmdCollectionArray; mMuPmdCollection = maker->mPmdCollection; eztArrays = maker->mEztArrays; @@ -193,6 +200,7 @@ void StMuDst::set(TClonesArray** theArrays, TClonesArray** theFcsArrays, TClonesArray** theFttArrays, TClonesArray** theFstArrays, + TClonesArray** theFwdTrackArrays, TClonesArray** thePmdArrays, TClonesArray** theTofArrays, TClonesArray** theBTofArrays, // dongx @@ -208,6 +216,7 @@ void StMuDst::set(TClonesArray** theArrays, StMuFcsCollection *fcs, StMuFttCollection *ftt, StMuFstCollection *fst, + StMuFwdTrackCollection *fwdTrack, TClonesArray* pmd_arr, StMuPmdCollection *pmd) { @@ -225,6 +234,7 @@ void StMuDst::set(TClonesArray** theArrays, fcsArrays = theFcsArrays; fttArrays = theFttArrays; fstArrays = theFstArrays; + fwdTrackArrays= theFwdTrackArrays; fgtArrays = theFgtArrays; pmdArrays = thePmdArrays; tofArrays = theTofArrays; @@ -232,12 +242,13 @@ void StMuDst::set(TClonesArray** theArrays, etofArrays = theETofArrays; // jdb epdArrays = theEpdArrays; // MALisa mMuEmcCollectionArray = emc_arr; - mMuEmcCollection = emc; - mMuFmsCollection = fms; - mMuRHICfCollection = rhicf; - mMuFcsCollection = fcs; - mMuFttCollection = ftt; - mMuFstCollection = fst; + mMuEmcCollection = emc; + mMuFmsCollection = fms; + mMuRHICfCollection = rhicf; + mMuFcsCollection = fcs; + mMuFttCollection = ftt; + mMuFstCollection = fst; + mMuFwdTrackCollection = fwdTrack; mMuPmdCollectionArray = pmd_arr; mMuPmdCollection = pmd; eztArrays = theEztArrays; @@ -798,10 +809,10 @@ StEvent* StMuDst::createStEvent() { static StMuRHICfUtil* mRHICfUtil = new StMuRHICfUtil(); StMuRHICfCollection *rhicf = muRHICfCollection(); if(rhicf) { // transform to StEvent format and fill it - StRHICfCollection *RHICf = mRHICfUtil->getRHICf(rhicf); - if(RHICf) ev->setRHICfCollection(RHICf); + StRHICfCollection *RHICf = mRHICfUtil->getRHICf(rhicf); + if(RHICf) ev->setRHICfCollection(RHICf); } - // now get the FMS stuff and put it in the StEvent + // now get the FCS stuff and put it in the StEvent static StMuFcsUtil* mFcsUtil = new StMuFcsUtil(); StMuFcsCollection *fcs = muFcsCollection(); if(fcs) { // transform to StEvent format and fill it @@ -822,6 +833,13 @@ StEvent* StMuDst::createStEvent() { StFstHitCollection *FST = mFstUtil->getFst(fst); if(FST) ev->setFstHitCollection(FST); } + // now get the FWD Tracks and put it in the StEvent + static StMuFwdTrackUtil* mFwdTrackUtil = new StMuFwdTrackUtil(); + StMuFwdTrackCollection *fwdTrack = muFwdTrackCollection(); + if(fwdTrack) { // transform to StEvent format and fill it + StFwdTrackCollection *theFwdTrack = mFwdTrackUtil->getFwdTrack(fwdTrack); + if(theFwdTrack) ev->setFwdTrackCollection(theFwdTrack); + } // now get the PMD stuff and put it in the StEvent static StMuPmdUtil* mPmdUtil = new StMuPmdUtil(); StMuPmdCollection *pmd = pmdCollection(); @@ -1008,10 +1026,10 @@ void StMuDst::Print(Option_t *option) const { cout << "FMS data present" << endl; else cout << "No FMS data present" << endl; - if (muRHICfCollection()) - cout << "RHICf data present" << endl; - else - cout << "No RHICf data present" << endl; + if (muRHICfCollection()) + cout << "RHICf data present" << endl; + else + cout << "No RHICf data present" << endl; if (pmdCollection()) cout << "PMD data present" << endl; else diff --git a/StRoot/StMuDSTMaker/COMMON/StMuDst.h b/StRoot/StMuDSTMaker/COMMON/StMuDst.h index 2d7d3bb3f93..5ea0c335326 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuDst.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuDst.h @@ -35,6 +35,7 @@ class StMuRHICfCollection; class StMuFcsCollection; class StMuFttCollection; class StMuFstCollection; +class StMuFwdTrackCollection; class StMuPmdCollection; class StEvent; @@ -120,7 +121,8 @@ class StMuDst : public TObject { TClonesArray** rhicf_ptca=0, TClonesArray** fcs_ptca=0, TClonesArray** ftt_ptca=0, - TClonesArray** fst_ptca=0, + TClonesArray** fst_ptca=0, + TClonesArray** fwd_ptca=0, TClonesArray** pmd_ptca=0, TClonesArray** tof_ptca=0, TClonesArray** btof_ptca=0, @@ -136,6 +138,7 @@ class StMuDst : public TObject { StMuFcsCollection *fcs_col=0, StMuFttCollection *ftt_col=0, StMuFstCollection *fst_col=0, + StMuFwdTrackCollection *fwd_track_col=0, TClonesArray *pmd_tca=0, StMuPmdCollection *pmd_col=0 ); @@ -197,6 +200,8 @@ class StMuDst : public TObject { static TClonesArray** fttArrays; /// array of TClonesArrays for the stuff inherited from the Fst static TClonesArray** fstArrays; + /// array of TClonesArrays for the stuff inherited from the FWD Tracks + static TClonesArray** fwdTrackArrays; /// array of TClonesArrays for the stuff inherited from the Pmd static TClonesArray** pmdArrays; /// array of TClonesArrays for the stuff inherited from the TOF @@ -227,6 +232,8 @@ class StMuDst : public TObject { static StMuFttCollection *mMuFttCollection; /// pointer to FstCollection (manages the FstArrays) static StMuFstCollection *mMuFstCollection; + /// pointer to FwdTrackCollection (manages the FwdTrackArrays) + static StMuFwdTrackCollection *mMuFwdTrackCollection; /// pointer to PmdCollection (manages the PmdArrays) static StMuPmdCollection *mMuPmdCollection; /// pointer to EmcCollecion (for Emc clusterfinding etc) @@ -270,6 +277,8 @@ class StMuDst : public TObject { static TClonesArray* fttArray(int type) { return fttArrays[type]; } /// returns pointer to the n-th TClonesArray from the fst arrays static TClonesArray* fstArray(int type) { return fstArrays[type]; } + /// returns pointer to the n-th TClonesArray from the rhicf arrays + static TClonesArray* fwdTrackArray(int type) { return fwdTrackArrays[type]; } /// returns pointer to the n-th TClonesArray from the pmd arrays static TClonesArray* pmdArray(int type) { return pmdArrays[type]; } /// returns pointer to the n-th TClonesArray from the tof arrays @@ -381,21 +390,23 @@ class StMuDst : public TObject { /// returns pointer to current StMuFmsCollection static StMuFmsCollection* muFmsCollection() { return mMuFmsCollection; } /// returns pointer to current StMuRHICfCollection - static StMuRHICfCollection* muRHICfCollection() { return mMuRHICfCollection; } + static StMuRHICfCollection* muRHICfCollection() { return mMuRHICfCollection; } /// returns pointer to current StMuFcsCollection static StMuFcsCollection* muFcsCollection() { return mMuFcsCollection; } /// returns pointer to current StMuFttCollection static StMuFttCollection* muFttCollection() { return mMuFttCollection; } /// returns pointer to current StMuFstCollection static StMuFstCollection* muFstCollection() { return mMuFstCollection; } + /// returns pointer to current StMuFwdTrackCollection + static StMuFwdTrackCollection* muFwdTrackCollection() { return mMuFwdTrackCollection; } /// returns pointer to current StMuPmdCollection static StMuPmdCollection* pmdCollection() { if (mMuPmdCollectionArray) return (StMuPmdCollection*) mMuPmdCollectionArray->UncheckedAt(0); else return mMuPmdCollection; } /// returns pointer to current StEmcCollection static StEmcCollection* emcCollection() { return mEmcCollection; } /// returns pointer to current StFmsCollection static StFmsCollection* fmsCollection() { return mFmsCollection; } - /// returns pointer to current StFmsCollection - static StRHICfCollection* rhicfCollection() { return mRHICfCollection; } + /// returns pointer to current StRHICfCollection + static StRHICfCollection* rhicfCollection() { return mRHICfCollection; } /// returns pointer to the i-th muTofHit static StMuTofHit* tofHit(int i) { return (StMuTofHit*)tofArrays[muTofHit]->UncheckedAt(i); } diff --git a/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.cxx b/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.cxx index 0947baff87b..031a156db9e 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.cxx @@ -74,6 +74,9 @@ #include "StMuFttUtil.h" #include "StMuFttRawHit.h" #include "StMuFstCollection.h" +#include "StMuFwdTrack.h" +#include "StMuFwdTrackUtil.h" +#include "StMuFwdTrackCollection.h" #include "StMuFstUtil.h" #include "StMuFstRawHit.h" #include "StMuFstHit.h" @@ -162,8 +165,7 @@ StMuDstMaker::StMuDstMaker(const char* name) : StIOInterFace(name), mChain (0), mTTree(0), mSplit(99), mCompression(9), mBufferSize(65536*4), mVtxList(100), mProbabilityPidAlgorithm(0), mEmcCollectionArray(0), mEmcCollection(0), - mFmsCollection(0),mRHICfCollection(0),mFcsCollection(0),mFttCollection(0), - mFstCollection(0), mPmdCollectionArray(0), mPmdCollection(0) + mFmsCollection(0),mRHICfCollection(0),mFcsCollection(0),mFttCollection(0),mFstCollection(0),mFwdTrackCollection(0), mPmdCollectionArray(0), mPmdCollection(0) { assignArrays(); @@ -188,7 +190,7 @@ StMuDstMaker::StMuDstMaker(const char* name) : StIOInterFace(name), mBTofUtil = new StMuBTofUtil(); /// dongx mEpdUtil = new StMuEpdUtil(); /// MALisa mEzTree = new StMuEzTree(); - if ( ! mStMuDst || ! mEmcUtil || ! mFmsUtil || ! mRHICfUtil || ! mFcsUtil || ! mPmdUtil || ! mTofUtil || ! mBTofUtil || ! mEpdUtil || ! mEzTree ) /// dongx + if ( ! mStMuDst || ! mEmcUtil || ! mFmsUtil || ! mRHICfUtil || !mFcsUtil || ! mPmdUtil || ! mTofUtil || ! mBTofUtil || ! mEpdUtil || ! mEzTree ) /// dongx throw StMuExceptionNullPointer("StMuDstMaker:: constructor. Something went horribly wrong, cannot allocate pointers",__PRETTYF__); @@ -224,10 +226,11 @@ void StMuDstMaker::assignArrays() mPmdArrays = mEmcArrays + __NEMCARRAYS__; mFmsArrays = mPmdArrays + __NPMDARRAYS__; mRHICfArrays = mFmsArrays + __NFMSARRAYS__; - mFcsArrays = mRHICfArrays + __NRHICFARRAYS__; + mFcsArrays = mRHICfArrays + __NRHICFARRAYS__; mFttArrays = mFcsArrays + __NFCSARRAYS__; mFstArrays = mFttArrays + __NFTTARRAYS__; - mTofArrays = mFstArrays + __NFSTARRAYS__; + mFwdTrackArrays = mFstArrays + __NFSTARRAYS__; + mTofArrays = mFwdTrackArrays + __NFWDTRACKARRAYS__; mBTofArrays = mTofArrays + __NTOFARRAYS__; /// dongx mETofArrays = mBTofArrays + __NBTOFARRAYS__; /// jdb mEpdArrays = mETofArrays + __NETOFARRAYS__; /// MALisa @@ -250,6 +253,7 @@ void StMuDstMaker::clearArrays() __NFCSARRAYS__+ __NFTTARRAYS__+ __NFSTARRAYS__+ + __NFWDTRACKARRAYS__+ __NTOFARRAYS__+ __NBTOFARRAYS__+ /// dongx __NETOFARRAYS__+ //jdb @@ -284,6 +288,7 @@ void StMuDstMaker::zeroArrays() __NFCSARRAYS__+ __NFTTARRAYS__+ __NFSTARRAYS__+ + __NFWDTRACKARRAYS__+ __NTOFARRAYS__+ __NBTOFARRAYS__+ /// dongx __NETOFARRAYS__+ //jdb @@ -338,7 +343,7 @@ void StMuDstMaker::SetStatus(const char *arrType,int status) #ifndef __NO_STRANGE_MUDST__ __NSTRANGEARRAYS__, #endif - __NMCARRAYS__,__NEMCARRAYS__,__NPMDARRAYS__,__NFMSARRAYS__,__NRHICFARRAYS__,__NFCSARRAYS__,__NFTTARRAYS__,__NFSTARRAYS__,__NTOFARRAYS__,__NBTOFARRAYS__,__NETOFARRAYS__,__NEPDARRAYS__,__NMTDARRAYS__,__NFGTARRAYS__,__NEZTARRAYS__,-1}; + __NMCARRAYS__,__NEMCARRAYS__,__NPMDARRAYS__,__NFMSARRAYS__,__NRHICFARRAYS__,__NFCSARRAYS__,__NFTTARRAYS__,__NFSTARRAYS__,__NFWDTRACKARRAYS__,__NTOFARRAYS__,__NBTOFARRAYS__,__NETOFARRAYS__,__NEPDARRAYS__,__NMTDARRAYS__,__NFGTARRAYS__,__NEZTARRAYS__,-1}; // jdb fixed with new implementation, // this method was broken for several years @@ -395,8 +400,7 @@ StMuDstMaker::StMuDstMaker(int mode, int nameMode, const char* dirName, const ch mTrackFilter(0), mL3TrackFilter(0), mCurrentFile(0), mSplit(99), mCompression(9), mBufferSize(65536*4), mProbabilityPidAlgorithm(0), mEmcCollectionArray(0), mEmcCollection(0), - mFmsCollection(0), mRHICfCollection(0), mFcsCollection(0), - mFttCollection(0), mFstCollection(0), mPmdCollectionArray(0), mPmdCollection(0) + mFmsCollection(0), mRHICfCollection(0), mFcsCollection(0), mFttCollection(0), mFstCollection(0), mFwdTrackCollection(0), mPmdCollectionArray(0), mPmdCollection(0) { assignArrays(); streamerOff(); @@ -876,6 +880,12 @@ void StMuDstMaker::setBranchAddresses(TChain* chain) { mStMuDst->set(this); } + if (!mFwdTrackCollection) { + mFwdTrackCollection=new StMuFwdTrackCollection(); + connectFwdTrackCollection(); + mStMuDst->set(this); + } + if (pmd_oldformat) { TBranch *branch=chain->GetBranch("PmdCollection"); @@ -1044,6 +1054,7 @@ void StMuDstMaker::fillTrees(StEvent* ev, StMuCut* cut){ fillFcs(ev); fillFtt(ev); fillFst(ev); + fillFwdTrack(ev); fillTof(ev); fillBTof(ev); fillETof(ev); @@ -1205,13 +1216,11 @@ void StMuDstMaker::fillFcs(StEvent* ev) { if (!mFcsCollection) { - LOG_INFO << "Making Fcs Collection" << endm; mFcsCollection=new StMuFcsCollection(); - LOG_INFO << "Connecting Fcs Collection" << endm; connectFcsCollection(); mStMuDst->set(this); } - LOG_INFO << "StMuDSTMaker filling StMuFcsCollection from StEvent" << endm; + mFcsUtil->fillMuFcs(mFcsCollection,fcscol); timer.stop(); @@ -1264,6 +1273,30 @@ void StMuDstMaker::fillFst(StEvent* ev) { } //----------------------------------------------------------------------- //----------------------------------------------------------------------- +void StMuDstMaker::fillFwdTrack(StEvent* ev) { + DEBUGMESSAGE2(""); + LOG_INFO << "StMuDstMaker::fillFwdTrack(StEvent* ev)" << endm; + StFwdTrackCollection* fwdcol=(StFwdTrackCollection*)ev->fwdTrackCollection(); + if (!fwdcol) return; //throw StMuExceptionNullPointer("no StFstHitCollection",__PRETTYF__); + StTimer timer; + timer.start(); + + LOG_INFO << "StMuDSTMaker filling StMuFwdTrackCollection from StEvent" << endm; + + if (!mFwdTrackCollection) { + mFwdTrackCollection=new StMuFwdTrackCollection(); + LOG_INFO << "Connecting StMuFwdTrackCollection" << endm; + connectFwdTrackCollection(); + mStMuDst->set(this); + } + + mFwdTrackUtil->fillMuFwdTrack(mFwdTrackCollection,fwdcol,mFcsUtil); + + timer.stop(); + DEBUGVALUE2(timer.elapsedTime()); +} +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- void StMuDstMaker::fillPmd(StEvent* ev) { DEBUGMESSAGE2(""); StPhmdCollection* phmdColl=(StPhmdCollection*)ev->phmdCollection(); @@ -1588,7 +1621,7 @@ void StMuDstMaker::fillEzt(StEvent* ev) { #ifndef __NO_STRANGE_MUDST__ __NSTRANGEARRAYS__+ #endif - __NMCARRAYS__+__NEMCARRAYS__+__NPMDARRAYS__+__NFMSARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+ + __NMCARRAYS__+__NEMCARRAYS__+__NPMDARRAYS__+__NFMSARRAYS__+__NRHICFARRAYS__+__NFCSARRAYS__+__NFTTARRAYS__+__NFSTARRAYS__+__NFWDTRACKARRAYS__+ __NTOFARRAYS__+__NBTOFARRAYS__+__NETOFARRAYS__+__NEPDARRAYS__+__NMTDARRAYS__+__NFGTARRAYS__]; /// dongx, MALisa if(eztArrayStatus[muEztHead]){ EztEventHeader* header = mEzTree->copyHeader(ev); @@ -2101,6 +2134,11 @@ void StMuDstMaker::connectFstCollection() { mFstCollection->setFstHitArray(mFstArrays[muFstHit]); } //----------------------------------------------------------------------- +void StMuDstMaker::connectFwdTrackCollection() { + LOG_INFO << "Setting FwdTrack arrays" << endm; + mFwdTrackCollection->setFwdTrackArray(mFwdTrackArrays[muFwdTrack]); +} +//----------------------------------------------------------------------- void StMuDstMaker::connectPmdCollection() { mPmdCollection->setPmdHitArray(mPmdArrays[muPmdHit]); mPmdCollection->setCpvHitArray(mPmdArrays[muCpvHit]); diff --git a/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.h b/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.h index 4436dadfe61..3c29507306e 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuDstMaker.h @@ -61,8 +61,8 @@ class StMuEmcUtil; class StMuFmsUtil; /// RHICf stuff -#include "StMuRHICfCollection.h" -class StMuRHICfUtil; + #include "StMuRHICfCollection.h" + class StMuRHICfUtil; /// fcs stuff #include "StMuFcsCollection.h" @@ -76,6 +76,10 @@ class StMuFttUtil; #include "StMuFstCollection.h" class StMuFstUtil; +/// fwd tracks +#include "StMuFwdTrackCollection.h" +class StMuFwdTrackUtil; + #include "StMuEpdHitCollection.h" // MALisa class StMuEpdUtil; /// PMD by Supriya Das @@ -186,13 +190,14 @@ class StMuDstMaker : public StIOInterFace { /// Sets the compression level for the file and all branches. 0 means no compression, 9 is the higher compression level. void setCompression(int comp=9); - StMuEmcUtil* muEmcUtil() { return mEmcUtil; } ///< return pointer to StMuEmcUtil; - StMuFmsUtil* muFmsUtil() { return mFmsUtil; } ///< return pointer to StMuFmsUtil; + StMuEmcUtil* muEmcUtil() { return mEmcUtil; } ///< return pointer to StMuEmcUtil; + StMuFmsUtil* muFmsUtil() { return mFmsUtil; } ///< return pointer to StMuFmsUtil; StMuRHICfUtil* muRHICfUtil() { return mRHICfUtil; } ///< return pointer to StMuRHICfUtil; - StMuFcsUtil* muFcsUtil() { return mFcsUtil; } ///< return pointer to StMuFcsUtil; - StMuFttUtil* muFttUtil() { return mFttUtil; } ///< return pointer to StMuFttUtil; - StMuFstUtil* muFstUtil() { return mFstUtil; } ///< return pointer to StMuFstUtil; - StMuPmdUtil* muPmdUtil() { return mPmdUtil; } ///< return pointer to StMuPmdUtil; + StMuFcsUtil* muFcsUtil() { return mFcsUtil; } ///< return pointer to StMuFcsUtil; + StMuFttUtil* muFttUtil() { return mFttUtil; } ///< return pointer to StMuFttUtil; + StMuFstUtil* muFstUtil() { return mFstUtil; } ///< return pointer to StMuFstUtil; + StMuFwdTrackUtil* muFwdTrackUtil() { return mFwdTrackUtil; } ///< return pointer to StMuFwdTrackUtil; + StMuPmdUtil* muPmdUtil() { return mPmdUtil; } ///< return pointer to StMuPmdUtil; virtual const char *GetCVS() const { ///< Returns version tag. @@ -210,6 +215,7 @@ class StMuDstMaker : public StIOInterFace { void connectFcsCollection(); void connectFttCollection(); void connectFstCollection(); + void connectFwdTrackCollection(); void connectPmdCollection(); enum ioMode {ioRead, ioWrite}; /** Specifies the way the output file name is contructed when creating muDsts. @@ -235,6 +241,7 @@ class StMuDstMaker : public StIOInterFace { StMuFcsUtil* mFcsUtil; StMuFttUtil* mFttUtil; StMuFstUtil* mFstUtil; + StMuFwdTrackUtil* mFwdTrackUtil; StMuPmdUtil* mPmdUtil; StMuTofUtil* mTofUtil; /// dongx @@ -315,6 +322,7 @@ virtual void closeRead(); void fillFcs(StEvent* ev); void fillFtt(StEvent* ev); void fillFst(StEvent* ev); + void fillFwdTrack(StEvent* ev); #ifndef __NO_STRANGE_MUDST__ void fillStrange(StStrangeMuDstMaker*); #endif @@ -382,10 +390,11 @@ virtual void closeRead(); TClonesArray** mMCArrays;//[__NMCARRAYS__]; TClonesArray** mEmcArrays; //[__NEMCARRAYS__ ]; TClonesArray** mFmsArrays; //[__NFMSARRAYS__ ]; - TClonesArray** mRHICfArrays; //[__NRHICFARRAYS__ ]; + TClonesArray** mRHICfArrays; //[__NRHICFARRAYS__ ]; TClonesArray** mFcsArrays; //[__NFCSARRAYS__ ]; TClonesArray** mFttArrays; //[__NFTTARRAYS__ ]; TClonesArray** mFstArrays; //[__NFSTARRAYS__ ]; + TClonesArray** mFwdTrackArrays; //[__NFWDTRACKARRAYS__ ]; TClonesArray** mPmdArrays; //[__NPMDARRAYS__ ]; TClonesArray** mTofArrays; //[__NTOFARRAYS__ ]; /// dongx @@ -404,6 +413,7 @@ virtual void closeRead(); StMuFcsCollection *mFcsCollection; StMuFttCollection *mFttCollection; StMuFstCollection *mFstCollection; + StMuFwdTrackCollection *mFwdTrackCollection; TClonesArray* mPmdCollectionArray; // Needed to hold old format StMuPmdCollection *mPmdCollection; // StMuEpdHitCollection *mMuEpdHitCollection; // MALisa diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFcsUtil.h b/StRoot/StMuDSTMaker/COMMON/StMuFcsUtil.h index 465f7558066..93e50529e80 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuFcsUtil.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuFcsUtil.h @@ -23,6 +23,7 @@ class StMuFcsUtil : public TObject void fillMuFcs(StMuFcsCollection*,StFcsCollection*); void fillFcs(StFcsCollection*,StMuFcsCollection*); + std::map< const StFcsCluster*, StMuFcsCluster* > & getClusterMap() {return mMapClusters; } private: @@ -40,9 +41,9 @@ class StMuFcsUtil : public TObject void fillFcsHits(StFcsCollection*, StMuFcsCollection*); /** holds relation between StEvent and StMuDst types (in memory)**/ - map< const StFcsHit*, StMuFcsHit* > mMapHits; - map< const StFcsCluster*, StMuFcsCluster* > mMapClusters; - map< const StFcsPoint*, StMuFcsPoint* > mMapPoints; + std::map< const StFcsHit*, StMuFcsHit* > mMapHits; + std::map< const StFcsCluster*, StMuFcsCluster* > mMapClusters; + std::map< const StFcsPoint*, StMuFcsPoint* > mMapPoints; ClassDef(StMuFcsUtil,1) }; diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.cxx new file mode 100644 index 00000000000..716b272e824 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.cxx @@ -0,0 +1,141 @@ +#include "StMuFwdTrack.h" +#include + +#include "StEvent/StFwdTrack.h" + +StMuFwdTrack::StMuFwdTrack() { + +} + +void StMuFwdTrack::set( StFwdTrack * evTrack) { + mDidFitConverge = evTrack->didFitConverge(); + mDidFitConvergeFully = evTrack->didFitConvergeFully(); + mNumberOfFailedPoints = evTrack->numberOfFailedPoints(); + mNumberOfSeedPoints = evTrack->numberOfSeedPoints(); + mNumberOfFitPoints = evTrack->numberOfFitPoints(); + mChi2 = evTrack->chi2(); + mNDF = evTrack->ndf(); + mPval = evTrack->pval(); + mCharge = evTrack->charge(); + mPrimaryMomentum = TVector3( evTrack->momentum().x(), evTrack->momentum().y(), evTrack->momentum().z() ); + + //copy the projections + for ( auto proj : evTrack->mProjections ){ + mProjections.push_back( + StMuFwdTrackProjection( proj.mDetId, TVector3( proj.mXYZ.x(), proj.mXYZ.y(), proj.mXYZ.z() ), TVector3( proj.mMom.x(), proj.mMom.y(), proj.mMom.z() ), proj.mCov ) + ); + } + + //copy the FTT Seed Points + for ( auto sp : evTrack->mFTTPoints ){ + mFTTPoints.push_back( + StMuFwdTrackSeedPoint( TVector3( sp.mXYZ.x(), sp.mXYZ.y(), sp.mXYZ.z() ), sp.mSector, sp.mTrackId, sp.mCov ) + ); + } + + //copy the FST Seed Points + for ( auto sp : evTrack->mFSTPoints ){ + mFSTPoints.push_back( + StMuFwdTrackSeedPoint( TVector3( sp.mXYZ.x(), sp.mXYZ.y(), sp.mXYZ.z() ), sp.mSector, sp.mTrackId, sp.mCov ) + ); + } +} + + +void StMuFwdTrack::addEcalCluster( StMuFcsCluster* clu){ + int n=mEcalClusters.GetSize(); + for(int i=0; i= mProjections.size() ) + return TVector3( 0, 0, 0 ); + + return mProjections[_id].mMom; +} + +char StMuFwdTrack::charge() const{ + return mCharge; +} + +bool StMuFwdTrack::didFitConverge() const { + return mDidFitConverge; +} + +bool StMuFwdTrack::didFitConvergeFully() const { + return mDidFitConvergeFully; +} + +short StMuFwdTrack::numberOfFailedPoints() const { + return mNumberOfFailedPoints; +} + +double StMuFwdTrack::chi2() const { + return mChi2; +} + +double StMuFwdTrack::ndf() const { + return mNDF; +} + +double StMuFwdTrack::pval() const { + return mPval; +} + +short StMuFwdTrack::numberOfFitPoints() const { + return mNumberOfFitPoints; +} + +short StMuFwdTrack::numberOfSeedPoints() const { + return mNumberOfSeedPoints; +} + + +// StPtrVecFcsCluster& StMuFwdTrack::ecalClusters() { return mEcalClusters; } +// const StPtrVecFcsCluster& StMuFwdTrack::ecalClusters() const { return mEcalClusters; } +// void StMuFwdTrack::addEcalCluster(StFcsCluster* p){mEcalClusters.push_back(p);} +// void StMuFwdTrack::sortEcalClusterByET() { +// std::sort(mEcalClusters.begin(), mEcalClusters.end(), [](StFcsCluster* a, StFcsCluster* b) { +// return b->fourMomentum().perp() < a->fourMomentum().perp(); +// }); +// } + +// StPtrVecFcsCluster& StMuFwdTrack::hcalClusters() { return mHcalClusters; } +// const StPtrVecFcsCluster& StMuFwdTrack::hcalClusters() const { return mHcalClusters; } +// void StMuFwdTrack::addHcalCluster(StFcsCluster* p){mHcalClusters.push_back(p);} +// void StMuFwdTrack::sortHcalClusterByET() { +// std::sort(mHcalClusters.begin(), mHcalClusters.end(), [](StFcsCluster* a, StFcsCluster* b) { +// return b->fourMomentum().perp() < a->fourMomentum().perp(); +// }); +// } + +bool StMuFwdTrack::getProjectionFor( int detectorId, + StMuFwdTrackProjection &rProj, + size_t index ){ + size_t count = 0; + for ( auto proj : mProjections ){ + if (proj.mDetId == detectorId){ + rProj.set( proj ); + if ( count == index ) + return true; + count++; + } + } + return false; +} \ No newline at end of file diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.h b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.h new file mode 100644 index 00000000000..11dad825e43 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrack.h @@ -0,0 +1,179 @@ +/*************************************************************************** + * + * Author: jdb, Feb 2022 + *************************************************************************** + * + * Description: StMuFwdTrack stores the Forward tracks built from Fst and Ftt + * + **************************************************************************/ +#ifndef StMuFwdTrack_hh +#define StMuFwdTrack_hh + +#include +#include +#include "TVector3.h" +#include "TRefArray.h" + +#include "StMuFcsCluster.h" + + +class StFwdTrack; + + +struct StMuFwdTrackProjection : public TObject { + StMuFwdTrackProjection() {} + StMuFwdTrackProjection ( const StMuFwdTrackProjection & other) { + mXYZ = other.mXYZ; + mMom = other.mMom; + mDetId = other.mDetId; + memcpy( mCov, other.mCov, sizeof( mCov ) ); + } + StMuFwdTrackProjection( unsigned short detId, + TVector3 xyz, + TVector3 mom, + float c[9] ) { + set( detId, xyz, mom, c ); + } + + void set( unsigned short detId, + TVector3 xyz, + TVector3 mom, + float c[9]) { + mDetId = detId; + mXYZ = xyz; + mMom = mom; + memcpy( mCov, c, sizeof(mCov) ); + } + void set( StMuFwdTrackProjection &other ){ + mDetId = other.mDetId; + mXYZ = other.mXYZ; + mMom = other.mMom; + memcpy( mCov, other.mCov, sizeof(mCov) ); + } + TVector3 mXYZ; + TVector3 mMom; + unsigned char mDetId; + float mCov[9]; + + float dx(){ + return sqrt( mCov[0] ); + } + float dy(){ + return sqrt( mCov[4] ); + } + float dz(){ + return sqrt( mCov[8] ); + } + + ClassDef(StMuFwdTrackProjection, 1) +}; + +struct StMuFwdTrackSeedPoint : public TObject{ + StMuFwdTrackSeedPoint() {} + StMuFwdTrackSeedPoint( TVector3 xyz, + short sec, + unsigned short trackId, + float cov[9] ){ + mXYZ = xyz; + mSector = sec; + mTrackId = trackId; + memcpy( mCov, cov, sizeof( mCov )); + } + + TVector3 mXYZ; + unsigned short mTrackId; + short mSector; + float mCov[9]; + ClassDef(StMuFwdTrackSeedPoint,1) +}; + +class StMuFwdTrack : public TObject { + +public: + StMuFwdTrack( ); + + void set( StFwdTrack* ); + + std::vector mProjections; + std::vector mFTTPoints; + std::vector mFSTPoints; + + bool getProjectionFor( int detectorId, + StMuFwdTrackProjection &rProj, + size_t index = 0 ); + + TVector3 momentum() const; + TVector3 momentumAt(size_t _id = 0) const; + char charge() const; + + + // Quality of the fit + bool didFitConverge() const; + bool didFitConvergeFully() const; + short numberOfFailedPoints() const; + double chi2() const; + double ndf() const; + double pval() const; + + // Number of fit points used by GenFit + short numberOfFitPoints() const; + // unsigned int numberOfPossibleFitPoints() const; + + // Number of points used in the track seed step + short numberOfSeedPoints() const; + + + void setPrimaryMomentum( TVector3 mom ) { mPrimaryMomentum = mom; } + void setDidFitConverge( bool lDidFitConverge ) { mDidFitConverge = lDidFitConverge; } + void setDidFitConvergeFully( bool lDidFitConvergeFully ) { mDidFitConvergeFully = lDidFitConvergeFully;} + void setNumberOfFailedPoints( short lNumberOfFailedPoints ) { mNumberOfFailedPoints = lNumberOfFailedPoints;} + void setNumberOfSeedPoints( short lNumberOfSeedPoints ) { mNumberOfSeedPoints = lNumberOfSeedPoints;} + void setNumberOfFitPoints( short lNumberOfFitPoints ) { mNumberOfFitPoints = lNumberOfFitPoints;} + void setChi2( float lChi2 ) { mChi2 = lChi2;} + void setNDF( float lNDF ) { mNDF = lNDF;} + void setPval( float lPval ) { mPval = lPval;} + void setCharge( short lCharge ) { mCharge = lCharge;} + + // ECAL clusters + // StPtrVecFcsCluster& ecalClusters(); + // const StPtrVecFcsCluster& ecalClusters() const; + // void addEcalCluster(StFcsCluster* p); + // void sortEcalClusterByET(); + // // HCAL clusters + // StPtrVecFcsCluster& hcalClusters(); + // const StPtrVecFcsCluster& hcalClusters() const; + // void addHcalCluster(StFcsCluster* p); + // void sortHcalClusterByET(); + + // vector + + void addEcalCluster( StMuFcsCluster* clu); + void addHcalCluster( StMuFcsCluster* clu); + + TRefArray mEcalClusters; + TRefArray mHcalClusters; + +protected: + + // Track quality and convergence + bool mDidFitConverge; + bool mDidFitConvergeFully; + short mNumberOfFailedPoints; + short mNumberOfSeedPoints; + short mNumberOfFitPoints; + float mChi2; + float mNDF; + float mPval; + short mCharge; + TVector3 mPrimaryMomentum; + + + // StPtrVecFcsCluster mEcalClusters; + // StPtrVecFcsCluster mHcalClusters; + + ClassDef(StMuFwdTrack,2) + +}; + +#endif + diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.cxx new file mode 100644 index 00000000000..476dbc08004 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.cxx @@ -0,0 +1,44 @@ +/*************************************************************************** + * + * $Id: StMuFwdTrackCollection.cxx + * + * Author: jdb, 2021 + *************************************************************************** + * + * Description: Fwd Tracks + * + ***************************************************************************/ + +#include "StMuDSTMaker/COMMON/StMuFwdTrackCollection.h" +#include "StMuDSTMaker/COMMON/StMuFwdTrack.h" + +#include "St_base/StMessMgr.h" + + +StMuFwdTrackCollection::StMuFwdTrackCollection() { mFwdTracks = 0; } + +StMuFwdTrackCollection::~StMuFwdTrackCollection() { + delete mFwdTracks; + mFwdTracks = nullptr; +} + +void StMuFwdTrackCollection::init() { + mFwdTracks = new TClonesArray("StMuFwdTracks", 0); +} + +StMuFwdTrack* StMuFwdTrackCollection::addFwdTrack(){ + if(!mFwdTracks) init(); + int counter = mFwdTracks->GetEntriesFast(); + StMuFwdTrack* newFwdTrack = new ((*mFwdTracks)[counter]) StMuFwdTrack(); + return newFwdTrack; +} + +unsigned int StMuFwdTrackCollection::numberOfFwdTracks() const{ + if(!mFwdTracks) return 0; + return mFwdTracks->GetEntriesFast(); +} + +StMuFwdTrack* StMuFwdTrackCollection::getFwdTrack(int index){ + if (!mFwdTracks) return nullptr; + return (StMuFwdTrack*) mFwdTracks->At(index); +} diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.h b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.h new file mode 100644 index 00000000000..bc106ff9b06 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackCollection.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * + * $Id: StMuFwdTrackCollection.h + * + * Author: jdb, 2023 + *************************************************************************** + * + * Description: Fwd Tracks + * + *************************************************************************** + * + * + **************************************************************************/ +#ifndef StMuFwdTrackCollection_hh +#define StMuFwdTrackCollection_hh + +#include +#include "TClonesArray.h" + +class StMuFwdTrack; + + +class StMuFwdTrackCollection : public TObject { +public: + StMuFwdTrackCollection(); + ~StMuFwdTrackCollection(); + + void init(); + StMuFwdTrack* addFwdTrack(); + unsigned int numberOfFwdTracks() const; + void setFwdTrackArray(TClonesArray *array) {mFwdTracks=array;}; + + StMuFwdTrack* getFwdTrack(int index); + + TClonesArray* getFwdTrackArray() { return mFwdTracks; }; + +private: + TClonesArray* mFwdTracks=0; + + ClassDef(StMuFwdTrackCollection,1) +}; +#endif diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.cxx b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.cxx new file mode 100644 index 00000000000..49c28451d27 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.cxx @@ -0,0 +1,86 @@ +#include "StMuFwdTrackUtil.h" +#include "StMuFwdTrackCollection.h" + +#include "StEvent/StFcsCluster.h" +#include "StMuDSTMaker/COMMON/StMuFcsCluster.h" +#include "StMuDSTMaker/COMMON/StMuFcsHit.h" +#include "StMuDSTMaker/COMMON/StMuFcsPoint.h" +#include "StMuDSTMaker/COMMON/StMuFcsUtil.h" +#include "StMuDSTMaker/COMMON/StMuFcsInfo.h" +#include "StMuDSTMaker/COMMON/StMuFcsCollection.h" + + +#include "StEvent/StFwdTrackCollection.h" +#include "StEvent/StFwdTrack.h" +#include "St_base/StMessMgr.h" + +#include "StMuFwdTrack.h" +#include "StMuFwdTrackCollection.h" + +StMuFwdTrackCollection* StMuFwdTrackUtil::getMuFwdTrack(StFwdTrackCollection* evc){ + + if ( evc == nullptr ){ + LOG_WARN << "NULL StFwdTrackCollection, cannot fill MuDST" << endm; + } + + StMuFwdTrackCollection *muc = new StMuFwdTrackCollection(); + return muc; +} + +StFwdTrackCollection* StMuFwdTrackUtil::getFwdTrack(StMuFwdTrackCollection*){ + return new StFwdTrackCollection(); +} + +void StMuFwdTrackUtil::fillMuFwdTrack(StMuFwdTrackCollection* muc,StFwdTrackCollection* evc, StMuFcsUtil *fcsu){ + + if ( evc == nullptr ){ + LOG_WARN << "NULL StFwdTrackCollection, cannot fill FwdTracks in MuDST" << endm; + return; + } + + if ( muc == nullptr ){ + LOG_WARN << "NULL StMuFwdTrackCollection, cannot fill FwdTracks in MuDST" << endm; + return; + } + + if ( fcsu == nullptr ){ + LOG_WARN << "NULL StMuFcsUtil, cannot fill FwdTracks in MuDST" << endm; + return; + } + + auto fcsClusterMapEvToMu = fcsu->getClusterMap(); + + const StSPtrVecFwdTrack& evTracks = evc->tracks(); + LOG_INFO << "Adding " << evc->numberOfTracks() << " StMuFwdTracks to MuDSt" << endm; + for ( size_t i = 0; i < evc->numberOfTracks(); i++ ){ + StFwdTrack * evTrack = evTracks[i]; + StMuFwdTrack * muFwdTrack = muc->addFwdTrack(); + muFwdTrack->set( evTrack ); + + // Fix ECAL, HCAL associations + const StPtrVecFcsCluster& ecalClus = evTrack->ecalClusters(); + const StPtrVecFcsCluster& hcalClus = evTrack->hcalClusters(); + + for (auto eClu : ecalClus ){ + + if ( fcsClusterMapEvToMu.count( eClu ) == 0){ + LOG_WARN << "Cannot find ECAL Cluster in map" << endm; + continue; + } + StMuFcsCluster * muClu = fcsClusterMapEvToMu[ eClu ]; + muFwdTrack->addEcalCluster( muClu ); + } + + for (auto hClu : hcalClus ){ + + if ( fcsClusterMapEvToMu.count( hClu ) == 0){ + LOG_WARN << "Cannot find HCAL Cluster in map" << endm; + continue; + } + StMuFcsCluster * muClu = fcsClusterMapEvToMu[ hClu ]; + muFwdTrack->addHcalCluster( muClu ); + } + } + + return; +} \ No newline at end of file diff --git a/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.h b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.h new file mode 100644 index 00000000000..e786d283ba8 --- /dev/null +++ b/StRoot/StMuDSTMaker/COMMON/StMuFwdTrackUtil.h @@ -0,0 +1,24 @@ +#ifndef StMuFwdTrackUtil_h +#define StMuFwdTrackUtil_h + +#include +#include + +class StMuFwdTrackCollection; +class StFwdTrackCollection; +class StMuDst; +class StFwdTrack; +class StMuFcsUtil; + +class StMuFwdTrackUtil : public TObject +{ +public: + StMuFwdTrackCollection* getMuFwdTrack(StFwdTrackCollection*); + StFwdTrackCollection* getFwdTrack(StMuFwdTrackCollection*); + void fillMuFwdTrack(StMuFwdTrackCollection*,StFwdTrackCollection*, StMuFcsUtil*); + void fillFwdTrack(StFwdTrackCollection*,StMuFwdTrackCollection*); + + ClassDef(StMuFwdTrackUtil,1) +}; + +#endif diff --git a/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.cxx b/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.cxx index 9a5e53a0742..776f1c38ff0 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.cxx @@ -13,12 +13,15 @@ StMuRHICfRawHit::~StMuRHICfRawHit() void StMuRHICfRawHit::clear() { + mRHICfRunNumber = 0; + mRHICfEventNumber = 0; + mRunType = 999; mBunchNumber = 0; mRHICfTrigger = 0; mRunTime[0] = 0; mRunTime[1] = 0; mRunTRGM = 0; - mRunType = 999; + memset(mPlateADC, 0, sizeof(mPlateADC)); memset(mPlateADCDelay, 0, sizeof(mPlateADCDelay)); @@ -30,8 +33,10 @@ void StMuRHICfRawHit::clear() memset(mGPI1, 0, sizeof(mGPI1)); } -void StMuRHICfRawHit::setBunchNumber(UInt_t bunch){mBunchNumber = bunch;} +void StMuRHICfRawHit::setRHICfRunNumber(UInt_t run){mRHICfRunNumber = run;} +void StMuRHICfRawHit::setRHICfEventNumber(UInt_t event){mRHICfEventNumber = event;} void StMuRHICfRawHit::setRunType(UInt_t type){mRunType = type;} +void StMuRHICfRawHit::setBunchNumber(UInt_t bunch){mBunchNumber = bunch;} void StMuRHICfRawHit::setTriggerNumber(UInt_t trigger){mRHICfTrigger = trigger;} void StMuRHICfRawHit::setRunTime(Int_t idx, UInt_t time){mRunTime[idx] = time;} void StMuRHICfRawHit::setRunTRGM(UInt_t trgm){mRunTRGM = trgm;} @@ -49,8 +54,10 @@ void StMuRHICfRawHit::setCAD0(Int_t idx, UInt_t val){mCAD0[idx] = val;} void StMuRHICfRawHit::setGPI0(Int_t idx, UInt_t val){mGPI0[idx] = val;} void StMuRHICfRawHit::setGPI1(Int_t idx, UInt_t val){mGPI1[idx] = val;} -UInt_t StMuRHICfRawHit::getBunchNumber(){return mBunchNumber;} +UInt_t StMuRHICfRawHit::getRHICfRunNumber(){return mRHICfRunNumber;} +UInt_t StMuRHICfRawHit::getRHICfEventNumber(){return mRHICfEventNumber;} UInt_t StMuRHICfRawHit::getRunType(){return mRunType;} +UInt_t StMuRHICfRawHit::getBunchNumber(){return mBunchNumber;} UInt_t StMuRHICfRawHit::getTriggerNumber(){return mRHICfTrigger;} UInt_t StMuRHICfRawHit::getRunTime(Int_t idx){return mRunTime[idx];} UInt_t StMuRHICfRawHit::getRunTRGM(){return mRunTRGM;} diff --git a/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.h b/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.h index e33f0c22303..aa8df2b3170 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuRHICfRawHit.h @@ -12,8 +12,10 @@ class StMuRHICfRawHit : public TObject void clear(); - void setBunchNumber(UInt_t bunch); + void setRHICfRunNumber(UInt_t run); + void setRHICfEventNumber(UInt_t event); void setRunType(UInt_t type); + void setBunchNumber(UInt_t bunch); void setTriggerNumber(UInt_t trigger); void setRunTime(Int_t idx, UInt_t time); void setRunTRGM(UInt_t trgm); @@ -26,8 +28,10 @@ class StMuRHICfRawHit : public TObject void setGPI0(Int_t idx, UInt_t val); void setGPI1(Int_t idx, UInt_t val); - UInt_t getBunchNumber(); + UInt_t getRHICfRunNumber(); + UInt_t getRHICfEventNumber(); UInt_t getRunType(); + UInt_t getBunchNumber(); UInt_t getTriggerNumber(); UInt_t getRunTime(Int_t idx); UInt_t getRunTRGM(); @@ -41,8 +45,13 @@ class StMuRHICfRawHit : public TObject UInt_t getGPI1(Int_t idx); private: - UInt_t mBunchNumber; + + // Important note: the _RHICf_ Run and Event numbers are distinct from the _STAR_ Run and Event numbers, + // originating from RHICf's own raw data acquisition and studies outside of the STAR framework. + UInt_t mRHICfRunNumber; + UInt_t mRHICfEventNumber; UInt_t mRunType; + UInt_t mBunchNumber; UInt_t mRHICfTrigger; UInt_t mRunTime[kRHICfNorder]; UInt_t mRunTRGM; @@ -56,7 +65,7 @@ class StMuRHICfRawHit : public TObject UInt_t mGPI0[kRHICfNgpi0]; // GPI0 UInt_t mGPI1[kRHICfNgpi1]; // GPI1 - ClassDef(StMuRHICfRawHit,1) + ClassDef(StMuRHICfRawHit,2) }; #endif diff --git a/StRoot/StMuDSTMaker/COMMON/StMuRHICfUtil.cxx b/StRoot/StMuDSTMaker/COMMON/StMuRHICfUtil.cxx index 471db4b9427..d59142e81ae 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuRHICfUtil.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuRHICfUtil.cxx @@ -52,8 +52,10 @@ void StMuRHICfUtil::fillMuRHICf(StMuRHICfCollection* muColl, StRHICfCollection* StMuRHICfRawHit* muRHICfRawHit = muColl -> addRawHit(); StRHICfRawHit* rhicfRawHit = coll -> rawHitCollection(); - muRHICfRawHit -> setBunchNumber(coll->getBunchNumber()); + muRHICfRawHit -> setRHICfRunNumber(coll->getRHICfRunNumber()); + muRHICfRawHit -> setRHICfEventNumber(coll->getRHICfEventNumber()); muRHICfRawHit -> setRunType(coll->getRunType()); + muRHICfRawHit -> setBunchNumber(coll->getBunchNumber()); muRHICfRawHit -> setTriggerNumber(coll->getTriggerNumber()); muRHICfRawHit -> setRunTime(0, coll->getRunTime(0)); muRHICfRawHit -> setRunTime(1, coll->getRunTime(1)); @@ -84,8 +86,11 @@ void StMuRHICfUtil::fillRHICf(StRHICfCollection* coll, StMuRHICfCollection* muCo StMuRHICfRawHit* muRHICfRawHit = muColl -> getRawHit(); StRHICfRawHit* rhicfRawHit = coll -> rawHitCollection(); - coll -> setBunchNumber(muRHICfRawHit->getBunchNumber()); + + coll -> setRHICfRunNumber(muRHICfRawHit->getRHICfRunNumber()); + coll -> setRHICfEventNumber(muRHICfRawHit->getRHICfEventNumber()); coll -> setRunType(muRHICfRawHit->getRunType()); + coll -> setBunchNumber(muRHICfRawHit->getBunchNumber()); coll -> setTriggerNumber(muRHICfRawHit->getTriggerNumber()); coll -> setRunTime(0, muRHICfRawHit->getRunTime(0)); coll -> setRunTime(1, muRHICfRawHit->getRunTime(1)); diff --git a/StRoot/StPicoDstMaker/StPicoDstMaker.cxx b/StRoot/StPicoDstMaker/StPicoDstMaker.cxx index 8cbded354f4..4e114feba2a 100644 --- a/StRoot/StPicoDstMaker/StPicoDstMaker.cxx +++ b/StRoot/StPicoDstMaker/StPicoDstMaker.cxx @@ -99,10 +99,10 @@ #include "StPicoEvent/StPicoArrays.h" #include "StPicoEvent/StPicoDst.h" #include "StPicoDstMaker/StPicoDstMaker.h" +#include "TSystem.h" #if defined (__TFG__VERSION__) #include "StarRoot/TDirIter.h" #include "StMuDSTMaker/COMMON/StMuProbPidTraits.h" -#include "TSystem.h" #include "TH1.h" #include "TH2.h" static Int_t _debug = 0; @@ -278,20 +278,20 @@ Int_t StPicoDstMaker::Init() { if (setVtxModeAttr() != kStOK) { LOG_ERROR << "Pico Vertex Mode is not set ... " << endm; - return kStErr; + return kStFatal; } } //if (mVtxMode == PicoVtxMode::NotSet) // To write or not to write covariance matrices into the branch if (setCovMtxModeAttr() != kStOK) { LOG_ERROR << "Pico covariance matrix I/O mode is not set ..." << endm; - return kStErr; + return kStFatal; } // To write or not to write BEmc Smd hits into the branch if (setBEmcSmdModeAttr() != kStOk) { LOG_ERROR << "Pico BEmc Smd I/O mode is not set ..." << endm; - return kStErr; + return kStFatal; } #if !defined (__TFG__VERSION__) @@ -302,13 +302,13 @@ Int_t StPicoDstMaker::Init() { mOutputFileName.ReplaceAll(".root", ".picoDst.root"); } else { - mInputFileName = mInputFileName(mInputFileName.Index("st_"), mInputFileName.Length()); + mInputFileName = gSystem->BaseName(mInputFileName); mOutputFileName = mInputFileName; mOutputFileName.ReplaceAll("MuDst.root", "picoDst.root"); if (mOutputFileName == mInputFileName) { LOG_ERROR << "Input file is not a MuDst ... " << endm; - return kStErr; + return kStFatal; } } #else /* __TFG__VERSION__ */ diff --git a/StRoot/StRHICfDbMaker/StRHICfDbMaker.cxx b/StRoot/StRHICfDbMaker/StRHICfDbMaker.cxx index bcec3e8428f..27b345e5659 100644 --- a/StRoot/StRHICfDbMaker/StRHICfDbMaker.cxx +++ b/StRoot/StRHICfDbMaker/StRHICfDbMaker.cxx @@ -262,6 +262,8 @@ Int_t StRHICfDbMaker::InitRun(Int_t runNumber) } //=========== Address ===========// +unsigned int StRHICfDbMaker::getRHICfRunNumberAddress() const {return 0;} +unsigned int StRHICfDbMaker::getRHICfEventNumberAddress() const {return 1;} unsigned int StRHICfDbMaker::getRunTRGMAddress() const {return 4;} unsigned int StRHICfDbMaker::getTriggerAddress() const {return 623;} unsigned int StRHICfDbMaker::getBunchNumberAddress() const {return 649;} diff --git a/StRoot/StRHICfDbMaker/StRHICfDbMaker.h b/StRoot/StRHICfDbMaker/StRHICfDbMaker.h index 8cad7ab5bec..5e0c9a400ba 100644 --- a/StRoot/StRHICfDbMaker/StRHICfDbMaker.h +++ b/StRoot/StRHICfDbMaker/StRHICfDbMaker.h @@ -44,6 +44,10 @@ class StRHICfDbMaker : public StMaker void setDebug(Int_t debug); ///< debug mode, 0 for minimal message, >0 for more debug messages + // Important note: the _RHICf_ Run and Event numbers are distinct from the _STAR_ Run and Event numbers, + // originating from RHICf's own raw data acquisition and studies outside of the STAR framework + unsigned int getRHICfRunNumberAddress() const; + unsigned int getRHICfEventNumberAddress() const; unsigned int getRunTRGMAddress() const; unsigned int getTriggerAddress() const; unsigned int getBunchNumberAddress() const; diff --git a/StRoot/StRHICfRawHitMaker/StRHICfRawHitMaker.cxx b/StRoot/StRHICfRawHitMaker/StRHICfRawHitMaker.cxx index fbdc5e9356b..f1d45956a2b 100644 --- a/StRoot/StRHICfRawHitMaker/StRHICfRawHitMaker.cxx +++ b/StRoot/StRHICfRawHitMaker/StRHICfRawHitMaker.cxx @@ -67,6 +67,10 @@ Int_t StRHICfRawHitMaker::Make() unsigned short* rawdata = (unsigned short*) daqData->GetTable(); // Insert general data + unsigned int rhicfRunIdx = mRHICfDbMaker->getRHICfRunNumberAddress(); + unsigned int rhicfEventIdx = mRHICfDbMaker->getRHICfEventNumberAddress(); + mRHICfCollection -> setRHICfRunNumber(gendata[rhicfRunIdx]); + mRHICfCollection -> setRHICfEventNumber(gendata[rhicfEventIdx]); mRHICfCollection -> setRunType(getRunType()); unsigned int bunchIdx = mRHICfDbMaker->getBunchNumberAddress(); diff --git a/StRoot/StRefMultCorr/BadRun.h b/StRoot/StRefMultCorr/BadRun.h index c5d6dd0f9da..b7ec89c4460 100644 --- a/StRoot/StRefMultCorr/BadRun.h +++ b/StRoot/StRefMultCorr/BadRun.h @@ -32,13 +32,16 @@ const Int_t badrun_refmult_2017[nBadRun_refmult_2017] = { // Run 18 // 1. Au+Au at 27 GeV // 2. Ru+Ru and Zr+Zr at 200 GeV +// 3. Au+Au at 3.85 AGeV FXT (3 GeV in CMS) // -const Int_t nBadRun_refmult_2018 = 253; +const Int_t nBadRun_refmult_2018 = 277; const Int_t badrun_refmult_2018[nBadRun_refmult_2018] = { // Au+Au 27 GeV 19130085, 19131009, 19131010, 19131012, 19132063, 19133009, 19133010, 19133012, 19133013, 19133014, 19133018, 19134010, 19134011, 19135011, 19135013, 19135014, 19136016, 19137003, 19137022, 19137047, 19137050, 19137051, 19137052, 19137053, 19137056, 19137057, 19138008, 19138009, 19138014, 19139022, 19139023, 19139024, 19139026, 19139027, 19139028, 19139032, 19139033, 19139034, 19139037, 19140009, 19140014, 19141008, 19142005, 19142048, 19143008, 19143009, 19143010, 19143011, 19143012, 19143013, 19143014, 19143015, 19143016, 19143017, 19146016, 19147007, 19147008, 19147009, 19147010, 19147014, 19147015, 19147016, 19156002, 19156032, 19156044, 19156045, 19156046, 19157013, 19158003, 19158007, 19158009, 19158010, 19158011, 19158013, 19158014, 19158015, 19158017, 19158018, 19158019, 19160018, 19162002, 19162005, 19165015, 19165020, 19165021, 19167042, // Isobar - 19083049, 19083050, 19083051, 19083052, 19083053, 19083054, 19083055, 19083056, 19083057, 19083058, 19083059, 19083060, 19083061, 19083062, 19083063, 19083064, 19083065, 19083066, 19083067, 19084001, 19084002, 19084003, 19084004, 19084005, 19084006, 19084007, 19084008, 19084010, 19084011, 19084013, 19084022, 19084024, 19084025, 19084026, 19084027, 19084028, 19084029, 19084030, 19084031, 19084032, 19084033, 19084034, 19084035, 19084036, 19084037, 19084038, 19084039, 19084053, 19084055, 19084057, 19084059, 19084060, 19084061, 19084062, 19084063, 19084064, 19084065, 19084066, 19084067, 19084068, 19084070, 19084071, 19084072, 19085001, 19085002, 19085003, 19085004, 19085005, 19085006, 19085007, 19085008, 19085009, 19085010, 19085011, 19085012, 19085013, 19085014, 19085015, 19085016, 19085017, 19085018, 19085019, 19085020, 19085021, 19085023, 19085024, 19085025, 19085026, 19085058, 19086026, 19086060, 19086061, 19086062, 19086063, 19086064, 19086066, 19086067, 19086069, 19086070, 19086072, 19086073, 19086074, 19086076, 19086077, 19086080, 19087001, 19087012, 19087014, 19087015, 19087016, 19087017, 19087021, 19087022, 19087038, 19087042, 19088051, 19088052, 19088053, 19088055, 19090009, 19090010, 19090011, 19090012, 19090015, 19090016, 19090018, 19090019, 19090021, 19090022, 19090023, 19090024, 19090025, 19090032, 19092051, 19093042, 19093043, 19095061, 19096002, 19096005, 19096006, 19096057, 19097057, 19098017, 19098018, 19098020, 19100045, 19102023, 19102054, 19103007, 19103022, 19103041, 19105024, 19105026, 19106023, 19106034, 19107045, 19110015, 19110039, 19112012, 19112029, 19115020, 19116035, 19120009, 19120047, 19120048, 19122004, 19122005 + 19083049, 19083050, 19083051, 19083052, 19083053, 19083054, 19083055, 19083056, 19083057, 19083058, 19083059, 19083060, 19083061, 19083062, 19083063, 19083064, 19083065, 19083066, 19083067, 19084001, 19084002, 19084003, 19084004, 19084005, 19084006, 19084007, 19084008, 19084010, 19084011, 19084013, 19084022, 19084024, 19084025, 19084026, 19084027, 19084028, 19084029, 19084030, 19084031, 19084032, 19084033, 19084034, 19084035, 19084036, 19084037, 19084038, 19084039, 19084053, 19084055, 19084057, 19084059, 19084060, 19084061, 19084062, 19084063, 19084064, 19084065, 19084066, 19084067, 19084068, 19084070, 19084071, 19084072, 19085001, 19085002, 19085003, 19085004, 19085005, 19085006, 19085007, 19085008, 19085009, 19085010, 19085011, 19085012, 19085013, 19085014, 19085015, 19085016, 19085017, 19085018, 19085019, 19085020, 19085021, 19085023, 19085024, 19085025, 19085026, 19085058, 19086026, 19086060, 19086061, 19086062, 19086063, 19086064, 19086066, 19086067, 19086069, 19086070, 19086072, 19086073, 19086074, 19086076, 19086077, 19086080, 19087001, 19087012, 19087014, 19087015, 19087016, 19087017, 19087021, 19087022, 19087038, 19087042, 19088051, 19088052, 19088053, 19088055, 19090009, 19090010, 19090011, 19090012, 19090015, 19090016, 19090018, 19090019, 19090021, 19090022, 19090023, 19090024, 19090025, 19090032, 19092051, 19093042, 19093043, 19095061, 19096002, 19096005, 19096006, 19096057, 19097057, 19098017, 19098018, 19098020, 19100045, 19102023, 19102054, 19103007, 19103022, 19103041, 19105024, 19105026, 19106023, 19106034, 19107045, 19110015, 19110039, 19112012, 19112029, 19115020, 19116035, 19120009, 19120047, 19120048, 19122004, 19122005, + // Au+Au 3.85 AGeV + 19151029, 19151045, 19152001, 19152078, 19153023, 19153032, 19153065, 19154012, 19154013, 19154014, 19154015, 19154016, 19154017, 19154018, 19154019, 19154020,19154021,19154022,19154023,19154024, 19154026,19154046,19154051, 19154056 }; // Run14, P16id production @@ -66,16 +69,47 @@ const Int_t badrun_grefmult_2016[nBadRun_grefmult_2016] = { // 1. Au+Au 19.6 GeV (374) // 2. Au+Au 14.6 GeV (bad runs: 153 + injection runs: 403 = 556) // 3. Au+Au 200 GeV (5) +// 4. Au+Au 4.59 AGeV (10) = 3.2 GeV +// 5. Au+Au 7.3 AGeV (1) = 3.9 GeV // -const Int_t nBadRun_refmult_2019 = 935; +const Int_t nBadRun_refmult_2019 = 951; const Int_t badrun_refmult_2019[nBadRun_refmult_2019] = { // Au+Au 19.6 GeV 20057007, 20057025, 20057026, 20057050, 20058001, 20058002, 20058003, 20058004, 20058005, 20060012, 20060022, 20060025, 20060060, 20060061, 20060062, 20062010, 20062011, 20062012, 20062036, 20063011, 20063034, 20063035, 20063036, 20063039, 20064008, 20064009, 20064011, 20064012, 20064040, 20065018, 20067014, 20067023, 20067024, 20067029, 20067030, 20067045, 20067046, 20069030, 20069032, 20069054, 20070042, 20070043, 20070044, 20070047, 20071001, 20071004, 20071005, 20071006, 20071027, 20071037, 20072034, 20072035, 20072036, 20072039, 20072041, 20072045, 20072047, 20073071, 20073072, 20073076, 20074001, 20074003, 20074004, 20074005, 20074007, 20074008, 20074009, 20074012, 20074014, 20074017, 20074018, 20074020, 20074021, 20074026, 20074027, 20074029, 20074032, 20074033, 20074034, 20074044, 20074045, 20075001, 20075002, 20075006, 20075007, 20075009, 20075011, 20075013, 20081002, 20081014, 20082060, 20082065, 20083024, 20086012, 20087007, 20089008, 20090024, 20091011, 20092054, 20062007, 20062009, 20065017, 20065056, 20065060, 20066001, 20066008, 20066015, 20066019, 20066023, 20066026, 20066066, 20066067, 20066068, 20066073, 20066078, 20067001, 20067004, 20067009, 20067012, 20067015, 20067016, 20067019, 20067028, 20067038, 20067041, 20067047, 20068001, 20068004, 20068008, 20068012, 20068019, 20068026, 20068034, 20068051, 20068055, 20068058, 20068060, 20068064, 20069001, 20069004, 20069007, 20069010, 20069020, 20069023, 20069026, 20069031, 20069033, 20069042, 20069050, 20069053, 20069057, 20069060, 20070002, 20070005, 20070010, 20070013, 20070016, 20070019, 20070041, 20070045, 20071003, 20071007, 20071010, 20071013, 20071016, 20071019, 20071024, 20071029, 20071036, 20071041, 20071044, 20071047, 20071050, 20071053, 20071056, 20071059, 20071063, 20072002, 20072005, 20072009, 20072012, 20072016, 20072037, 20072038, 20072046, 20072050, 20072055, 20073002, 20073006, 20073013, 20073017, 20073022, 20073025, 20073074, 20074002, 20074006, 20074010, 20074011, 20074016, 20074019, 20074023, 20074030, 20074043, 20074046, 20075004, 20075008, 20075014, 20075010, 20075015, 20075020, 20075025, 20075031, 20075035, 20075039, 20075043, 20075048, 20075054, 20075057, 20075060, 20075066, 20076001, 20076004, 20076007, 20076010, 20076013, 20076017, 20076021, 20076025, 20076028, 20076031, 20076034, 20076037, 20076040, 20076045, 20076048, 20076051, 20076054, 20076059, 20077002, 20077005, 20077008, 20077011, 20077014, 20077017, 20077018, 20078001, 20078007, 20078013, 20078016, 20078019, 20078022, 20078028, 20078032, 20078035, 20078040, 20078043, 20078046, 20078051, 20078054, 20078057, 20078060, 20078063, 20078067, 20079006, 20079009, 20079013, 20079017, 20079020, 20079023, 20079044, 20080006, 20080009, 20080012, 20080016, 20080020, 20081001, 20081004, 20081007, 20081012, 20081015, 20081018, 20081025, 20082002, 20082005, 20082010, 20082013, 20082016, 20082019, 20082024, 20082029, 20082034, 20082038, 20082047, 20082050, 20082053, 20082056, 20082059, 20082063, 20082066, 20083001, 20083004, 20083019, 20083022, 20083025, 20083029, 20083032, 20083074, 20083077, 20083079,20084001, 20084002, 20084005, 20084009, 20084013, 20084016, 20084022, 20085006, 20085009, 20085017, 20086002, 20086005, 20086056, 20086011, 20086015, 20087008, 20087012, 20087021, 20088005, 20088009, 20088012, 20088030, 20088033, 20088037, 20089003, 20089006, 20089009, 20089012, 20089015, 20089018, 20089028, 20090002, 20090005, 20090008, 20090011, 20090014, 20090017, 20090021, 20090031, 20090048, 20091003, 20091006, 20091009, 20091012, 20091016, 20091019, 20091020, 20092005, 20092012, 20092015, 20092018, 20092021, 20092024, 20092027, 20092030, 20092033, 20092038, 20092053, 20092057, 20093001, 20093005, 20093010, 20093016, 20093025, 20093035, // Au+Au 14.6 GeV 20094053, 20094054, 20096025, 20099032, 20099033, 20099034, 20099044, 20099048, 20099052, 20101002, 20102001, 20102002, 20102003, 20102013, 20102014, 20102035, 20102036, 20102053, 20103002, 20103003, 20103005, 20103006, 20104016, 20108010, 20108012, 20108013, 20110001, 20110022, 20111020, 20111047, 20113055, 20113063, 20113066, 20113067, 20113068, 20113069, 20113070, 20113081, 20113088, 20114025, 20114026, 20114031, 20117013, 20117055, 20119005, 20119053, 20120047, 20123015, 20123016, 20123018, 20123038, 20124001, 20124037, 20124051, 20124058, 20124059, 20124060, 20124062, 20124064, 20124066, 20124068, 20124070, 20124072, 20124074, 20124077, 20124079, 20125003, 20125005, 20125007, 20125008, 20125010, 20125011, 20125013, 20125015, 20125016, 20125018, 20125020, 20125023, 20125025, 20125027, 20125028, 20125029, 20125030, 20125031, 20125033, 20125034, 20125035, 20125036, 20125038, 20125039, 20125041, 20125044, 20125047, 20125048, 20125049, 20125050, 20125053, 20125055, 20125057, 20125058, 20125059, 20126004, 20126005, 20126006, 20126007, 20126008, 20126010, 20126013, 20126014, 20126015, 20126017, 20126019, 20126021, 20126025, 20126027, 20126029, 20127006, 20127007, 20127010, 20127012, 20128043, 20131015, 20131028, 20132002, 20132012, 20134024, 20136001, 20136003, 20136006, 20136008, 20137005, 20137011, 20137013, 20137015, 20137017, 20138002, 20138015, 20138039, 20139033, 20141002, 20143007, 20144038, 20147022, 20148007, 20148031, 20150004, 20151003, 20151006, 20151012, 20152026, 20152028, 20152029, 20152030, 20094051, 20094055, 20094058, 20094062, 20094063, 20094064, 20094065, 20094066, 20094069, 20094075, 20094078, 20094082, 20094092, 20094100, 20094103, 20095007, 20095011, 20095014, 20095015, 20095017, 20096003, 20096006, 20096012, 20096013, 20096019, 20096028, 20097002, 20097003, 20097007, 20097010, 20097016, 20097020, 20097025, 20097032, 20098001, 20098004, 20098007, 20098011, 20098014, 20098018, 20099020, 20099031, 20099041, 20099042, 20100006, 20100011, 20100018, 20101015, 20102015, 20102033, 20103004, 20103007, 20104002, 20104013, 20104020, 20106019, 20107001, 20107003, 20107007, 20107015, 20107018, 20107021, 20107023, 20107025, 20107030, 20108004, 20108008, 20108014, 20108018, 20108021, 20108024, 20108026, 20108027, 20110004, 20110005, 20110006, 20110008, 20110010, 20110011, 20110013, 20110015, 20110018, 20110020, 20110024, 20110026, 20110029, 20110032, 20110038, 20110041, 20110045, 20110048, 20110051, 20110053, 20111002, 20111004, 20111011, 20111012, 20111015, 20111017, 20111019, 20111024, 20111026, 20111028, 20111031, 20111033, 20111037, 20111039, 20111041, 20111045, 20111050, 20111051, 20111054, 20111057, 20112001, 20112003, 20112005, 20112007, 20112009, 20112012, 20112015, 20112029, 20113011, 20113016, 20113017, 20113021, 20113022, 20113028, 20113031, 20113033, 20113036, 20113038, 20113051, 20113053, 20113054, 20113056, 20113072, 20113080, 20113093, 20113094, 20114002, 20114004, 20114006, 20114009, 20114028, 20114029, 20114032, 20114038, 20114040, 20115002, 20115003, 20115006, 20115007, 20115010, 20115011, 20115013, 20115015, 20115017, 20117009, 20117011, 20117014, 20117016, 20117018, 20117020, 20117021, 20117024, 20117035, 20117038, 20117041, 20117048, 20117052, 20117056, 20118005, 20118008, 20118010, 20118012, 20118014, 20118020, 20118032, 20118034, 20118037, 20118041, 20118045, 20118047, 20118052, 20118058, 20118069, 20118073, 20118081, 20118085, 20118090, 20119002, 20119008, 20119011, 20119013, 20119015, 20119016, 20119019, 20119022, 20119023, 20119026, 20119055, 20120002, 20120004, 20120006, 20120010, 20120013, 20120014, 20120016, 20120018, 20120021, 20120037, 20120039, 20120041, 20120043, 20120046, 20120048, 20120050, 20121002, 20121007, 20121010, 20121012, 20121017, 20121020, 20122003, 20122007, 20122009, 20122014, 20122023, 20122024, 20123003, 20123004, 20123008, 20123010, 20123012, 20123014, 20123017, 20123042, 20124002, 20124006, 20124012, 20124013, 20124015, 20124017, 20124019, 20124022, 20124028, 20124029, 20124039, 20124040, 20124042, 20124044, 20124055, 20124056, 20124061, 20124063, 20124065, 20124067, 20124069, 20124071, 20124073, 20124076, 20124078, 20125001, 20125002, 20125004, 20125006, 20125009, 20125012, 20125014, 20125017, 20125019, 20125021, 20125022, 20125024, 20125026, 20125032, 20125037, 20125040, 20125042, 20125043, 20125045, 20125046, 20125051, 20125052, 20125054, 20125056, 20126009, 20126011, 20126012, 20126016, 20126018, 20126020, 20126024, 20126026, 20126028, 20127008, 20127021, 20127030, 20127036, 20127039, 20127044, 20127046, 20127048, 20127053, 20127058, 20127060, 20127065, 20127070, 20127072, 20127076, 20128001, 20128004, 20128010, 20128014, 20128016, 20128044, 20128046, 20128048, 20128050, 20128052, 20129001, 20129003, 20129005, 20129007, 20129009, 20129011, 20129013, 20130006, 20130008, 20130011, 20130013, 20130015, 20130017, 20131001, 20131003, 20131005, 20131008, 20131010, 20131012, 20131014, 20131016, 20131019, 20131023, 20131027, 20131029, 20131031, 20131037, 20131039, 20131041, 20131043, 20131045, 20132001, 20132003, 20132005, 20132007, 20132009, 20132011, 20132013, 20132015, 20132017, 20132020, 20132024, 20132026, 20132029, 20132033, 20132035, 20132038, 20132040, 20132044, 20132050, 20132054, 20132058, 20133001, 20133003, 20133005, 20133008, 20133012, 20133015, 20133016, 20133018, 20133020, 20134002, 20134010, 20134012, 20134014, 20134019, 20134021, 20134025, 20134035, 20134038, 20134040, 20134043, 20134045, 20134047, 20134049, 20134051, 20134053, 20134055, 20135001, 20135003, 20135007, 20135010, 20135012, // Au+Au 200 GeV - 20191005, 20191015, 20192001, 20193001, 20193019 + 20191005, 20191015, 20192001, 20193001, 20193019, + // Au+Au 4.59 AGeV (3.2 GeV) + 20180005, 20180006, 20180019, 20180025, 20181016, 20182034, 20183001, 20183013, 20183014, 20183019, + // Au+Au 7.3 AGeV (1) = 3.9 GeV + 20107029, 20113042, 20113043, 20169033, 20169043, 20169051 }; +// +// Run 20 +// 1. Au+Au 31.2 AGeV (3) = 7.7 GeV +// 2. Au+Au 7.3 AGeV (4) = 3.9 GeV +// 3. Au+Au 5.75 AGeV (8) = 3.5 GeV +// +const Int_t nBadRun_refmult_2020 = 15; +const Int_t badrun_refmult_2020[nBadRun_refmult_2020] = { + // Au+Au 31.2 AGeV (7.7 GeV) + 21029002, 21029013, 21029027, + // Au+Au 7.3 AGeV (3.9 GeV) + 21035008, 21035011, 21036012, 21035014, + // Au+Au 5.75 AGeV (3.5 GeV) + 20355020, 20355021, 21044023, 21045024, 21045025, 21044027, 21044035, 21045004 +}; + +// +// Run 21 +// 1. Au+Au 7.7 GeV (139) +// +const Int_t nBadRun_refmult_2021 = 139; +const Int_t badrun_refmult_2021[nBadRun_refmult_2021] = { + // Au+Au 7.7 GeV + 22031054, 22033001, 22035002, 22038009, 22039010, 22039013, 22039028, 22042004, 22043046, 22043047, 22044003, 22044004, 22044005, 22046006, 22046007, 22046012, 22047008, 22048002, 22048007, 22048040, 22048042, 22049026, 22049027, 22049029, 22050003, 22050006, 22050016, 22050038, 22050040, 22050044, 22050045, 22051014, 22052032, 22052033, 22052035, 22052036, 22052048, 22053022, 22054007, 22054022, 22054028, 22054030, 22054042, 22055023, 22057010, 22058037, 22059005, 22061012, 22061015, 22062034, 22062035, 22062036, 22063014, 22064025, 22064038, 22065014, 22065015, 22067039, 22068012, 22068041, 22069030, 22069032, 22069033, 22069034, 22069040, 22070001, 22070002, 22070003, 22070004, 22070005, 22070006, 22070007, 22070008, 22070009, 22070010, 22070011, 22070012, 22070014, 22070040, 22070041, 22071036, 22074009, 22074042, 22076033, 22076034, 22077050, 22078016, 22078032, 22079027, 22084029, 22084035, 22085009, 22085021, 22086027, 22087027, 22088034, 22091018, 22091022, 22091025, 22093029, 22094046, 22095027, 22096003, 22096037, 22097016, 22097030, 22098054, 22099024, 22099042, 22100045, 22101016, 22101017, 22101018, 22101022, 22102034, 22103027, 22103032, 22104027, 22105030, 22106032, 22108050, 22109032, 22110025, 22111047, 22112021, 22113001, 22113029, 22114030, 22115004, 22115008, 22115019, 22115032, 22116007, 22116008, 22116025, 22116026, 22116030, 22117023, 22118058 +}; #endif diff --git a/StRoot/StRefMultCorr/CentralityMaker.cxx b/StRoot/StRefMultCorr/CentralityMaker.cxx index 8d38b0f04ed..b62033fa6e3 100644 --- a/StRoot/StRefMultCorr/CentralityMaker.cxx +++ b/StRoot/StRefMultCorr/CentralityMaker.cxx @@ -46,6 +46,7 @@ CentralityMaker::CentralityMaker() { fRefMult2Corr = new StRefMultCorr("refmult2") ; fRefMult3Corr = new StRefMultCorr("refmult3") ; fRefMultCorr_Isobar = new StRefMultCorr("refmult","Isobar") ; + fRefMultCorrFxt = new StRefMultCorr("fxtmult"); // fTofTrayMultCorr = new StRefMultCorr("toftray") ; fgRefMultCorr = new StRefMultCorr("grefmult") ; fgRefMultCorr_Run14_AuAu200_VpdMB5_P16id = new StRefMultCorr("grefmult","Run14_AuAu200_VpdMB5","P16id") ; @@ -91,6 +92,11 @@ StRefMultCorr* CentralityMaker::getRefMultCorr_Isobar() { return fRefMultCorr_Isobar ; } +//_________________ +StRefMultCorr* CentralityMaker::getRefMultCorrFxt() { + return fRefMultCorrFxt; +} + /* //_________________ StRefMultCorr* CentralityMaker::getTofTrayMultCorr() { diff --git a/StRoot/StRefMultCorr/CentralityMaker.h b/StRoot/StRefMultCorr/CentralityMaker.h index bde8025c6ce..3c0515eefd3 100644 --- a/StRoot/StRefMultCorr/CentralityMaker.h +++ b/StRoot/StRefMultCorr/CentralityMaker.h @@ -43,7 +43,7 @@ #ifndef __CentralityMaker_h__ #define __CentralityMaker_h__ -class StRefMultCorr ; +class StRefMultCorr; #include "Rtypes.h" //_________________ @@ -57,6 +57,7 @@ class CentralityMaker { StRefMultCorr* getRefMult2Corr() ; // For refmult2 StRefMultCorr* getRefMult3Corr() ; // For refmult3 StRefMultCorr* getRefMultCorr_Isobar() ; // For refmult + StRefMultCorr* getRefMultCorrFxt(); // For fixed-target data // StRefMultCorr* getTofTrayMultCorr() ; // For TOF tray multiplicity StRefMultCorr* getgRefMultCorr() ; // For grefmult //Run14 AuAu200GeV StRefMultCorr* getgRefMultCorr_Run14_AuAu200_VpdMB5_P16id() ; @@ -74,12 +75,13 @@ class CentralityMaker { static CentralityMaker* fInstance ; // Static pointer of CentralityMaker // Centrality correction classes - StRefMultCorr* fRefMultCorr ; // refmult based centrality - StRefMultCorr* fRefMult2Corr ; // refmult2 based centrality - StRefMultCorr* fRefMult3Corr ; // refmult3 based centrality + StRefMultCorr* fRefMultCorr ; // refmult-based centrality + StRefMultCorr* fRefMult2Corr ; // refmult2-based centrality + StRefMultCorr* fRefMult3Corr ; // refmult3-based centrality StRefMultCorr* fRefMultCorr_Isobar ; // refmult based centrality - // StRefMultCorr* fTofTrayMultCorr ; // tofTrayMult based centrality - StRefMultCorr* fgRefMultCorr ; // grefmult based centrality + StRefMultCorr* fRefMultCorrFxt; // fxtMult-based centrality + // StRefMultCorr* fTofTrayMultCorr ; // tofTrayMult-based centrality + StRefMultCorr* fgRefMultCorr ; // grefmult-based centrality StRefMultCorr* fgRefMultCorr_Run14_AuAu200_VpdMB5_P16id ; StRefMultCorr* fgRefMultCorr_Run14_AuAu200_VpdMB30_P16id ; StRefMultCorr* fgRefMultCorr_Run14_AuAu200_VpdMBnoVtx_P16id ; diff --git a/StRoot/StRefMultCorr/Param.cxx b/StRoot/StRefMultCorr/Param.cxx index 3af270eec4a..bd79a3cd77f 100644 --- a/StRoot/StRefMultCorr/Param.cxx +++ b/StRoot/StRefMultCorr/Param.cxx @@ -17,6 +17,7 @@ const string getParamX( const int x, const int y1, const int y2 ) { case 2: str = mParamStr_ref2[y1][y2]; break; case 3: str = mParamStr_ref3[y1][y2]; break; case 4: str = mParamStr_ref4[y1][y2]; break; + case 5: str = mParamStr_ref5[y1][y2]; break; default: str = "0"; } return str; diff --git a/StRoot/StRefMultCorr/Param.h b/StRoot/StRefMultCorr/Param.h index a827d2ee3f7..e8dc4108782 100644 --- a/StRoot/StRefMultCorr/Param.h +++ b/StRoot/StRefMultCorr/Param.h @@ -7,6 +7,7 @@ using std::string; //======================================================================================= //if you want to add new parameters, please always add after the current parameters, do not insert between them //the order of them is important!!!!!!!!!!!!! +// gRefMult section //======================================================================================= const int nID_gref = 7; const int nSet_gref = 6; @@ -79,8 +80,9 @@ const string mParamStr_gref[nID_gref][nSet_gref] = { //======================================================================================= //if you want to add new parameters, please always add after the current parameters, do not insert between them //the order of them is important!!!!!!!!!!!!! +// RefMult1 section //======================================================================================= -const int nID_ref1 = 41;//after add N more new group of parameters, need to update nID_ref1 += N +const int nID_ref1 = 42;//after add N more new group of parameters, need to update nID_ref1 += N const int nSet_ref1 = 6; const string mParamStr_ref1[nID_ref1][nSet_ref1] = { // mParameterIndex = 0 @@ -92,7 +94,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.99051,22.0065,4.02331,-20.8187,-8.88498e-06,0.000886727,0,0", "171,-0.33" }, - + // mParameterIndex = 1 { "2010:200:11028089,11035026:-30,30", "10,15,21,30,41,55,73,94,119,149,184,223,269,321,379,446", @@ -101,7 +103,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.964406,23.6525,4.09475,-20.4268,1.51988e-05,0.000649946,0,0", "171,-0.33" }, - + // mParameterIndex = 2 { "2010:200:11035061,11054067:-30,30", "10,15,21,30,41,55,73,94,119,149,184,223,269,321,379,446", @@ -110,7 +112,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.98071,25.8699,4.06555,-20.4771,-3.55299e-06,0.000832471,0,0", "171,-0.33" }, - + // mParameterIndex = 3 { "2010:200:11055095,11077018:-30,30", "10,15,21,30,41,55,73,94,119,149,184,223,269,321,379,446", @@ -119,7 +121,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.983422,23.8855,4.14735,-21.4205,-9.88422e-06,0.000865886,0,0", "171,-0.33" }, - + // mParameterIndex = 4 { "2010:62.4:11077023,11081058:-40,40", "7,11,16,22,30,41,54,69,88,109,135,165,199,239,285,339", @@ -128,7 +130,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.784198,96.3743,18.0256,43.3586,0.000193941,5.31901e-05,0,0", "0,0" }, - // mParameterIndex = 5 { "2010:62.4:11081059,11098060:-40,40", @@ -138,7 +139,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "1.02181,64.2068,46.7363,-86.7449,-2.81908e-08,4.50725e-05,0,0", "0,0" }, - + // mParameterIndex = 6 { "2010:39:11098062,11106007:-40,40", "7,10,15,21,28,38,50,64,81,102,125,153,185,222,265,316", @@ -147,7 +148,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "1.01837,40.9401,55.7224,-225.094,-6.76875e-06,2.90872e-05,0,0", "0,0" }, - + // mParameterIndex = 7 { "2010:39:11106008,11113047:-40,40", "7,10,15,21,28,38,50,64,81,102,125,153,185,222,265,316", @@ -156,7 +157,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "1.02912,40.4629,56.9218,-236.815,-7.60843e-06,2.68036e-05,0,0", "0,0" }, - + // mParameterIndex = 8 { "2010:7.7:11113050,11124053:-70,70", "4,6,8,12,16,22,28,37,46,58,72,87,106,128,154,185", @@ -165,7 +166,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.8352,86.974,50.0054,-83.1208,7.37246e-05,3.98413e-05,0,0", "0,0" }, - + // mParameterIndex = 9 { "2010:7.7:11124054,11147040:-70,70", "4,6,8,12,16,22,28,37,46,58,72,87,106,128,154,185", @@ -174,7 +175,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.90686,60.1308,54.4187,-144.449,3.4559e-05,7.07684e-05,0,0", "0,0" }, - // mParameterIndex = 10 { "2010:11.5:11147041,11152058:-50,50", @@ -184,7 +184,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.901325,68.5632,53.1088,-149.965,3.77108e-05,4.1719e-05,0,0", "0,0" }, - + // mParameterIndex = 11 { "2010:11.5:11152059,11160010:-50,50", "5,7,10,14,19,26,34,44,56,70,86,105,127,153,184,221", @@ -193,7 +193,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.921088,65.7025,52.9872,-153.578,3.25228e-05,5.05313e-05,0,0", "0,0" }, - + // mParameterIndex = 12 { "2011:19.6:12111032,12119029:-70,70", "6,8,12,17,23,30,40,52,66,83,102,125,152,183,220,263", @@ -202,7 +202,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "1.00746,35.1459,55.9769,-299.014,-6.32608e-06,5.2202e-05,0,0", "0,0" }, - + // mParameterIndex = 13 { "2011:19.6:12119030,12122025:-70,70", "6,8,12,17,23,30,40,52,66,83,102,125,152,183,220,263", @@ -211,7 +211,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.953142,63.1022,51.98,-243.39,1.54744e-05,9.26225e-05,0,0", "0,0" }, - + // mParameterIndex = 14 { "2011:200:12126101,12138024:-30,30", "10,15,22,31,43,58,76,98,125,156,193,234,281,335,396,466", @@ -220,7 +220,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.9725,23.69,4.226,-16.59,-3.37e-06,0.0009126,0,0", "183.9,-0.2811" }, - // mParameterIndex = 15 { "2011:200:12138081,12145020:-30,30", @@ -230,7 +229,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "1.006,24.58,4.158,-17.55,-3.534e-05,0.0007344,0,0", "180.9,-0.3407" }, - + // mParameterIndex =16 { "2011:200:12149028,12152016:-30,30", "10,15,22,31,43,58,76,98,125,156,193,234,281,335,396,466", @@ -239,7 +238,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.9823,21.08,4.209,-18.01,-1.382e-05,0.0009383,0,0", "184.8,-0.134" }, - + // mParameterIndex = 17 { "2011:200:12153008,12154021:-30,30", "10,15,22,31,43,58,76,98,125,156,193,234,281,335,396,466", @@ -248,7 +247,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.9973,21.42,4.197,-18.3,-2.601e-05,0.0009335,0,0", "183.4,-0.1059" }, - // mParameterIndex = 18 { "2011:200:12154038,12165031:-30,30", @@ -258,7 +256,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.9995,21.89,4.191,-18.17,-2.723e-05,0.0009326,0,0", "183.1,-0.0749" }, - + // mParameterIndex = 19 { "2011:200:12165037,12171016:-30,30", "10,15,22,31,43,58,76,98,125,156,193,234,281,335,396,466", @@ -267,7 +265,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.9837,24.47,4.161,-17.42,-1.502e-05,0.0008967,0,0", "185.2,-0.1916" }, - + // mParameterIndex = 20 { "2011:27:12171018,12180056:-70,70", "6,9,13,19,26,35,45,58,74,92,114,139,168,201,241,288", @@ -276,7 +274,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.997565,57.0141,52.4999,-92.3577,-2.7663e-08,-1.06086e-05,0,0", "0,0" }, - // mParameterIndex = 21 { "2012:193:13116062,13118024:-30,30", @@ -286,7 +283,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-4.76" }, - // mParameterIndex = 22 { "2012:193:13118033,13125006:-30,30", @@ -296,7 +292,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-1.63" }, - // mParameterIndex = 23 { "2012:193:13125010,13129018:-30,30", @@ -306,7 +301,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-1.9" }, - // mParameterIndex = 24 { "2012:193:13129026,13130033:-30,30", @@ -316,7 +310,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-2.27" }, - // mParameterIndex = 25; { "2012:193:13131006,13132010:-30,30", @@ -326,7 +319,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-3" }, - // mParameterIndex = 26; { "2012:193:13132014,13136015:-30,30", @@ -336,7 +328,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0,0,0,0,0,0,0,0", "604.5,-2.42" }, - // mParameterIndex = 27; { "2014:14.5:15053000,15070021:-70,70", @@ -346,7 +337,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.797748,5.44478,1.3871,-0.96068,0.00127508,6.53791e-06,0,0", "0,0" }, - // mParameterIndex = 28; // --> Vz dependent centrality definition for Vz<-27 and Vz>25 // --> Corrections are done for |Vz|<30 cm @@ -359,6 +349,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.8115,244.6,24.29,-21.8,5.799e-05,0,0,0", "0,0" }, + // // mParameterIndex = 29; // Run17 54.4 GeV, trigid = 580021 { @@ -369,7 +360,6 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "0.811,238.9,24.31,-25.16,6.325e-05", "0,0" }, - // // Run18 27 GeV AuAu // @@ -458,7 +448,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { { "2019:19.6:20056032,20093036:-145,145", // Year, energy, run start end, Vz range "6,9,13,18,24,32,43,55,70,88,110,135,165,201,243,296", // Centrality definition - "50", // Normalization start + "164", // Normalization start "0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00", // Vz correction parameters "1.04433,-1.13957e-01,4.54889e-01,-3.43209e-01,-1.55692e-03,0,4.00872e+00,1.03440e-05", // Trigger efficiency "0,0" // Luminosity correction @@ -468,7 +458,7 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { { "2019:14.6:20094048,20154013:-145,145", // Year, energy, run start end, Vz range "6,9,13,18,24,32,41,53,67,84,103,127,154,185,223,270", // Centrality definition - "20", // Normalization start + "154", // Normalization start "0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) "1.05956,-1.25292,5.51106e-01,1.65283,-1.48792e-3,0,1.31733e+01,8.15878e-06", // Trigger efficiency "0,0" // Luminosity correction @@ -481,10 +471,107 @@ const string mParamStr_ref1[nID_ref1][nSet_ref1] = { "150", // Normalization start "0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) "1.13418,-1.68334e-2,1.68995e-3,1.03279e-2,-4.42083e-1,0,1.47591e-3,4.36703e-1", // Trigger efficiency - "2.14803e+02,-4.58703e-4" // Luminosity correction + "2.14803e+02,-4.58703e-4" // Luminosity correction + }, + //mParameterIndex = 41 + //Run21 Au+Au 7.7 GeV, TrigerID = 810010,810020,810030,810040 + { + "2021:7.7:22031042,22121018:-145,145", // Year, energy, run start end, Vz range + "4,6,8,12,16,21,28,37,47,59,74,91,112,135,164,201", // Centrality definition + "100", // Normalization start + "0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.48905,-9610.65,622.081,4102.52,-1.06441e-05,0,7.59456e+07,7.24623e-11", // Trigger efficiency + "0,0" // Luminosity correction } }; +//======================================================================================= +//if you want to add new parameters, please always add after the current parameters, do not insert between them +//the order of them is important!!!!!!!!!!!!! +// FXT section +//======================================================================================= +const int nID_ref5 = 7;//after add N more new group of parameters, need to update nID_ref1 += N +const int nSet_ref5 = 6; +const string mParamStr_ref5[nID_ref5][nSet_ref5] = { + // mParameterIndex = 0 + // Run 18 Au+Au 3.85 GeV (sqrt(s_NN)=3 GeV), Trigger ID = 620052 + { + "2018:3.85:19151029,19155022:198,202", // Year, energy, run start end, Vz range + "5,7,9,12,16,21,26,33,41,50,60,72,86,101,119,142", // Multiplicity values for the centrality classes + "40", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "0.,0.,0.,0.,0.,0.,0.,0.", // Trigger efficiency (should be recalculated due to the loss) + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 1 + // Run 19 Au+Au 4.59 GeV (sqrt(s_NN)=3.2 GeV), Trigger ID = 680001 + { + "2019:4.59:20179040,20183025:198,202", // Year, energy, run start end, Vz range + "6,9,13,17,23,30,38,48,59,72,87,104,122,144,169,200", // Multiplicity values for the centrality classes + "118", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.078,0.0143,0.0615,-0.0531,-0.0298,0,0.0516,0.00214", // Trigger efficiency + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 2 + // Run 20 Au+Au 5.75 GeV (sqrt(s_NN)=3.5 GeV), Trigger ID = 720000, first RunID range + { + "2020:5.75:20355020,20355021:198,202", // Year, energy, run start end, Vz range + "6,8,12,16,22,28,37,47,59,73,89,108,128,152,181,217", // Multiplicity values for the centrality classes + "107", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.175,-0.0760,0.0547,-0.0129,-0.0565,0,0.0802,0.00470", // Trigger efficiency + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 3 + // Run 19 Au+Au 7.3 GeV (sqrt(s_NN)=3.9 GeV), Trigger ID = 1 + { + "2019:7.3:20107029,20169055:198,202", // Year, energy, run start end, Vz range + "7,10,14,19,26,33,43,55,68,83,101,122,144,170,200,238", // Multiplicity values for the centrality classes + "141", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.146,0.0652,0.0587,-0.172,-0.0444,0,0.0111,0.00287", // Trigger efficiency + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 4 + // Run 20 Au+Au 7.3 GeV (sqrt(s_NN)=3.9 GeV), Trigger ID = 730000 + { + "2020:7.3:21035003,21036013:198,202", // Year, energy, run start end, Vz range + "6,9,13,17,23,31,40,51,64,79,97,117,139,166,197,236", // Multiplicity values for the centrality classes + "141", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.170,-0.109,0.0439,-0.00154,-0.0508,0,0.0799,0.00391", // Trigger efficiency + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 5 + // Run 20 Au+Au 31.2 GeV (sqrt(s_NN)=7.7 GeV), Trigger ID = 770000 + { + "2020:31.2:21028011,21029036:198,202", // Year, energy, run start end, Vz range + "10,15,21,28,38,49,63,79,98,119,142,169,200,233,271,315", // Multiplicity values for the centrality classes + "160", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "9.63078e-1,6.54124e-02,4.68589e-02,-2.43086e-02,8.15939e-03,0,4.50613e-02,-1.14802e-03", // Trigger efficiency + "0.,0." // Luminosity correction + }, + + // mParameterIndex = 6 + // Run 20 Au+Au 5.75 GeV (sqrt(s_NN)=3.5 GeV), Trigger ID = 720000, second RunID range + { + "2020:5.75:21044023,21045011:198,202", // Year, energy, run start end, Vz range + "6,8,12,16,22,28,37,47,59,73,89,108,128,152,181,217", // Multiplicity values for the centrality classes + "107", // Normalization start (of Glauber to the data) + "0.,0.,0.,0.,0.,0.,0.,0.", // Vz correction parameters (switched to new scheme, parameters defined near the shape corrections) + "1.175,-0.0760,0.0547,-0.0129,-0.0565,0,0.0802,0.00470", // Trigger efficiency + "0.,0." // Luminosity correction + } +}; + + const int CentBin16_vzdep[5][16] = { { 7,10,15,21,29,39,52,66,84,106,131,161,195,236,285,344 }, // -30=30 && mParameterIndex<=35 ) { // Au+Au 27 GeV 2018 - const Double_t min = 4.0; - const Double_t max = 5.0; - - if(ntofmatch<=2) return false; - - a0 = -0.704787625248525; - a1 = 0.99026234637141; - a2 = -0.000680713101607504; - a3 = 2.77035215460421e-06; - a4 = -4.04096185674966e-09; - b0 = 2.52126730672253; - b1 = 0.128066911940844; - b2 = -0.000538959206681944; - b3 = 1.21531743671716e-06; - b4 = -1.01886685404478e-09; - c0 = 4.79427731664144; - c1 = 0.187601372159186; - c2 = -0.000849856673886957; - c3 = 1.9359155975421e-06; - c4 = -1.61214724626684e-09; - - double refmultCenter = a0+a1*(ntofmatch)+a2*pow(ntofmatch,2)+a3*pow(ntofmatch,3)+a4*pow(ntofmatch,4); - double refmultLower = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); - double refmultUpper = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); - - refmultcutmin = refmultCenter - min*refmultLower; - refmultcutmax = refmultCenter + max*refmultUpper; - notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); - } - else if( mParameterIndex>=36 && mParameterIndex<=37 ) { // Isobars 200 GeV 2018 - - // Zr+Zr - if(mParameterIndex==36) { - b0=13.5244327901538; - b1=1.4429201808933; - b2=-0.002873496957537; - b3=7.29172798142226e-06; - b4=-7.45759942317285e-09; - c0=-11.2781454979572; - c1=0.420728494449501; - c2=0.00184005031913895; - c3=-4.61008765754698e-06; - c4=4.28291905929182e-09; + // TODO: + // Reference multiplicity dependent pile up rejection parameter selection + // Be aware that the parameters are hardcoded (should be replaced with the + // arrays stored in Param.h) + + if (mRefX == 1) { // refMult + if( mParameterIndex>=30 && mParameterIndex<=35 ) { // Au+Au 27 GeV 2018 + const Double_t min = 4.0; + const Double_t max = 5.0; + + if(ntofmatch<=2) return false; + + a0 = -0.704787625248525; + a1 = 0.99026234637141; + a2 = -0.000680713101607504; + a3 = 2.77035215460421e-06; + a4 = -4.04096185674966e-09; + b0 = 2.52126730672253; + b1 = 0.128066911940844; + b2 = -0.000538959206681944; + b3 = 1.21531743671716e-06; + b4 = -1.01886685404478e-09; + c0 = 4.79427731664144; + c1 = 0.187601372159186; + c2 = -0.000849856673886957; + c3 = 1.9359155975421e-06; + c4 = -1.61214724626684e-09; + + double refmultCenter = a0+a1*(ntofmatch)+a2*pow(ntofmatch,2)+a3*pow(ntofmatch,3)+a4*pow(ntofmatch,4); + double refmultLower = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + double refmultUpper = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + + refmultcutmin = refmultCenter - min*refmultLower; + refmultcutmax = refmultCenter + max*refmultUpper; + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - // Ru+Ru - else if(mParameterIndex==37) { - b0=13.5426221755897; - b1=1.44261201539344; - b2=-0.00288428931227279; - b3=7.35384541646783e-06; - b4=-7.53407759526067e-09; - c0=-11.2591376113937; - c1=0.419541462167548; - c2=0.00185578651291454; - c3=-4.68933832723005e-06; - c4=4.4151761900593e-09; + else if( mParameterIndex>=36 && mParameterIndex<=37 ) { // Isobars 200 GeV 2018 + + // Zr+Zr + if(mParameterIndex==36) { + b0=13.5244327901538; + b1=1.4429201808933; + b2=-0.002873496957537; + b3=7.29172798142226e-06; + b4=-7.45759942317285e-09; + c0=-11.2781454979572; + c1=0.420728494449501; + c2=0.00184005031913895; + c3=-4.61008765754698e-06; + c4=4.28291905929182e-09; + } + // Ru+Ru + else if(mParameterIndex==37) { + b0=13.5426221755897; + b1=1.44261201539344; + b2=-0.00288428931227279; + b3=7.35384541646783e-06; + b4=-7.53407759526067e-09; + c0=-11.2591376113937; + c1=0.419541462167548; + c2=0.00185578651291454; + c3=-4.68933832723005e-06; + c4=4.4151761900593e-09; + } + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); - refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); - notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); - } - else if ( mParameterIndex==38 ) { // Au+Au 19.6 GeV 2019 - - if ( -145. <= vz && vz < -87. ) { - b0=33.7732676854599; - b1=1.75937881368933; - b2=-0.00285868075552296; - b3=8.50344260510873e-06; - b4=-1.19215380537174e-08; - c0=-22.7060232139884; - c1=0.863809402986806; - c2=-0.000368119767293671; - c3=5.97122714011036e-06; - c4=-1.27438638584224e-08; + else if ( mParameterIndex==38 ) { // Au+Au 19.6 GeV 2019 + + if ( -145. <= vz && vz < -87. ) { + b0=33.7732676854599; + b1=1.75937881368933; + b2=-0.00285868075552296; + b3=8.50344260510873e-06; + b4=-1.19215380537174e-08; + c0=-22.7060232139884; + c1=0.863809402986806; + c2=-0.000368119767293671; + c3=5.97122714011036e-06; + c4=-1.27438638584224e-08; + } + else if ( -87. <= vz && vz < -29. ) { + b0=20.5875336291458; + b1=1.67371122493626; + b2=-0.00307534477962496; + b3=7.93755518827246e-06; + b4=-8.46257293600085e-09; + c0=-15.5923736275086; + c1=0.604206551537668; + c2=0.00131805594121643; + c3=-2.04753779335401e-06; + c4=5.73181898751325e-10; + } + else if ( -29. <= vz && vz < 29. ) { + b0=15.1015102672534; + b1=1.53929151189229; + b2=-0.00269203062814483; + b3=6.488759952638e-06; + b4=-6.06073586314757e-09; + c0=-13.1157864223955; + c1=0.504707692972168; + c2=0.00187997948645203; + c3=-4.7317012773039e-06; + c4=4.8234194091071e-09; + } + else if ( 29. <= vz && vz < 87. ) { + b0=20.7718852504153; + b1=1.67316129891511; + b2=-0.00315093393202473; + b3=8.35823870487966e-06; + b4=-9.14822467807924e-09; + c0=-15.9411138444366; + c1=0.61506063963685; + c2=0.0011824174541949; + c3=-1.48902496972716e-06; + c4=-2.29371463231934e-10; + } + else if ( 87. <= vz && vz <= 145. ) { + b0=33.4926150575549; + b1=1.79372677959986; + b2=-0.00319461487211403; + b3=9.56612691680003e-06; + b4=-1.31049413530369e-08;; + c0=-22.4679773305418; + c1=0.83906220918966; + c2=-0.000106213494253586; + c3=4.93946486222714e-06; + c4=-1.1450298089717e-08; + } + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - else if ( -87. <= vz && vz < -29. ) { - b0=20.5875336291458; - b1=1.67371122493626; - b2=-0.00307534477962496; - b3=7.93755518827246e-06; - b4=-8.46257293600085e-09; - c0=-15.5923736275086; - c1=0.604206551537668; - c2=0.00131805594121643; - c3=-2.04753779335401e-06; - c4=5.73181898751325e-10; + else if ( mParameterIndex==39 ) { // Au+Au 14.6 GeV 2019 + b0 = 36.4811873257854; + b1 = 1.96363692967013; + b2 = -0.00491528146300182; + b3 = 1.45179464078414e-05;; + b4 = -1.82634741809226e-08; + c0 = -16.176117733536;; + c1 = 0.780745107634961; + c2 = -2.03347057620351e-05; + c3 = 3.80646723724747e-06; + c4 = -9.43403282145648e-09; + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - else if ( -29. <= vz && vz < 29. ) { - b0=15.1015102672534; - b1=1.53929151189229; - b2=-0.00269203062814483; - b3=6.488759952638e-06; - b4=-6.06073586314757e-09; - c0=-13.1157864223955; - c1=0.504707692972168; - c2=0.00187997948645203; - c3=-4.7317012773039e-06; - c4=4.8234194091071e-09; + else if ( mParameterIndex==40 ) { // Au+Au 200 GeV 2019 + + b0=18.0459; + b1=1.32913; + b2=-0.000929385; + b3=1.53176e-06; + b4=-9.911e-10; + c0=-18.7481; + c1=0.785467; + c2=2.12757e-05; + c3=3.4805e-07; + c4=-3.80776e-10; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - else if ( 29. <= vz && vz < 87. ) { - b0=20.7718852504153; - b1=1.67316129891511; - b2=-0.00315093393202473; - b3=8.35823870487966e-06; - b4=-9.14822467807924e-09; - c0=-15.9411138444366; - c1=0.61506063963685; - c2=0.0011824174541949; - c3=-1.48902496972716e-06; - c4=-2.29371463231934e-10; + else if ( mParameterIndex==41 ) { // Au+Au 7.7 GeV 2020 + + if ( -145. <= vz && vz < -87. ) { + b0=39.578630496797; + b1=1.46561577132993; + b2=0.006515367058115; + b3=-4.06391982010589e-05; + b4=5.51203917383809e-08; + c0=-14.8817460248614; + c1=0.764539480062978; + c2=0.00368901349656326; + c3=-1.27602217700865e-05; + c4=8.02618485000158e-10; + } + else if ( -87. <= vz && vz < -29. ) { + b0=26.1841414192908; + b1=1.73354655107464; + b2=-0.00280668326418846; + b3=1.22370803379957e-05; + b4=-3.15068617200212e-08; + c0=-13.1831127837376; + c1=0.760227210117286; + c2=0.00195873375843822; + c3=-2.69378951644624e-06; + c4=-1.05344843941749e-08; + } + else if ( -29. <= vz && vz < 29. ) { + b0=23.3635904884101; + b1=1.58179764458174; + b2=-0.00100184372825271; + b3=7.76378744751984e-07; + b4=-6.46469867000365e-09; + c0=-11.4340781454132; + c1=0.72398407747444; + c2=0.00121092416745035; + c3=1.17875404059176e-07; + c4=-9.81658682040738e-09; + } + else if ( 29. <= vz && vz < 87. ) { + b0=29.4343991835005; + b1=1.48353715105631; + b2=0.00106271734149745; + b3=-9.07835076338586e-06; + b4=6.7722581625238e-09; + c0=-9.97159163811459; + c1=0.591000613390771; + c2=0.00449768928484714; + c3=-1.71667412152202e-05; + c4=1.6467383813372e-08; + } + else if ( 87. <= vz && vz <= 145. ) { + b0=37.0772875081557; + b1=1.53484162926915; + b2=0.00471873506675937; + b3=-2.94958548877277e-05; + b4=3.60887574265838e-08; + c0=-13.3927733032856; + c1=0.704319390196747; + c2=0.00485360248820988; + c3=-2.10416804123978e-05; + c4=1.92342533435503e-08; + } + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); } - else if ( 87. <= vz && vz <= 145. ) { - b0=33.4926150575549; - b1=1.79372677959986; - b2=-0.00319461487211403; - b3=9.56612691680003e-06; - b4=-1.31049413530369e-08;; - c0=-22.4679773305418; - c1=0.83906220918966; - c2=-0.000106213494253586; - c3=4.93946486222714e-06; - c4=-1.1450298089717e-08; + else { + notPileUp = kTRUE; } - refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); - refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); - notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); - } - else if ( mParameterIndex==39 ) { // Au+Au 14.6 GeV 2019 - b0 = 36.4811873257854; - b1 = 1.96363692967013; - b2 = -0.00491528146300182; - b3 = 1.45179464078414e-05;; - b4 = -1.82634741809226e-08; - c0 = -16.176117733536;; - c1 = 0.780745107634961; - c2 = -2.03347057620351e-05; - c3 = 3.80646723724747e-06; - c4 = -9.43403282145648e-09; + } // if (mRefX == 1) { // refMult + else if ( mRefX == 5 ) { // fxtMult + if (mParameterIndex == 1) { // Run 19 Au+Au 4.59 GeV (sqrt(s_NN)=3.2 GeV) + b0=19.48; + b1=5.428; + b2=-0.007; + b3=-2.428e-4; + b4=1.197e-7; + c0=-13.59; + c1=1.515; + c2=0.02816; + c3=-1.195e-4; + c4=-9.639e-7; + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else if (mParameterIndex == 2) { // Run 20 Au+Au 5.75 GeV (sqrt(s_NN)=3.5 GeV) + b0=23.28; + b1=5.247; + b2=0.04037; + b3=-1.206e-3; + b4=5.792e-6; + c0=-14.82; + c1=1.583; + c2=0.02684; + c3=4.605e-5; + c4=-2.410e-6; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else if (mParameterIndex == 3) { // Run 19 Au+Au 7.3 GeV (sqrt(s_NN)=3.9 GeV) + b0=31.5858; + b1=4.29274; + b2=0.0485779; + b3=-1.039e-3; + b4=4.408e-6; + c0=-22.7905; + c1=2.6578; + c2=-0.03112; + c3=1.031e-3; + c4=-7.434e-6; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else if (mParameterIndex == 4) { // Run 20 Au+Au 7.3 GeV (sqrt(s_NN)=3.9 GeV) + b0=29.74; + b1=4.421; + b2=0.09139; + b3=-1.977e-3; + b4=9.435e-6; + c0=-20.53; + c1=2.557; + c2=-0.02094; + c3=8.943e-4; + c4=-6.879e-6; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else if (mParameterIndex == 5) { // Run 20 Au+Au 31.2 GeV (sqrt(s_NN)=7.7 GeV) + b0=24.7299053323955; + b1=7.79546460550082; + b2=-0.000336278299464254; + b3=-0.000549204114892259; + b4=1.89274000668251e-06; + c0=-24.3335976220474; + c1=1.93207052914575; + c2=0.0042539477677528; + c3=0.000725893349545147; + c4=-6.29726910263091e-06; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else if (mParameterIndex == 6) { // Run 20 Au+Au 5.75 GeV (sqrt(s_NN)=3.5 GeV) + b0=23.28; + b1=5.247; + b2=0.04037; + b3=-1.206e-3; + b4=5.792e-6; + c0=-14.82; + c1=1.583; + c2=0.02684; + c3=4.605e-5; + c4=-2.410e-6; + + refmultcutmax = calcPileUpRefMult(ntofmatch, b0, b1, b2, b3, b4); + refmultcutmin = calcPileUpRefMult(ntofmatch, c0, c1, c2, c3, c4); + notPileUp = isInPileUpRefMultLimits(refmult, refmultcutmin, refmultcutmax); + } + else { + notPileUp = kTRUE; + } } - else { - notPileUp = kTRUE; + + if (mVerbose) { + std::cout << "\t notPileUp: "; + if (notPileUp) { + std::cout << "TRUE"; + } + else { + std::cout << "FALSE"; + } + std::cout << "\t[DONE]\n"; } return notPileUp; @@ -370,13 +585,12 @@ Bool_t StRefMultCorr::isCentralityOk(const Int_t icent) const { const Bool_t isOK = ( mRefMult_corr > mCentrality_bins[icent][mParameterIndex] && mRefMult_corr <= mCentrality_bins[icent+1][mParameterIndex] ); - // if(isOK) - // { - // std::cout << "StRefMultCorr::isCentralityOk refmultcorr = " << mRefMult_corr - // << " min. bin = " << mCentrality_bins[icent][mParameterIndex] - // << " max. bin = " << mCentrality_bins[icent+1][mParameterIndex] - // << std::endl; - // } + if(mVerbose && isOK) { + std::cout << "StRefMultCorr::isCentralityOk refmultcorr = " << mRefMult_corr + << " min. bin = " << mCentrality_bins[icent][mParameterIndex] + << " max. bin = " << mCentrality_bins[icent+1][mParameterIndex] + << std::endl; + } return isOK ; } @@ -508,6 +722,10 @@ Int_t StRefMultCorr::setParameterIndex(const Int_t RunId) { } //else std::cout << "Parameter set = " << npar_set << std::endl; + if (mVerbose) { + std::cout << "Parameter index set to: " << mParameterIndex << std::endl; + } + return mParameterIndex ; } @@ -522,6 +740,10 @@ Double_t StRefMultCorr::luminosityCorrection(Double_t zdcCoincidenceRate) const Double_t lumiCorr = 1.; + if ( mVerbose ) { + std::cout << "Estimation of luminosity correction factor..." << std::endl; + std::cout << "\t ZDC coincidence rate: " << zdcCoincidenceRate << " BBC coincidence rate: " << 0 << std::endl; + } // 200 GeV only. correction = 1 for all the other energies for BES-I // the above statement may not true for BES-II, since the luminosity is much higher than BES-I, add by Zaochen // better to check the vs ZDCX to see whether they are flat or not, add by Zaochen @@ -557,12 +779,21 @@ Double_t StRefMultCorr::luminosityCorrection(Double_t zdcCoincidenceRate) const lumiCorr = (par0_lum==0.0) ? lumiCorr : lumiCorr*(par0_lum+par1_lum*zdcmean)/par0_lum; } + if (mVerbose) { + std::cout << "\tLuminosity correction factor: " << lumiCorr << std::endl; + std::cout << "\t[DONE]\n"; + } return lumiCorr; } //________________ Double_t StRefMultCorr::vzCorrection(Double_t z) const { + if ( mVerbose ) { + std::cout << "Estimation of acceptance correction factor..." << std::endl; + std::cout << "\t Vertex z position: " << z << " mParameterIndex: " << mParameterIndex << std::endl; + + } Double_t vzCorr = 1.; if ( mParameterIndex < 38 ) { // Old correction based on the 6th-order polynomial fit of the high-end point @@ -596,23 +827,39 @@ Double_t StRefMultCorr::vzCorrection(Double_t z) const { } else if ( mParameterIndex == 40 ) { // Au+Au 200 GeV Run 19 // New Vz correction. All vz bins bins are normalize to that at the center - vzCorr = auau14_run19_vzCorr[ getVzWindowForVzDepCentDef() ]; + vzCorr = auau200_run19_vzCorr[ getVzWindowForVzDepCentDef() ]; + } + else if ( mParameterIndex == 41 ) { // Au+Au 7.7 GeV Run 21 + // New Vz correction. All vz bins bins are normalize to that at the center + vzCorr = auau7_run21_vzCorr[ getVzWindowForVzDepCentDef() ]; } + if (mVerbose) { + std::cout << "\t Acceptance correction factor: " << vzCorr << std::endl; + std::cout << "\t[DONE]\n"; + } return vzCorr; } //________________ Double_t StRefMultCorr::sampleRefMult(Int_t refMult) const { + if (mVerbose) { + std::cout << "Sampling refMult value: " << refMult << std::endl; + } + Double_t refMult_d = -9999.; - if( mParameterIndex>=30 && mParameterIndex<=40 ) { + if( mParameterIndex>=30 && mParameterIndex<=41 ) { refMult_d = (Double_t)refMult - 0.5 + gRandom->Rndm(); } else { refMult_d = (Double_t)refMult + gRandom->Rndm(); } + if (mVerbose) { + std::cout << "\tSampled refMult value: " << refMult_d << std::endl; + std::cout << "\t[DONE]\n"; + } return refMult_d; } @@ -622,6 +869,12 @@ Double_t StRefMultCorr::getRefMultCorr(const UShort_t refMult, const Double_t zdcCoincidenceRate, const UInt_t flag) const { + if (mVerbose) { + std::cout << "Start refMultCorr calculations" << std::endl + << "Initial values refMult / vz / zdcX / flag: " + << refMult << " / " << z << " / " << zdcCoincidenceRate << " / " + << flag << std::endl; + } // Apply correction if parameter index & z-vertex are ok if (!isIndexOk() || !isZvertexOk()) return refMult ; @@ -641,6 +894,10 @@ Double_t StRefMultCorr::getRefMultCorr(const UShort_t refMult, } } // switch ( flag ) + if (mVerbose) { + std::cout << "Final refMultCorr value: " << refMultCorr << std::endl; + } + return refMultCorr; } @@ -704,12 +961,10 @@ void StRefMultCorr::readScaleForWeight(const Int_t nRefmultbin, const Double_t * std::cout << "StRefMultCorr::readScaleForWeight Read scale factor ..." << std::flush; - for(Int_t i=0; i auau200_run19_nVzBins) return 1.0; + + weight = auau7_run21_shapeWeightArray[iVzBinIndex][TMath::Nint(mRefMult_corr)]; + // Handle bad weight + if (weight == 0 || TMath::IsNaN(weight)) { + weight = 1.; + } + } else { weight = 1.0; } + + if (mVerbose) { + std::cout << "\tShape weight: " << weight << std::endl; + std::cout << "\t[DONE]\n"; + } + return weight; } //________________ Double_t StRefMultCorr::triggerWeight() const { + + if (mVerbose) { + std::cout << "Estimating the trigger weight" << std::endl; + } Double_t weight = 1.; @@ -899,6 +1178,18 @@ Double_t StRefMultCorr::triggerWeight() const { const Double_t par6 = mPar_weight[6][mParameterIndex]; const Double_t par7 = mPar_weight[7][mParameterIndex]; + if (mVerbose) { + std::cout << "Trigger efficiency parameters: " + << " [0]: " << par0 + << " [1]: " << par1 + << " [2]: " << par2 + << " [3]: " << par3 + << " [4]: " << par4 + << " A: " << A + << " [6]: " << par6 + << " [7]: " << par7 << std::endl; + } + // Additional z-vetex dependent correction //const Double_t A = ((1.27/1.21))/(30.0*30.0); // Don't ask... //const Double_t A = (0.05/0.21)/(30.0*30.0); // Don't ask... @@ -909,11 +1200,11 @@ Double_t StRefMultCorr::triggerWeight() const { && mRefMult_corr != -(par3/par2) ) { // avoid denominator = 0 // Parametrization of MC/data RefMult ratio - weight = (par0 + - par1 / (par2 * mRefMult_corr + par3) + - par4 * (par2 * mRefMult_corr + par3) + - par6 / TMath::Power(par2 * mRefMult_corr + par3, 2) + - par7 * TMath::Power(par2 * mRefMult_corr + par3, 2)); + weight = ( par0 + + par1 / (par2 * mRefMult_corr + par3) + + par4 * (par2 * mRefMult_corr + par3) + + par6 / ( (par2 * mRefMult_corr + par3) * (par2 * mRefMult_corr + par3) ) + + par7 * ( (par2 * mRefMult_corr + par3) * (par2 * mRefMult_corr + par3) ) ); /* std::cout << "par0: " << par0 << " par1: " << par1 << " par2: " << par2 << " par3: " << par3 << " par4: " << par4 << " A: " << A @@ -921,9 +1212,12 @@ Double_t StRefMultCorr::triggerWeight() const { << "refMultCorr: " << mRefMult_corr << " weight: " << weight << std::endl; */ - weight = weight + (weight-1.0)*(A*mVz*mVz); // z-dependent weight correction + weight = weight + (weight - 1.0) * (A * mVz * mVz); // z-dependent weight correction + } + if (mVerbose) { + std::cout << "\tTrigger weight: " << weight << std::endl; + std::cout << "\t[DONE]\n"; } - return weight; } @@ -953,6 +1247,10 @@ Double_t StRefMultCorr::getWeight() const { //_________________ Int_t StRefMultCorr::getCentralityBin16() const { + + if (mVerbose) { + std::cout << "Finding centrality bin (out of 16)\n"; + } Int_t CentBin16 = -1; // Invalid index @@ -971,12 +1269,21 @@ Int_t StRefMultCorr::getCentralityBin16() const { // std::cout <<"Vz dependent centrality definition for Vz<-27 and Vz>25 ... Vz="<< mVz <<" RefMult="<< mRefMult <<" RefMultCorr="<< mRefMult_corr <<" iCent="<< CentBin16 << std::endl; } + if (mVerbose) { + std::cout << "\tCentrality bin (out of 16): " << CentBin16 << "\t[DONE]" << std::endl; + } + // return -1 if CentBin16 = 16 (very large refmult, refmult>5000) return ( CentBin16==16 ) ? -1 : CentBin16; } //_________________ Int_t StRefMultCorr::getCentralityBin9() const { + + if (mVerbose) { + std::cout << "Finding centrality bin (out of 9)\n"; + } + Int_t CentBin9 = -1; // Invalid index @@ -1008,6 +1315,10 @@ Int_t StRefMultCorr::getCentralityBin9() const { CentBin9 = getCentralityBin9VzDep(); } + if (mVerbose) { + std::cout << "\tCentrality bin (out of 9): " << CentBin9 << "\t[DONE]" << std::endl; + } + return CentBin9; } @@ -1070,6 +1381,14 @@ Int_t StRefMultCorr::getVzWindowForVzDepCentDef() const { } } // for ( Int_t iVz=0; iVz sParam_ShapeWeight = StringSplit(getParamX_ShapeWeight(1,1),','); //for(int ib=0;ib10 + /// "fxtmult" - number of primary tracks for the fixed-target mode of the experiment /// Specify the type of data sets (in case there are multiple prameters/definitions in the same runs) /// "Def" /// "VpdMB5" @@ -114,8 +116,11 @@ class StRefMultCorr { /// Print all parameters void print(const Option_t* option="") const ; + /// Print debug information + void setVerbose(const Bool_t& verbose) { mVerbose = verbose; } + private: - /// refmult, refmult2, refmult3 or toftray (case insensitive) + /// grefmult, refmult, refmult2, refmult3 or toftray (case insensitive), fxtmult const TString mName; /// Specify triggers, in case there are multiple parameters/definitions in the same runs const TString mSubName; @@ -186,8 +191,21 @@ class StRefMultCorr { std::vector mVzEdgeForWeight ; /// vz edge value std::vector mgRefMultTriggerCorrDiffVzScaleRatio ; /// Scale factor for global refmult - /////// Added from official package in StRoot/StRefMultCorr - const Int_t getRefX() const; /// X= 1 (normal RefMult), 2, 3, 4 + /// @brief The choise of reference muliplicity to be used: + /// 0 gRefMult + /// 1 RefMult + /// 2 RefMult2 + /// 3 RefMult3 + /// 4 RefMult4 + /// 5 FxtMult + Short_t mRefX; + /// @brief Print debug information (default: kFALSE) + Bool_t mVerbose; + + /// @brief Return reference multiplicity specified by the constructer + /// @return 0 - gRefMult, 1 - refMult, 2 - refMult2, 3 - refMult3, 4 - refMult4, 5 - fxtMult + const Int_t getRefX() const; + const Int_t getNumberOfDatasets() const; /// Number of definitions for each X void readHeaderFile(); //// alternative of read() in rev<=1.9 void readBadRunsFromHeaderFile(); /// alternative of readBadRuns() in rev<=1.9 @@ -208,8 +226,6 @@ class StRefMultCorr { Bool_t isInPileUpRefMultLimits(Double_t refMult, Double_t low, Double_t hi) const { return ( low < refMult && refMult < hi); } - - ClassDef(StRefMultCorr, 0) }; #endif diff --git a/StRoot/StRefMultCorr/checkStRefMultCorr.C b/StRoot/StRefMultCorr/checkStRefMultCorr.C new file mode 100755 index 00000000000..cfdaec2b86f --- /dev/null +++ b/StRoot/StRefMultCorr/checkStRefMultCorr.C @@ -0,0 +1,186 @@ +// ROOT headers +#include "TH1.h" +#include "TChain.h" +#include "TSystem.h" +#include "TFile.h" + +// C++ headers +#include + +// Macro name +void checkStRefMultCorr(const char *inFileName = "/star/u/gnigmat/soft/u/prithwish/data/st_physics_adc_16064082_raw_5000007.MuDst.root", + const char *oFileName = "oFileForPrithwish.root") { + + gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C"); + loadSharedLibraries(); + gSystem->Load("StPicoEvent"); + gSystem->Load("StRefMultCorr"); + + std::cout << "Hi! Lets do some physics, Master!" << std::endl; + + StPicoDstReader* picoReader = new StPicoDstReader(inFileName); + picoReader->Init(); + + //Long64_t events2read = picoReader->chain()->GetEntries(); + + // This is a way if you want to spead up IO + std::cout << "Explicit read status for some branches" << std::endl; + picoReader->SetStatus("*",0); + picoReader->SetStatus("Event",1); + picoReader->SetStatus("BTofPidTraits",1); + std::cout << "Status has been set" << std::endl; + + std::cout << "Now I know what to read, Master!" << std::endl; + + if( !picoReader->chain() ) { + std::cout << "No chain has been found." << std::endl; + std::cout << "Terminating..." << std::endl; + exit(0); + } + Long64_t eventsInTree = picoReader->tree()->GetEntries(); + std::cout << "eventsInTree: " << eventsInTree << std::endl; + Long64_t events2read = picoReader->chain()->GetEntries(); + + std::cout << "Number of events to read: " << events2read << std::endl; + + // Histogramming + // Event + TH1F *hRefMult = new TH1F("hRefMult", "Reference multiplicity;refMult", 500, -0.5, 499.5); + TH2F *hTofMatchVsRefMultBeforeCut = new TH2F("hTofMatchVsRefMultBeforeCut", ";bTofMatched;refMult", + 500, -0.5, 499.5, 500, -0.5, 499.5); + TH2F *hTofMatchVsRefMultAfterCut = new TH2F("hTofMatchVsRefMultAfterCut", ";bTofMatched;refMult", + 500, -0.5, 499.5, 500, -0.5, 499.5); + TH2F *hWeightVsRefMultCorr = new TH2F("hWeightVsRefMultCorr",";refMult;weight", + 500, -0.5, 499.5, 125, 0.5, 3.); + TH1F *hRefMultCorr = new TH1F("hRefMultCorr", "Corrected reference multiplicity;refMult", 500, -0.5, 499.5); + TH1F *hCent16 = new TH1F("hCent16","Centrality bins;Centrality bin", 16, -0.5, 15.5); + TH2F *hVtxXvsY = new TH2F("hVtxXvsY", "hVtxXvsY", 200,-10.,10.,200,-10.,10.); + TH1F *hVtxZ = new TH1F("hVtxZ","hVtxZ", 210, -210., 210.); + + + // Initialize StRefMultCorr + StRefMultCorr *mRefMultCorrUtilFxt = new StRefMultCorr("fxtmult"); + mRefMultCorrUtilFxt->setVerbose(kFALSE); + + Int_t counter = 0; + Int_t loopSize = 1000; + Bool_t verbose = kTRUE; + + // Loop over events + for(Long64_t iEvent=0; iEvent= loopSize ) { + std::cout << "Working on event #[" << (iEvent+1) << "/" << events2read << "]" << std::endl; + counter = 0; + } + + + Bool_t readEvent = picoReader->readPicoEvent(iEvent); + if (!readEvent) { + std::cout << "No input was provided" << std::endl; + break; + } + + // Retrieve picoDst + StPicoDst *dst = picoReader->picoDst(); + + // Retrieve event information + StPicoEvent *event = dst->event(); + if( !event ) { + std::cout << "No event was found" << std::endl; + break; + } + + Int_t runId = event->runId(); + mRefMultCorrUtilFxt->init(runId); + + if (verbose) { + std::cout << "Checking bad run"; + } + + if ( mRefMultCorrUtilFxt->isBadRun( runId ) ) { + if (verbose) { + std::cout << "\t[failed]" << std::endl; + } + continue; + } + if (verbose) { + std::cout << "\t[passed]" << std::endl; + } + + if (verbose) { + std::cout << "Checking MB triggers"; + } + + // Check trigger (3.2 GeV) + if ( !event->isTrigger(680001) ) { + if (verbose) { + std::cout << "\t[failed]" << std::endl; + } + continue; + } + if (verbose) { + std::cout << "\t[passed]" << std::endl; + } + + // NOTE: Lets utilize refMult variable instead of fxtMult but will call the proper one from picoEvent + Int_t refMult = event->fxtMult(); + TVector3 pVtx = event->primaryVertex(); + Int_t nBTofMatched = event->nBTOFMatch(); + hTofMatchVsRefMultBeforeCut->Fill( nBTofMatched, refMult ); + + // IMPORTANT: vertex position is needed for Au+Au 19.6 GeV 2019 + if (mRefMultCorrUtilFxt->isPileUpEvent( refMult, nBTofMatched, pVtx.Z() ) ) continue; + + mRefMultCorrUtilFxt->initEvent(refMult, pVtx.Z(), event->ZDCx()); + + // In case centrality calculation is failed for the given event it will + if (mRefMultCorrUtilFxt->getCentralityBin16() < 0 || + mRefMultCorrUtilFxt->getCentralityBin9() < 0) { + if (verbose) { + std::cout << "\tBad centrality < 0" << std::endl; + } + continue; + } + + Int_t cent9 = mRefMultCorrUtilFxt->getCentralityBin9(); // 0: 70-80%, 1: 60-70%, ..., 6: 10-20%, 7: 5-10%, 8: 0-5% + Int_t cent16 = mRefMultCorrUtilFxt->getCentralityBin16(); // 0: 75-80%, 1: 70-75%, ..., 8: 0-5% + Double_t refMultCorr = mRefMultCorrUtilFxt->getRefMultCorr(); // Retrieve corrected refMult value + Double_t weight = mRefMultCorrUtilFxt->getWeight(); // Retrieve weight + + if (verbose) { + std::cout << "refMult: " << refMult << " refMultCorr: " << refMultCorr + << " cent16: " << cent16 << " cent9: " << cent9 + << " Total weight: " << weight << " trigger efficiency: " + << mRefMultCorrUtilFxt->triggerWeight() + << " z: " << pVtx.Z() + << " shape weight: " << mRefMultCorrUtilFxt->getShapeWeight_SubVz2Center() + << std::endl; + } + + hRefMult->Fill( refMult ); + hRefMultCorr->Fill( refMultCorr ); + hCent16->Fill( cent16 ); + hVtxXvsY->Fill( pVtx.X(), pVtx.Y() ); + hVtxZ->Fill( pVtx.Z() ); + hTofMatchVsRefMultAfterCut->Fill( nBTofMatched, refMult ); + hWeightVsRefMultCorr->Fill(refMultCorr, weight); + + } //for(Long64_t iEvent=0; iEventFinish(); + + TFile *oFile = new TFile(oFileName, "recreate"); + hRefMult->Write(); + hRefMultCorr->Write(); + hCent16->Write(); + hVtxXvsY->Write(); + hVtxZ->Write(); + hTofMatchVsRefMultBeforeCut->Write(); + hTofMatchVsRefMultAfterCut->Write(); + hWeightVsRefMultCorr->Write(); + oFile->Write(); + oFile->Close(); + + std::cout << "Analysis was finished" << std::endl; +} diff --git a/StRoot/StSpinPool/StFcsRawDaqReader/StFcsRawDaqReader.cxx b/StRoot/StSpinPool/StFcsRawDaqReader/StFcsRawDaqReader.cxx index a5acdd6f601..78ee20a42ad 100644 --- a/StRoot/StSpinPool/StFcsRawDaqReader/StFcsRawDaqReader.cxx +++ b/StRoot/StSpinPool/StFcsRawDaqReader/StFcsRawDaqReader.cxx @@ -33,7 +33,7 @@ #include "RTS/src/DAQ_STGC/daq_stgc.h" #include "RTS/src/DAQ_READER/daq_dta.h" #include "StRoot/StEvent/StTriggerData.h" -#include "StRoot/StEvent/StTriggerData2019.h" +#include "StRoot/StEvent/StTriggerData2022.h" #include "StRoot/StEvent/StFcsCollection.h" #include "StRoot/StEvent/StFcsHit.h" #include "StRoot/StFcsDbMaker/StFcsDbMaker.h" @@ -87,7 +87,7 @@ Int_t StFcsRawDaqReader::Init(){ struct tm* local = localtime((const time_t*)&unixtime); int date=(local->tm_year+1900)*10000 + (local->tm_mon+1)*100 + local->tm_mday; int time=local->tm_hour*10000 + local->tm_min*100 + local->tm_sec; - printf("Event Unix Time = %d %0d %06d\n",mRdr->evt_time,date,time); + LOG_INFO << Form("Event Unix Time = %d %0d %06d",mRdr->evt_time,date,time) << endm; StFcsDbMaker* mFcsDbMkr = static_cast(GetMaker("fcsDbMkr")); if(!mFcsDbMkr){ @@ -154,7 +154,7 @@ Int_t StFcsRawDaqReader::Make() { if(trgcmd != 4 && trgcmd !=10){ // 4=phys/ped 10=LED nskip++; nskiptot++; - if(mDebug) printf("trgcmd=%d skipping nskip=%d nskiptot=%d\n",trgcmd,nskip,nskiptot); + if(mDebug) LOG_INFO << Form("trgcmd=%d skipping nskip=%d nskiptot=%d",trgcmd,nskip,nskiptot)<trgcmd; if(trgcmd != 4 && trgcmd !=10){ // 4=phys/ped 10=LED - printf("This should not happen!!! trgcmd=%d skipping nskip=%d nskiptot=%d\n",trgcmd,nskip,nskiptot); + LOG_INFO << Form("This should not happen!!! trgcmd=%d skipping nskip=%d nskiptot=%d",trgcmd,nskip,nskiptot)<0){ @@ -209,10 +209,10 @@ Int_t StFcsRawDaqReader::Make() { dd = mRdr->det("trg")->get("raw"); int startrg=0,fcstrg=0; if(!dd){ - //printf("trg/raw not found\n"); + LOG_WARN << "trg/raw not found" << endm; }else{ while(dd->iterate()) { - uint8_t *trg_raw = dd->Byte; + u_char *trg_raw = dd->Byte; struct simple_desc { short len ; char evt_desc ; @@ -220,16 +220,16 @@ Int_t StFcsRawDaqReader::Make() { } *desc ; desc = (simple_desc *) trg_raw ; //printf("Trigger: raw bank has %d bytes: ver 0x%02X, desc %d, len %d\n",dd->ncontent,desc->ver,desc->evt_desc,desc->len); - if(desc->ver==0x46){ - TriggerDataBlk2019* trgdata2019 = (TriggerDataBlk2019*)dd->Byte; - LOG_DEBUG << "Creating StTriggerData for ver=0x46 (2019) with run="<setTriggerData((StTriggerData*)new StTriggerData2019(trgdata2019,mRun,1,mDebug)); + if(desc->ver==0x47){ + TriggerDataBlk2022* trgdata2022 = (TriggerDataBlk2022*)dd->Byte; + LOG_INFO << "Creating StTriggerData for ver=0x47 (2022) with run="<setTriggerData((StTriggerData*)new StTriggerData2022(trgdata2022,mRun,1,mDebug)); LOG_DEBUG << "Added StTriggerData to StEvent"<GetObject()); - //mTrg = mEvent->triggerData(); - //LOG_DEBUG << "Got back Dataset StTriggerData addr="<GetObject()); + mTrg = mEvent->triggerData(); + LOG_DEBUG << "Got back Dataset StTriggerData addr="<lastDSM(5); //unsigned short lastdsm4 = mTrg->lastDSM(4); @@ -247,9 +247,9 @@ Int_t StFcsRawDaqReader::Make() { LOG_DEBUG << Form("FCS TCU Bits = 0x%04x",mFcsTcuBit)<l2sum(); - startrg = (l2sum & 0xFF8000FFFFFFFFFF)?1:0; - fcstrg = (l2sum & 0x007FFF0000000000)?1:0; - LOG_DEBUG << Form("L2SUM = 0x%016llx STAR=%1d FCS=%1d",l2sum,startrg,fcstrg) << endm; + //startrg = (l2sum & 0xFF8000FFFFFFFFFF)?1:0; + //fcstrg = (l2sum & 0x007FFF0000000000)?1:0; + //LOG_DEBUG << Form("L2SUM = 0x%016llx STAR=%1d FCS=%1d",l2sum,startrg,fcstrg) << endm; }else{ printf("Unknown StTriggerData version = %x\n",desc->ver); @@ -272,8 +272,8 @@ Int_t StFcsRawDaqReader::Make() { //printf("DEPIO EHP=%1d NS=%1d DEP=%02d CH=%02d N=%d\n", // ehp,ns,dep,ch,dd->ncontent); if(ehp==3 && ns==0 && dep==0 && (ch==4 || ch==5)){ - uint32_t n=dd->ncontent; - uint16_t *d16 = (uint16_t *)dd->Void; + u_int n=dd->ncontent; + u_short *d16 = (u_short *)dd->Void; if(ch==4) mFcsDepOut += (d16[96] & 0xFF); if(ch==5) mFcsDepOut += (d16[96] & 0xFF) << 8; //for(int i=0; idet("fcs")->get(mode[mReadMode].c_str()); - if(dd){ + if(!dd){ + mFcsCollectionPtr->setDataExist(0); + }else{ + mFcsCollectionPtr->setDataExist(1); while(dd->iterate()) { int sec = ((dd->sec >> 11) & 0x1F) + 1; int rdo = ((dd->sec >> 8) & 0x7) + 1; @@ -299,12 +302,12 @@ Int_t StFcsRawDaqReader::Make() { int ns = (dd->sec >> 5) & 1; int dep = dd->row ; int ch = dd->pad ; - uint32_t n=dd->ncontent; + u_int n=dd->ncontent; int detid,id,crt,sub; mFcsDb->getIdfromDep(ehp,ns,dep,ch,detid,id,crt,sub); //printf("EHP=%1d NS=%1d DEP=%02d CH=%02d DET=%1d id=%4d\n",ehp,ns,dep,ch,detid,id); //if(ch>=32) continue; - uint16_t *d16 = (uint16_t *)dd->Void; + u_short *d16 = (u_short *)dd->Void; StFcsHit* hit=0; unsigned short tmp[1024]; if(mReadMode==0){ @@ -312,9 +315,9 @@ Int_t StFcsRawDaqReader::Make() { }else{ /* if(startrg==0 && fcstrg==1){ - for(uint32_t i=0; iadc[i].tb; - uint32_t data = dd->adc[i].adc; + for(u_int i=0; iadc[i].tb; + u_int data = dd->adc[i].adc; tmp[i*2 ]=data; tmp[i*2+1]=tb + 8; //printf("AAA %4d : %4d %4d : %4d %4d\n",i,data&0xfff,d16[i*2]&0xfff,tb,d16[i*2+1]); @@ -330,7 +333,7 @@ Int_t StFcsRawDaqReader::Make() { if(detid<6) nvaliddata++; if(mDebug){ - printf("FCS %3s : S%d:%d [det %d, ns %d, dep %d ch %d] det=%d id=%3d : size=%d : adc=", + printf("FCS %3s : S%2d:%2d [det%1d ns%1d dep%2d ch%2d] det=%d id=%3d size=%3d adc=", mode[mReadMode].c_str(),sec,rdo,ehp,ns,dep,ch,detid,id,n) ; for(unsigned int tb=0; tbnTimeBin(); tb++) printf("%4d ", hit->adc(tb)); //for(int tb=0; tb<3; tb++) printf("%4d ", hit->adc(tb)); @@ -353,7 +356,7 @@ Int_t StFcsRawDaqReader::Make() { dd = mRdr->det("stgc")->get("altro",r) ; while(dd && dd->iterate()) { //per xing and per RDO if(mDebug) printf("STGC ALTRO: stgc%02d(sec) RDO=%1d ALTRO=%03d(row) Ch=%02d(pad)\n",dd->sec,r,dd->row,dd->pad); - for(uint32_t i=0; incontent; i++) { + for(u_int i=0; incontent; i++) { if(mDebug) printf(" TB=%3d ADC=%4d",dd->adc[i].tb,dd->adc[i].adc) ; ndata++; } diff --git a/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.cxx b/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.cxx index 7b8780d635a..b84b2f6a04e 100644 --- a/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.cxx +++ b/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.cxx @@ -1,3 +1,4 @@ + /* * * \class StFcsTrgQaMaker @@ -40,72 +41,87 @@ Int_t StFcsTrgQaMaker::Init(){ LOG_FATAL << "Error finding StFcsTrgSimMaker"<< endm; return kStFatal; } + fcs_trg_base* trg=mFcsTrgSimMkr->getTriggerEmu(); + if(!trg){ + LOG_FATAL << "Error finding fcs_trg_base from StFcsTrgSimMaker"<< endm; + return kStFatal; + } if(mRun>0){ int yday=mRun/1000; sprintf(mFilename,"%d/%d.trgQa.root",yday,mRun); }else if(mFilename==0){ - static char* fname = const_cast("fcs.trgqa.root"); + char* fname = "fcs.trgqa.root"; mFilename=fname; } printf("StFcsTrgQaMaker::Init - Opening %s\n",mFilename); mFile=new TFile(mFilename,"RECREATE"); - const char* cname[4]={"All","SIM","DEP","TCU"}; - for(int i=0; i<4; i++){ - mETot[i] = new TH1F(Form("ETot%s", cname[i]), Form("ETot%s", cname[i]),256,0,1024); - mHTot[i] = new TH1F(Form("HTot%s", cname[i]), Form("HTot%s", cname[i]),256,0,512); - mEHT [i] = new TH1F(Form("EHT%s", cname[i]), Form("EHT%s", cname[i]),256,0,256); - mHHT [i] = new TH1F(Form("HHT%s", cname[i]), Form("HHT%s", cname[i]),256,0,256); - mJP[0][i] = new TH1F(Form("JP2%s", cname[i]), Form("JP2%s", cname[i]),256,0,1024); - mJP[1][i] = new TH1F(Form("JP1%s", cname[i]), Form("DiJP1%s", cname[i]),256,0,1024); - - mPOR [i] = new TH1F(Form("POR%s", cname[i]), Form("POR%s", cname[i]),256,0,512); - mE4b4[i] = new TH1F(Form("E4b4%s",cname[i]), Form("E4b4%s", cname[i]),256,0,256); - mH4b4[i] = new TH1F(Form("H4b4%s",cname[i]), Form("H4b4%s", cname[i]),256,0,256); - - mSum[0][i] = new TH1F(Form("Sum%s", cname[i]), Form("E+H%s", cname[i]),256,0,256); - mEHR[0][i] = new TH1F(Form("EHR%s", cname[i]), Form("EHRatio%s", cname[i]), 64,0,1.05); - mSum[1][i] = new TH1F(Form("Had%s", cname[i]), Form("E+H%s", cname[i]),256,0,256); - mEHR[1][i] = new TH1F(Form("RHad%s",cname[i]), Form("EHRatio%s", cname[i]), 64,0,1.05); - mSum[2][i] = new TH1F(Form("EM%s", cname[i]), Form("E+H%s", cname[i]),256,0,256); - mEHR[2][i] = new TH1F(Form("REM%s", cname[i]), Form("EHRatio%s", cname[i]), 64,0,1.05); - mSum[3][i] = new TH1F(Form("Gam%s", cname[i]), Form("E+H%s", cname[i]),256,0,256); - mEHR[3][i] = new TH1F(Form("RGam%s",cname[i]), Form("EHRatio%s", cname[i]), 64,0,1.05); - mSum[4][i] = new TH1F(Form("Ele%s", cname[i]), Form("E+H%s", cname[i]),256,0,256); - mEHR[4][i] = new TH1F(Form("REle%s",cname[i]), Form("EHRatio%s", cname[i]), 64,0,1.05); - - mDEm [i] = new TH2F(Form("DEm%s", cname[i]),Form("DiEM%s", cname[i]),256,0,256,256,0,256); - mDHad[i] = new TH2F(Form("DHad%s",cname[i]),Form("DiHadron%s", cname[i]),256,0,256,256,0,256); - mDGam[i] = new TH2F(Form("DGam%s",cname[i]),Form("DiGamma%s", cname[i]),256,0,256,256,0,256); - mDEle[i] = new TH2F(Form("DEle%s",cname[i]),Form("DiElectron%s",cname[i]),256,0,256,256,0,256); - mDJP [i] = new TH2F(Form("DJP%s", cname[i]),Form("DiJP%s", cname[i]),256,0,256,256,0,256); - } - mSumTot[0] = new TH2F("SumEtot","SumEtot;E4x4+H4x4;Etot",256,0,256,256,0,1024); - mSumTot[1] = new TH2F("SumHtot","SumHtot;E4x4+H4x4;Htot",256,0,256,256,0,512); - const char* NS[2]={"N","S"}; - for(int ns=0; nsJPATHR2,trg->JPBCTHR2,trg->JPDETHR2),11,-5.5,5.5); + mJPMap[1] = new TH1F("JP1",Form("JP1 THR A=%d,BC=%d,DE=%d",trg->JPATHR1,trg->JPBCTHR1,trg->JPDETHR1),11,-5.5,5.5); + mJPMap[2] = new TH1F("JP0",Form("JP0 THR A=%d,BC=%d,DE=%d",trg->JPATHR0,trg->JPBCTHR0,trg->JPDETHR0),11,-5.5,5.5); + + mE4x4 = new TH1F("E4x4", "MAX E4x4", 256,0,256); + mEM4x4 = new TH1F("EM4x4", "MAX EM4x4", 256,0,256); + mELE4x4 = new TH1F("ELE4x4", "MAX ELE4x4", 256,0,256); + mERatio = new TH1F("EMRatio", "MAX EM Ratio=E/(E+Hmax)", 64,0,1.05); + mELERatio = new TH1F("ELERatio","MAX ELE Ratio=E/(E+Hmax)", 64,0,1.05); + + mH4x4 = new TH1F("H4x4", "MAX H4x4", 256,0,256); + mEH4x4 = new TH1F("EH4x4", "MAX E+H4x4", 256,0,256); + mHAD4x4 = new TH1F("HAD4x4", "MAX Had4x4", 256,0,256); + mHRatio = new TH1F("HRatio", "MAX E+H Ratio=E/(E+H)", 64,0,1.05); + mHADRatio = new TH1F("HADRatio","MAX Had Ratio=E/(E+H)", 64,0,1.05); + + mE4x4Map[0] = new TH2F("EM4x4MapEM2", Form("EM EM2=%d",trg->EMTHR2), 19,-9.5,9.5,15,-15.5,-0.5); + mE4x4Map[1] = new TH2F("EM4x4MapEM1", Form("EM EM1=%d",trg->EMTHR1), 19,-9.5,9.5,15,-15.5,-0.5); + mE4x4Map[2] = new TH2F("EM4x4MapEM0", Form("EM EM0=%d",trg->EMTHR0), 19,-9.5,9.5,15,-15.5,-0.5); + mE4x4Map[3] = new TH2F("EM4x4MapELE2", Form("EM ELE2=%d",trg->ELETHR2),19,-9.5,9.5,15,-15.5,-0.5); + + mELE4x4Map[0] = new TH2F("ELE4x4MapELE2",Form("ELE ELE2=%d",trg->ELETHR2), 19,-9.5,9.5,15,-15.5,-0.5); + mELE4x4Map[1] = new TH2F("ELE4x4MapELE1",Form("ELE ELE1=%d",trg->ELETHR1), 19,-9.5,9.5,15,-15.5,-0.5); + + mEH4x4Map[0] = new TH2F("EHMapHAD2", Form("E+H HAD2=%d",trg->HADTHR2), 19,-9.5,9.5,15,-15.5,-0.5); + mEH4x4Map[1] = new TH2F("EHMapHAD1", Form("E+H HAD1=%d",trg->HADTHR1), 19,-9.5,9.5,15,-15.5,-0.5); + mEH4x4Map[2] = new TH2F("EHMapHAD0", Form("E+H HAD0=%d",trg->HADTHR0), 19,-9.5,9.5,15,-15.5,-0.5); + + mDsmOut = new TH1F("DsmOut","DsmOut",33,0,33); + mDepOut = new TH1F("DepOut","DepOut",33,0,33); + mTcuBit = new TH1F("TcuBit","TcuBit",33,0,33); + mTcuDep = new TH1F("TcuDep","TcuDepMismatch",33,0,33); + mSimDep = new TH1F("SimDep","SimDepMismatch",33,0,33); + + const float maxadc=500; + mAdc[0]=new TH2F("EN_Id_Adc","EcalNorth; Id; ADC",mFcsDb->maxId(0),0.0,mFcsDb->maxId(0),500,0.0,maxadc); + mAdc[1]=new TH2F("ES_Id_Adc","EcalSouth; Id; ADC",mFcsDb->maxId(1),0.0,mFcsDb->maxId(1),500,0.0,maxadc); + mAdc[2]=new TH2F("HN_Id_Adc","HcalNorth; Id; ADC",mFcsDb->maxId(2),0.0,mFcsDb->maxId(2),500,0.0,maxadc); + mAdc[3]=new TH2F("HS_Id_Adc","HcalSouth; Id; ADC",mFcsDb->maxId(3),0.0,mFcsDb->maxId(3),500,0.0,maxadc); + mAdc[4]=new TH2F("PN_Id_Adc","PresNorth; Id; ADC",mFcsDb->maxId(4),0.0,mFcsDb->maxId(4),500,0.0,maxadc); + mAdc[5]=new TH2F("PS_Id_Adc","PresSouth; Id; ADC",mFcsDb->maxId(5),0.0,mFcsDb->maxId(5),500,0.0,maxadc); return kStOK; }; @@ -116,30 +132,6 @@ Int_t StFcsTrgQaMaker::Make() { return kStFatal; } - //Getting Trigger Data - TObjectSet *os = (TObjectSet*)GetDataSet("StTriggerData"); - StTriggerData* trgd=0; - if(os){ - trgd = (StTriggerData*)os->GetObject(); - if(trgd){ - //LOG_INFO << "got StTriggerData addr="<lastDSM(5); - - //TCU bits - for(int i=0; i<16; i++) if((tcubit >> i) & 0x1) mTcuBit->Fill(i); - - //DSM out - int dsmout=trg->dsmout; - for(int i=0; i<16; i++) if((dsmout >> i) & 0x1) mDsmOut->Fill(i); - //Getting StEvent and FcsCollection StEvent* event= (StEvent*)GetInputDS("StEvent"); StFcsCollection *fcs = 0; @@ -152,6 +144,36 @@ Int_t StFcsTrgQaMaker::Make() { LOG_INFO << "No StFcsCollection found" << endm; return kStErr; } + if(fcs->isDataExist()==0) { + LOG_INFO << "No FCS data in this event" << endm; + return kStOk; + } + //Getting Trigger Data + StTriggerData* trgd = event->triggerData(); + if(!trgd){ + TObjectSet *os = (TObjectSet*)GetDataSet("StTriggerData"); + if(os){ + trgd = (StTriggerData*)os->GetObject(); + if(trgd){ + //LOG_INFO << "got StTriggerData addr="<lastDSM(2) + (trgd->lastDSM(5)<<16); + + //TCU bits + for(int i=0; i<32; i++) if((tcubit >> i) & 0x1) mTcuBit->Fill(i); + + //DSM out + unsigned int dsmout=trg->dsmout; + for(int i=0; i<32; i++) if((dsmout >> i) & 0x1) mDsmOut->Fill(i); + mDsmOut->Fill(32); //DEP out int depout=0; @@ -164,202 +186,184 @@ Int_t StFcsTrgQaMaker::Make() { int ns = hits[i]->ns(); int dep = hits[i]->dep(); int ch = hits[i]->channel(); - //printf("DEP TRG data = %1d %1d %02d %02d\n",ehp,ns,dep,ch); - if(ehp!=3) continue; - if(ns!=0) continue; - if(dep!=0) continue; - if(ch==4 || ch==5){ + if(ehp!=3) continue; //DEPIO boards only + if(dep==0 && (ch==4 || ch==5) ){ //stage3 DEP to TCU int ntb = hits[i]->nTimeBin(); for(int j=0; jadc(j); unsigned short tb = hits[i]->timebin(j); - //if(tb>=96-8 && tb<=96+8) - //if(tb>=96-8){ - if(0){ - printf("DEPIO data = d%1d ns%1d dep%2d ch%2d tb%3d 0x%x",ehp,ns,dep,ch,tb,adc); - if(ch==5 && (adc&0x1)) printf(" ELE2"); - printf("\n");; - } + //printf("DEPIO3 data = ehp%1d ns%1d dep%2d ch%2d tb%3d 0x%x\n",ehp,ns,dep,ch,tb,adc); if(tb!=mS3off) continue; if(ch==4) depout += adc; if(ch==5) depout += (adc << 8); + } + } + if(dep==1 && ch==36){ //stage2 north/south DEP to TCU + int ntb = hits[i]->nTimeBin(); + for(int j=0; jadc(j); + unsigned short tb = hits[i]->timebin(j); + //printf("DEPIO2 data = ehp%1d ns%1d dep%02d ch%02d tb%03d 0x%x\n",ehp,ns,dep,ch,tb,adc); + if(tb!=mS2off) continue; + if(ns==0) depout += (adc&0xff) << 16; + if(ns==1) depout += (adc&0xff) << 24; } - } + } + } + for(int i=0; i<32; i++) if((depout >> i) & 0x1) mDepOut->Fill(i); + + const char* BIT[32]={"HAD0","HAD1","HAD2", + "EM0","EM1","EM2", + "JP2","JPA1","JPBC1","JPDE1","JPA0","JPBC0","JPDE0", + "DiJP","DiJPAsy","DiELEA", + "ELE0-N","ELE1-N","ELE2-N","EM3-N","EHT-N","HHT-N","ETOT-N","HTOT-N", + "ELE0-S","ELE1-S","ELE2-S","EM3-S","EHT-S","HHT-S","ETOT-S","HTOT-S"}; + if(GetDebug()){ + LOG_INFO << Form("FCSBits SIM = %08x ",dsmout); + for(int i=0; i<32; i++){ if((dsmout>>i)&1) {LOG_INFO << BIT[i] << " ";} } LOG_INFO<>i)&1) {LOG_INFO << BIT[i] << " ";} } LOG_INFO<>i)&1) {LOG_INFO << BIT[i] << " ";} } LOG_INFO<> i) & 0x1) mDepOut->Fill(i); //Mismatch - for(int i=0; i<16; i++) if((depout >> i) != (tcubit >> i)) mTcuDep->Fill(i); - for(int i=0; i<16; i++) if((depout >> i) != (dsmout >> i)) mSimDep->Fill(i); + LOG_INFO << Form("FCSBitsMM DEP-TCU Mismatch "); + for(int i=0; i<32; i++) if(((depout>> i)&1) != ((tcubit>>i)&1)) {mTcuDep->Fill(i); LOG_INFO << BIT[i] << " ";} + LOG_INFO<>i)&1) != ((depout>>i)&1)) {mSimDep->Fill(i); LOG_INFO << BIT[i] << " ";} + LOG_INFO<numberOfHits(det); + StSPtrVecFcsHit& hits = fcs->hits(det); + for (int i=0; iid(); + int ehp = hits[i]->ehp(); + int ns = hits[i]->ns(); + int c = mFcsDb->getColumnNumber(det,id); + int r = mFcsDb->getRowNumber(det,id); + float cc = c * (ns*2-1); + float rr = - r; + mTow[ehp]->Fill(cc,rr,hits[i]->energy()); + } + } unsigned int max; int maxns,maxc,maxr; - + int maxns2,maxc2,maxr2; + int maxns3,maxc3,maxr3; + int maxns4,maxc4,maxr4; + int maxns5,maxc5,maxr5; //Ecal HT 2x2 - max=0; for(int ns=0; nse2x2[ns][r][c]>max){ //find max Ecal 2x2 - max=trg->e2x2[ns][r][c]; maxns=ns; maxr=r; maxc=c; + max=trg->e2x2[ns][r][c]; maxr=r; maxc=c; } } } + if(max>0){ + mEHT[ns]->Fill(max); + mEHTMap->Fill((maxc+1)*(ns*2-1),-maxr-1); + } } - mEHT[0]->Fill(max); - if((dsmout>>0)&0x1) mEHT[1]->Fill(max); - if((depout>>0)&0x1) mEHT[2]->Fill(max); - if((tcubit>>0)&0x1) mEHT[3]->Fill(max); //Hcal HT 2x2 - max=0; for(int ns=0; nsh2x2[ns][r][c]>max){ //find max Hcal 2x2 - max=trg->h2x2[ns][r][c]; maxns=ns; maxr=r; maxc=c; + max=trg->h2x2[ns][r][c]; maxr=r; maxc=c; } } } + if(max>0){ + mHHT[ns]->Fill(max); + mHHTMap->Fill((maxc+1)*(ns*2-1),-maxr-1); + } } - mHHT[0]->Fill(max); - if((dsmout>>1)&0x1) mHHT[1]->Fill(max); - if((depout>>1)&0x1) mHHT[2]->Fill(max); - if((tcubit>>1)&0x1) mHHT[3]->Fill(max); //Ecal Tot - max=trg->etot[0]; - if(trg->etot[1] > max) max=trg->etot[1]; - mETot[0]->Fill(max); - if((dsmout>>2)&0x1) mETot[1]->Fill(max); - if((depout>>2)&0x1) mETot[2]->Fill(max); - if((tcubit>>2)&0x1) mETot[3]->Fill(max); + mETot[0]->Fill(trg->etot[0]); + mETot[1]->Fill(trg->etot[1]); //Hcal Tot - max=trg->htot[0]; - if(trg->htot[1] > max) max=trg->htot[1]; - mHTot[0]->Fill(max); - if((dsmout>>3)&0x1) mHTot[1]->Fill(max); - if((depout>>3)&0x1) mHTot[2]->Fill(max); - if((tcubit>>3)&0x1) mHTot[3]->Fill(max); + mHTot[0]->Fill(trg->htot[0]); + mHTot[1]->Fill(trg->htot[1]); //JP - max=0; for(int ns=0; nsjet[ns][r]>max){ //find max JP - max=trg->jet[ns][r]; maxns=ns; maxr=r; - } + for(int j=0; j<5; j++){ + if(trg->jet[ns][j]>max){ //find max JP + mJP[ns][j]->Fill(trg->jet[ns][j]); + if((trg->d_out.s2[ns].s2_to_s3[0].d[1]>>j)&0x1) mJPMap[0]->Fill((j+1)*(ns*2-1)); + if((trg->d_out.s2[ns].s2_to_s3[1].d[1]>>j)&0x1) mJPMap[1]->Fill((j+1)*(ns*2-1)); + if((trg->d_out.s2[ns].s2_to_s3[0].d[2]>>j)&0x1) mJPMap[2]->Fill((j+1)*(ns*2-1)); + } } - } - mJP[0][0]->Fill(max); - if((dsmout>>4)&0x1) mJP[0][1]->Fill(max); - if((depout>>4)&0x1) mJP[0][2]->Fill(max); - if((tcubit>>4)&0x1) mJP[0][3]->Fill(max); - mJP[1][0]->Fill(max); - if((dsmout>>9)&0x1) mJP[1][1]->Fill(max); - if((depout>>9)&0x1) mJP[1][2]->Fill(max); - if((tcubit>>9)&0x1) mJP[1][3]->Fill(max); - - //ecal 4x4 - max=0; + } + + //Ecal 4x4 for(int ns=0; nsesum[ns][r][c]>max){ //find max Ecal 4x4 - max=trg->esum[ns][r][c]; maxns=ns; maxr=r; maxc=c; + int esum=trg->esum[ns][r][c]; + int sum=trg->sum[ns][r][c]; + if(esum>max){ //find max Ecal 4x4 + max=esum; maxns=ns; maxr=r; maxc=c; } - } - } - } - mE4b4[0]->Fill(max); - - //Fill only for max ecal 4x4 - if(max>0){ - int id=maxr*kFcsEcal4x4NCol + maxc; - float pt=max*mPtCh; - mEcal[maxns]->Fill(id,pt); - if(pt>mEcalPtThr){ - mEcalNorm[maxns]->Fill(id); - for(int dep=0; dep<6; dep++){ - for(int ch=0; ch<32; ch++){ - if(trg->phit[maxns][dep][ch]>0){ - int idp=dep*32 + ch; - mEPmap[maxns]->Fill(id,idp); - } + if(esum>emmax && trg->ratiomax[ns][r][c] > 1.0/(1.0+(float)trg->EM_HERATIO_THR/128)){ + emmax=esum; maxns2=ns; maxr2=r; maxc2=c; } - } - } - } - - //hcal - max=0; - for(int ns=0; nshsum[ns][r][c]==0) continue; - int id=r*kFcsHcal4x4NCol + c; - mHcal[ns]->Fill(id,trg->hsum[ns][r][c]*0.0316); - if(trg->hsum[ns][r][c]>max){ //find max Ecal 4x4 - max=trg->esum[ns][r][c]; maxns=ns; maxr=r; maxc=c; + if(esum>elemax && trg->ratiomax[ns][r][c] > 1.0/(1.0+(float)trg->EM_HERATIO_THR/128) && trg->epdcoin[ns][r][c]){ + elemax=esum; maxns3=ns; maxr3=r; maxc3=c; } - } - } - } - mH4b4[0]->Fill(max); - - //Pres ADC - max=0; - for(int ns=0; nspadc[ns][dep][ch]>0){ - int idp=dep*32 + ch; - mPres[ns]->Fill(idp,trg->padc[ns][dep][ch]/150.0); + if(sum>summax){ + summax=sum; maxns4=ns; maxr4=r; maxc4=c; } - if(trg->padc[ns][dep][ch]>max){ //find max Ecal 4x4 - max=trg->padc[ns][dep][ch]; maxns=ns; maxr=dep; maxc=ch; + if(sum>hadmax && trg->ratio[ns][r][c] < 1.0/(1.0+(float)trg->HAD_HERATIO_THR/128)){ + hadmax=sum; maxns5=ns; maxr5=r; maxc5=c; } - } - } - } - mPOR[0]->Fill(max); - - //ecal+hcal 4x4 - max=0; - for(int ns=0; nssum[ns][r][c]>max){ //find max Ecal 4x4 - max=trg->sum[ns][r][c]; maxns=ns; maxr=r; maxc=c; + int cc=(c+1)*(ns*2-1); + int rr=-r-1; + if(esum > trg->EMTHR2) mE4x4Map[0]->Fill(cc,rr); + if(esum > trg->EMTHR1) mE4x4Map[1]->Fill(cc,rr); + if(esum > trg->EMTHR0) mE4x4Map[2]->Fill(cc,rr); + if(esum > trg->ELETHR2) mE4x4Map[3]->Fill(cc,rr); + if(trg->epdcoin[ns][r][c]){ + if(esum > trg->ELETHR2) mELE4x4Map[0]->Fill(cc,rr); + if(esum > trg->ELETHR1) mELE4x4Map[1]->Fill(cc,rr); } + if(sum > trg->HADTHR2) mEH4x4Map[0]->Fill(cc,rr); + if(sum > trg->HADTHR1) mEH4x4Map[1]->Fill(cc,rr); + if(sum > trg->HADTHR0) mEH4x4Map[2]->Fill(cc,rr); } } - } - if(max>0){ - mSum[0][0]->Fill(max); - mSumTot[0]->Fill(max,trg->etot[maxns]); - mSumTot[1]->Fill(max,trg->htot[maxns]); - mEHR[0][0]->Fill(trg->ratio[maxns][maxr][maxc]); - if(trg->had[maxns][maxr][maxc]){ - mSum[1][0]->Fill(max); - mEHR[1][0]->Fill(trg->ratio[maxns][maxr][maxc]); - } - if(trg->em[maxns][maxr][maxc]){ - mSum[2][0]->Fill(max); - mEHR[2][0]->Fill(trg->ratio[maxns][maxr][maxc]); - if(trg->epdcoin[maxns][maxr][maxc]==0){ - mSum[3][0]->Fill(max); - mEHR[3][0]->Fill(trg->ratio[maxns][maxr][maxc]); - } - if(trg->epdcoin[maxns][maxr][maxc]==1){ - mSum[4][0]->Fill(max); - mEHR[4][0]->Fill(trg->ratio[maxns][maxr][maxc]); - } - } + if(max>0) mE4x4->Fill(max); + if(emmax>0) mEM4x4->Fill(emmax); + if(elemax>0) mELE4x4->Fill(elemax); + if(summax>0) mEH4x4->Fill(summax); + if(hadmax>0) mHAD4x4->Fill(summax); + if(max>0) mERatio->Fill(trg->ratiomax[maxns][maxr][maxc]); + if(elemax>0) mELERatio->Fill(trg->ratiomax[maxns3][maxr3][maxc3]); + if(summax>0) mHRatio->Fill(trg->ratio[maxns4][maxr4][maxc4]); + if(hadmax>0) mHADRatio->Fill(trg->ratio[maxns5][maxr5][maxc5]); } + + for(int det=0; dethits(det); + int nh=fcs->numberOfHits(det); + for(int i=0; iFill(hits[i]->id(),(float)hits[i]->adcSum()); + } + return kStOK; }; diff --git a/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.h b/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.h index 84b6ec44d3c..7ead1958a63 100644 --- a/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.h +++ b/StRoot/StSpinPool/StFcsTrgQaMaker/StFcsTrgQaMaker.h @@ -30,6 +30,7 @@ class StFcsTrgQaMaker : public StMaker { void setPtCh(float v) {mPtCh=v;} void setEcalPtThr(float v) {mEcalPtThr=v;} void setS3off(int v) {mS3off=v;} + void setS2off(int v) {mS2off=v;} protected: @@ -41,33 +42,47 @@ class StFcsTrgQaMaker : public StMaker { int mRun=0; float mPtCh=0.0316; float mEcalPtThr=1.5; - int mS3off=96; - - TH1F* mETot[4]; - TH1F* mHTot[4]; - TH1F* mEHT[4]; - TH1F* mHHT[4]; - TH1F* mJP[2][4]; - - TH1F* mE4b4[4]; - TH1F* mH4b4[4]; - TH1F* mPOR[4]; - - TH1F* mSum[5][4]; - TH1F* mEHR[5][4]; - TH2F* mSumTot[2]; - - TH2F* mDEm[4]; - TH2F* mDHad[4]; - TH2F* mDGam[4]; - TH2F* mDEle[4]; - TH2F* mDJP[4]; - - TH2F* mEcal[kFcsNorthSouth]; - TH2F* mHcal[kFcsNorthSouth]; - TH2F* mPres[kFcsNorthSouth]; - TH2F* mEPmap[kFcsNorthSouth]; - TH1F* mEcalNorm[kFcsNorthSouth]; + + //marker.adc_start = 7 + //marker.s1_out_start = marker.adc_start + 11 = 18 + //marker.s2_in_start = marker.s1_out_start + 2 = 20 + //marker.s2_to_s3_start = marker.s2_in_start + 15 = 35 + //marker.s3_in_start = marker.s2_to_s3_start + 8 = 43 + //marker.dsm_out_start=marker.s3_in_start + 14 = 57 + //So... DEPIO DSM out is 50 tb later than ADC + //center trig tb=50 => tb=47~54 and 47=marker.adc_start(7)+5xing*8tb/xing + //Thus.... mS3off=47+50 = 97 + int mS3off=97; + int mS2off=97; //Tonko says same as S3off + + TH2F* mTow[2]; + + TH1F* mETot[2]; + TH1F* mHTot[2]; + + TH1F* mEHT[2]; + TH2F* mEHTMap; + TH1F* mHHT[2]; + TH2F* mHHTMap; + + TH1F* mJP[2][5]; + TH1F* mJPMap[3]; + + TH1F* mE4x4; + TH1F* mEM4x4; + TH1F* mELE4x4; + TH1F* mERatio; + TH1F* mELERatio; + + TH1F* mH4x4; + TH1F* mEH4x4; + TH1F* mHAD4x4; + TH1F* mHRatio; + TH1F* mHADRatio; + + TH2F* mE4x4Map[4]; + TH2F* mELE4x4Map[2]; + TH2F* mEH4x4Map[3]; TH1F* mDsmOut; TH1F* mDepOut; @@ -75,6 +90,8 @@ class StFcsTrgQaMaker : public StMaker { TH1F* mTcuDep; TH1F* mSimDep; + TH2F* mAdc[3]; + ClassDef(StFcsTrgQaMaker,1); }; diff --git a/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.cxx b/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.cxx index e63e2d44858..1ffeebf0de8 100644 --- a/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.cxx +++ b/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.cxx @@ -50,6 +50,16 @@ #include "StRoot/RTS/src/TRG_FCS/fcs_trg_base.h" +#include "StMaker.h" +#include "StChain.h" +#include "StMuDSTMaker/COMMON/StMuDst.h" +#include "StMuDSTMaker/COMMON/StMuEvent.h" +#include "StMuDSTMaker/COMMON/StMuFcsCollection.h" +#include "StMuDSTMaker/COMMON/StMuFcsHit.h" +#include "StMuDSTMaker/COMMON/StMuTypes.hh" +#include "StMuDSTMaker/COMMON/StMuEvent.h" +#include "StMuDSTMaker/COMMON/StMuFcsCollection.h" + namespace { enum {kMaxNS=2, kMaxDet=3, kMaxDep=24, kMaxCh=32, kMaxEcalDep=24, kMaxHcalDep=8, kMaxPresDep=4, kMaxLink2=2}; uint32_t fcs_trg_sim_adc[kMaxNS][kMaxDet][kMaxDep][kMaxCh] ; @@ -126,6 +136,11 @@ int StFcsTriggerSimMaker::Init(){ mTrgSim->stage_version[1]=1; mTrgSim->stage_version[2]=7; mTrgSim->stage_version[3]=7; + }else if(mTrgSelect==202209){ + mTrgSim->stage_version[0]=3; + mTrgSim->stage_version[1]=1; + mTrgSim->stage_version[2]=7; + mTrgSim->stage_version[3]=7; } //Thresholds @@ -179,17 +194,17 @@ int StFcsTriggerSimMaker::InitRun(int runNumber){ mTree->Branch("trg",&mTrg,"trg/I"); } if(mQaHistFilename){ - mQaHistFile=new TFile(mQaHistFilename,"RECREATE"); - mTrgRate = new TH1F("FcsTrgRate","FcsTrgRate",mNTRG+1,0,mNTRG+1); + mQaHistFile=new TFile(mQaHistFilename,"RECREATE"); + mTrgRate = new TH1F("FcsTrgRate","FcsTrgRate",mNTRG+1,0,mNTRG+1); } //Write Text event file & gainfile FILE* gainfile=0; FILE* gainfile2=0; if(mFilename){ - mFile = fopen(mFilename,"w"); - gainfile=fopen("fcs_et_gain.txt","w"); - gainfile2=fopen("fcs_et_gain2.txt","w"); + mFile = fopen(mFilename,"w"); + gainfile=fopen("fcs_et_gain.txt","w"); + gainfile2=fopen("fcs_et_gain2.txt","w"); } //Fill ETgain, GainCorr and Pedestal @@ -261,11 +276,27 @@ int StFcsTriggerSimMaker::Finish(){ } int StFcsTriggerSimMaker::Make(){ - StEvent* event = (StEvent*)GetInputDS("StEvent"); - if(!event) {LOG_ERROR << "StFcsTriggerSimMaker::Make did not find StEvent"<fcsCollection(); - if(!mFcsColl) {LOG_ERROR << "StFcsTriggerSimMaker::Make did not find StEvent->StFcsCollection"<StFcsCollection"<start_event(); //Feed ADC @@ -274,34 +305,40 @@ int StFcsTriggerSimMaker::Make(){ memset(fcs_trg_sim_adc,0,sizeof(fcs_trg_sim_adc)); int n=0; for(int det=0; det<=kFcsNDet; det++){ - StSPtrVecFcsHit& hits = mFcsColl->hits(det); - int ns = mFcsDb->northSouth(det); - int ehp = mFcsDb->ecalHcalPres(det); - int nh = mFcsColl->numberOfHits(det); - for(int i=0; idep(); - unsigned short ch = hit->channel(); - //printf("ns=%1d ehp=%1d dep=%2d ch=%2d adc=%4d\n",ns,ehp,dep,ch,hit->adc()); - if(ehp<0 || ch>=32) continue; - fcs_trg_sim_adc[ns][ehp][dep][ch] = hit->adc(0); - if(mSimMode==0){ - int ntb=hit->nTimeBin(); - for(int t=0; ttimebin(t); - if(tb>=mTrgTimebin-3 && tb<=mTrgTimebin+4){ - data[tb-mTrgTimebin+3] = hit->adc(t); - //printf("tb=%3d i=%2d adc=%4d\n",tb,tb-mTrgTimebin+3,hit->adc(t)); - } - } - mTrgSim->fill_event(ehp,ns,dep,ch,data,8) ; - }else{ - data[3] = hit->adc(0); - mTrgSim->fill_event(ehp,ns,dep,ch,data,8) ; - } - if(mFile) fprintf(mFile,"%2d %2d %2d %2d %5d\n",ns,ehp,dep,ch,hit->adc(0)); - n++; - } + + int ns = mFcsDb->northSouth(det); + int ehp = mFcsDb->ecalHcalPres(det); + + if((event)&&(mFcsColl)){ + StSPtrVecFcsHit& hits = mFcsColl->hits(det); + + int nh = mFcsColl->numberOfHits(det); + + for(int i=0; ichannel(); + + if(ehp<0 || ch>=32) continue; + feedADC(hit, ns, ehp, data); + n++; + } + + }else if((muevent)&&(mMuFcsColl)){ //Use StMuDst info instead of StEvent for Trigger Reconstruction + + int nh = mMuFcsColl->numberOfHits(det); + int det_hit_index = mMuFcsColl->indexOfFirstHit(det); + + for(int i=0; igetHit(hit_index); + unsigned short ch = hit->channel(); + + if(ehp<0 || ch>=32) continue; + feedADC(hit, ns, ehp, data); + n++; + } + } } if(mFile) fprintf(mFile,"%2d %2d %2d %2d %5d\n",-1,0,0,0,0); LOG_INFO << Form("StFcsTriggerSimMaker feeded %d hits",n) << endm;; @@ -309,7 +346,7 @@ int StFcsTriggerSimMaker::Make(){ //Run Trigger Simulation // uint16_t dsm_out = fcs_trg_run(mTrgSelect, mDebug); uint32_t dsm_out = mTrgSim->end_event(); - + //QA Tree mFlt=0; StarPrimaryMaker* pmkr= static_cast(GetMaker("PrimaryMaker")); @@ -321,7 +358,7 @@ int StFcsTriggerSimMaker::Make(){ } mTcu=dsm_out; if(mQaTreeFile) mTree->Fill(); - + //Results LOG_INFO << Form("Output to TCU = 0x%08x Filter=0x%08x",mTcu,mFlt)<Fill(mNTRG); NTRG[mNTRG]++; - for(int i=0; iFill(i); - NTRG[i]++; - } + for(int i=0; iFill(i); + NTRG[i]++; + } } - + LOG_INFO << "Triggers = "; for(int i=0; i void StFcsTriggerSimMaker::feedADC(T* hit, int ns, int ehp, uint16_t data_array[]){ + + unsigned short dep = hit->dep(); + unsigned short ch = hit->channel(); + +// printf("ns=%1d ehp=%1d dep=%2d ch=%2d adc=%4d sim=%d\n",ns,ehp,dep,ch,hit->adc(0),mSimMode); + fcs_trg_sim_adc[ns][ehp][dep][ch] = hit->adc(0); + if(mSimMode==0){ + int ntb=hit->nTimeBin(); + for(int t=0; ttimebin(t); + if(tb>=mTrgTimebin-3 && tb<=mTrgTimebin+4){ + data_array[tb-mTrgTimebin+3] = hit->adc(t); +// printf("tb=%3d i=%2d adc=%4d\n",tb,tb-mTrgTimebin+3,hit->adc(t)); + } + } + mTrgSim->fill_event(ehp,ns,dep,ch,data_array,8) ; + }else{ + data_array[1] = hit->adc(0)-1; //removing 1 to add at tb6 + data_array[6] = 1; //add this so tb6>tb7 + mTrgSim->fill_event(ehp,ns,dep,ch,data_array,8) ; + } + if(mFile) fprintf(mFile,"%2d %2d %2d %2d %5d\n",ns,ehp,dep,ch,hit->adc(0)); + +} diff --git a/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.h b/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.h index 306e759a37a..9d5fec4f7e6 100644 --- a/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.h +++ b/StRoot/StSpinPool/StFcsTriggerSimMaker/StFcsTriggerSimMaker.h @@ -8,15 +8,19 @@ #define STAR_StFcsTriggerSimMaker_HH #include "StMaker.h" +#include class StFcsDb; class StFcsCollection; +class StMuFcsCollection; class TFile; class fcs_trg_base; class link_t; class geom_t; class TTree; class TH1F; +class StFcsHit; +class StMuFcsHit; class StFcsTriggerSimMaker : public StMaker{ public: @@ -42,6 +46,8 @@ class StFcsTriggerSimMaker : public StMaker{ void setEtGain(float v) {mEtFactor=v;} fcs_trg_base* getTriggerEmu() {return mTrgSim;} + + template void feedADC(T* hit, int ns, int ehp, uint16_t data_array[]); //this is for just running stage2 from macro void runStage2(link_t ecal[], link_t hcal[], link_t pres[], geom_t &geo, link_t output[]); @@ -49,6 +55,8 @@ class StFcsTriggerSimMaker : public StMaker{ private: StFcsDb* mFcsDb=0; StFcsCollection* mFcsColl=0; + StMuFcsCollection* mMuFcsColl = 0; + int mTrgSelect=0; int mDebug=0; char* mFilename=0; diff --git a/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_daq_map.txt b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_daq_map.txt new file mode 100644 index 00000000000..14bc167c0d2 --- /dev/null +++ b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_daq_map.txt @@ -0,0 +1,138 @@ +#### PC Id ("sector") [1..10ish] +#### RDO Id within the PC [1..8] +#### Note: RDOs 1..4 are on the PCIe on the top side of the PC +#### RDOs 5..8 are on the PCIe closer to the bottom/motherboard +#### Also, number 1 (or 5) is the fiber closer to the middle of the PC, or left if looking from behind +#### +#### Detector Type [0..3]: 0=ECAL,1=HCAL,2=FPRE,3=Main +#### North/South [0..1]: 0=North,1=South +#### DEP board: 0..23 +#### Channel mask -- NOTE THAT IT IS A 64 BIT HEX NUMBER --> THUS "ll" AT THE END and 0x at the beginning +# +# Owner is Tonko! +# + +# Version: 7-Oct_2020 -- map accoriding to diagram +# Version: 3-Jun-2020 -- ad-hoc map + + +############### ECAL North + 1 1 0 0 0 0x1FFFFFFFFll # ECAL + 1 2 0 0 1 0x1FFFFFFFFll # ECAL + 1 3 0 0 2 0x1FFFFFFFFll # ECAL + 1 4 0 0 3 0x1FFFFFFFFll # ECAL + 1 5 0 0 4 0x1FFFFFFFFll # ECAL + 1 6 0 0 5 0x1FFFFFFFFll # ECAL + 1 7 0 0 6 0x1FFFFFFFFll # ECAL + 1 8 0 0 7 0x1FFFFFFFFll # ECAL + + 2 1 0 0 8 0x1FFFFFFFFll # ECAL + 2 2 0 0 9 0x1FFFFFFFFll # ECAL + 2 3 0 0 10 0x1FFFFFFFFll # ECAL + 2 4 0 0 11 0x1FFFFFFFFll # ECAL + 2 5 0 0 12 0x1FFFFFFFFll # ECAL + 2 6 0 0 13 0x1FFFFFFFFll # ECAL + 2 7 0 0 14 0x1FFFFFFFFll # ECAL + 2 8 0 0 15 0x1FFFFFFFFll # ECAL + + 3 1 0 0 16 0x1FFFFFFFFll # ECAL + 3 2 0 0 17 0x1FFFFFFFFll # ECAL + 3 3 0 0 18 0x1FFFFFFFFll # ECAL + 3 4 0 0 19 0x1FFFFFFFFll # ECAL + 3 5 0 0 20 0x1FFFFFFFFll # ECAL + 3 6 0 0 21 0x1FFFFFFFFll # ECAL + 3 7 0 0 22 0x1FFFFFFFFll # ECAL + 3 8 0 0 23 0x1FFFFFFFFll # ECAL + +############### ECAL South + 6 1 0 1 0 0x1FFFFFFFFll # ECAL + 6 2 0 1 1 0x1FFFFFFFFll # ECAL + 6 3 0 1 2 0x1FFFFFFFFll # ECAL + 6 4 0 1 3 0x1FFFFFFFFll # ECAL + 6 5 0 1 4 0x1FFFFFFFFll # ECAL + 6 6 0 1 5 0x1FFFFFFFFll # ECAL + 6 7 0 1 6 0x1FFFFFFFFll # ECAL + 6 8 0 1 7 0x1FFFFFFFFll # ECAL + + 7 1 0 1 8 0x1FFFFFFFFll # ECAL + 7 2 0 1 9 0x1FFFFFFFFll # ECAL + 7 3 0 1 10 0x1FFFFFFFFll # ECAL + 7 4 0 1 11 0x1FFFFFFFFll # ECAL + 7 5 0 1 12 0x1FFFFFFFFll # ECAL + 7 6 0 1 13 0x1FFFFFFFFll # ECAL + 7 7 0 1 14 0x1FFFFFFFFll # ECAL +# 7-8 is a dead slot +# + + 8 1 0 1 16 0x1FFFFFFFFll # ECAL + 8 2 0 1 17 0x1FFFFFFFFll # ECAL + 8 3 0 1 18 0x1FFFFFFFFll # ECAL + 8 4 0 1 19 0x1FFFFFFFFll # ECAL + 8 5 0 1 20 0x1FFFFFFFFll # ECAL + 8 6 0 1 21 0x1FFFFFFFFll # ECAL + 8 7 0 1 22 0x1FFFFFFFFll # ECAL + 8 8 0 1 23 0x1FFFFFFFFll # ECAL + +############### HCAL North + 4 1 1 0 0 0x1FFFFFFFFll # HCAL + 4 2 1 0 1 0x1FFFFFFFFll # HCAL + 4 3 1 0 2 0x1FFFFFFFFll # HCAL + 4 4 1 0 3 0x1FFFFFFFFll # HCAL + 4 5 1 0 4 0x1FFFFFFFFll # HCAL + 4 6 1 0 5 0x1FFFFFFFFll # HCAL + 4 7 1 0 6 0x1FFFFFFFFll # HCAL + 4 8 1 0 7 0x1FFFFFFFFll # HCAL + +############### HCAL South + 9 1 1 1 0 0x1FFFFFFFFll # HCAL + 9 2 1 1 1 0x1FFFFFFFFll # HCAL + 9 3 1 1 2 0x1FFFFFFFFll # HCAL + 9 4 1 1 3 0x1FFFFFFFFll # HCAL + 9 5 1 1 4 0x1FFFFFFFFll # HCAL + 9 6 1 1 5 0x1FFFFFFFFll # HCAL + 9 7 1 1 6 0x1FFFFFFFFll # HCAL + 9 8 1 1 7 0x1FFFFFFFFll # HCAL + +############### Preshower & HCAL North + 5 1 1 0 8 0x1FFFFFFFFll # HCAL +# RDO #2 is connected to what was 7-8 + 5 2 0 1 15 0x1FFFFFFFFll # ECAL + 5 3 2 0 0 0x1FFFFFFFFll # FPRE/EPD + 5 4 2 0 1 0x1FFFFFFFFll # FPRE/EPD + 5 5 2 0 2 0x1FFFFFFFFll # FPRE/EPD + 5 6 2 0 3 0x1FFFFFFFFll # FPRE/EPD + 5 7 2 0 4 0x1FFFFFFFFll # FPRE/EPD + 5 8 2 0 5 0x1FFFFFFFFll # FPRE/EPD + + +############### Preshower & HCAL South +10 1 1 1 8 0x1FFFFFFFFll # HCAL +# RDO #2 connected to what was 10-8 +10 2 2 1 5 0x1FFFFFFFFll # FPRE/EPD +10 3 2 1 0 0x1FFFFFFFFll # FPRE/EPD +10 4 2 1 1 0x1FFFFFFFFll # FPRE/EPD +10 5 2 1 2 0x1FFFFFFFFll # FPRE/EPD +10 6 2 1 3 0x1FFFFFFFFll # FPRE/EPD +10 7 2 1 4 0x1FFFFFFFFll # FPRE/EPD +# RDO #8 is dead + + +############### Main crate +# Moved the map to the upper TEF because the lower seems bad +11 5 3 0 0 0x000000003Fll # Main +11 6 3 0 1 0x1FFFFFFFFFll # Stage 2 north +11 7 3 1 1 0x1FFFFFFFFFll # Stage 2 south +#11 6 3 0 1 0x0FFFFFFFFFll # Stage 2 north +#11 7 3 1 1 0x0FFFFFFFFFll # Stage 2 south + + +# unphysical spares! Also, setup for FY20 tests. +#12 1 0 0 18 0x1FFFFFFFFll +#12 2 0 1 19 0x1FFFFFFFFll +#12 3 0 0 20 0x1FFFFFFFFll +#12 4 0 1 21 0x1FFFFFFFFll +#12 5 2 0 0 0x1FFFFFFFFll +#12 6 2 1 1 0x1FFFFFFFFll +#12 7 1 0 0 0x1FFFFFFFFll +#12 8 1 1 1 0x1FFFFFFFFll + diff --git a/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_ecal_et_gains.txt b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_ecal_et_gains.txt new file mode 100644 index 00000000000..f175e1434b2 --- /dev/null +++ b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_ecal_et_gains.txt @@ -0,0 +1,1537 @@ +#ehp ns dep ch EtGain + 0 0 0 0 3.4434 + 0 0 0 1 3.5101 + 0 0 0 2 3.5880 + 0 0 0 3 3.6762 + 0 0 0 4 3.2428 + 0 0 0 5 3.3137 + 0 0 0 6 3.3963 + 0 0 0 7 3.4896 + 0 0 0 8 3.0431 + 0 0 0 9 3.1186 + 0 0 0 10 3.2064 + 0 0 0 11 3.3054 + 0 0 0 12 2.8444 + 0 0 0 13 2.9253 + 0 0 0 14 3.0188 + 0 0 0 15 3.1240 + 0 0 0 16 2.6473 + 0 0 0 17 2.7341 + 0 0 0 18 2.8342 + 0 0 0 19 2.9461 + 0 0 0 20 2.4521 + 0 0 0 21 2.5458 + 0 0 0 22 2.6531 + 0 0 0 23 2.7726 + 0 0 0 24 2.2597 + 0 0 0 25 2.3611 + 0 0 0 26 2.4767 + 0 0 0 27 2.6044 + 0 0 0 28 2.0708 + 0 0 0 29 2.1812 + 0 0 0 30 2.3059 + 0 0 0 31 2.4429 + 0 0 1 0 3.7742 + 0 0 1 1 3.8810 + 0 0 1 2 3.9959 + 0 0 1 3 4.1182 + 0 0 1 4 3.5929 + 0 0 1 5 3.7053 + 0 0 1 6 3.8258 + 0 0 1 7 3.9537 + 0 0 1 8 3.4145 + 0 0 1 9 3.5328 + 0 0 1 10 3.6593 + 0 0 1 11 3.7932 + 0 0 1 12 3.2395 + 0 0 1 13 3.3642 + 0 0 1 14 3.4971 + 0 0 1 15 3.6373 + 0 0 1 16 3.0685 + 0 0 1 17 3.2002 + 0 0 1 18 3.3400 + 0 0 1 19 3.4868 + 0 0 1 20 2.9026 + 0 0 1 21 3.0417 + 0 0 1 22 3.1888 + 0 0 1 23 3.3425 + 0 0 1 24 2.7427 + 0 0 1 25 2.8898 + 0 0 1 26 3.0444 + 0 0 1 27 3.2054 + 0 0 1 28 2.5899 + 0 0 1 29 2.7455 + 0 0 1 30 2.9081 + 0 0 1 31 3.0765 + 0 0 2 0 4.2472 + 0 0 2 1 4.3821 + 0 0 2 2 4.5225 + 0 0 2 3 4.6677 + 0 0 2 4 4.0882 + 0 0 2 5 4.2287 + 0 0 2 6 4.3744 + 0 0 2 7 4.5248 + 0 0 2 8 3.9336 + 0 0 2 9 4.0797 + 0 0 2 10 4.2309 + 0 0 2 11 4.3867 + 0 0 2 12 3.7838 + 0 0 2 13 3.9359 + 0 0 2 14 4.0929 + 0 0 2 15 4.2540 + 0 0 2 16 3.6397 + 0 0 2 17 3.7979 + 0 0 2 18 3.9607 + 0 0 2 19 4.1275 + 0 0 2 20 3.5021 + 0 0 2 21 3.6666 + 0 0 2 22 3.8353 + 0 0 2 23 4.0076 + 0 0 2 24 3.3717 + 0 0 2 25 3.5426 + 0 0 2 26 3.7173 + 0 0 2 27 3.8952 + 0 0 2 28 3.2497 + 0 0 2 29 3.4270 + 0 0 2 30 3.6076 + 0 0 2 31 3.7909 + 0 0 3 0 4.8172 + 0 0 3 1 4.9706 + 0 0 3 2 5.1274 + 0 0 3 3 5.2872 + 0 0 3 4 4.6793 + 0 0 3 5 4.8375 + 0 0 3 6 4.9990 + 0 0 3 7 5.1633 + 0 0 3 8 4.5464 + 0 0 3 9 4.7095 + 0 0 3 10 4.8756 + 0 0 3 11 5.0444 + 0 0 3 12 4.4189 + 0 0 3 13 4.5870 + 0 0 3 14 4.7579 + 0 0 3 15 4.9311 + 0 0 3 16 4.2976 + 0 0 3 17 4.4707 + 0 0 3 18 4.6462 + 0 0 3 19 4.8239 + 0 0 3 20 4.1830 + 0 0 3 21 4.3610 + 0 0 3 22 4.5412 + 0 0 3 23 4.7232 + 0 0 3 24 4.0758 + 0 0 3 25 4.2586 + 0 0 3 26 4.4433 + 0 0 3 27 4.6295 + 0 0 3 28 3.9766 + 0 0 3 29 4.1641 + 0 0 3 30 4.3531 + 0 0 3 31 4.5434 + 0 0 4 0 5.4497 + 0 0 4 1 5.6146 + 0 0 4 2 5.7815 + 0 0 4 3 5.9502 + 0 0 4 4 5.3300 + 0 0 4 5 5.4990 + 0 0 4 6 5.6698 + 0 0 4 7 5.8422 + 0 0 4 8 5.2154 + 0 0 4 9 5.3884 + 0 0 4 10 5.5631 + 0 0 4 11 5.7393 + 0 0 4 12 5.1064 + 0 0 4 13 5.2834 + 0 0 4 14 5.4620 + 0 0 4 15 5.6417 + 0 0 4 16 5.0033 + 0 0 4 17 5.1843 + 0 0 4 18 5.3666 + 0 0 4 19 5.5499 + 0 0 4 20 4.9067 + 0 0 4 21 5.0916 + 0 0 4 22 5.2774 + 0 0 4 23 5.4641 + 0 0 4 24 4.8170 + 0 0 4 25 5.0055 + 0 0 4 26 5.1948 + 0 0 4 27 5.3848 + 0 0 4 28 4.7346 + 0 0 4 29 4.9266 + 0 0 4 30 5.1192 + 0 0 4 31 5.3122 + 0 0 5 0 1.8868 + 0 0 5 1 2.0074 + 0 0 5 2 2.1425 + 0 0 5 3 2.2894 + 0 0 5 4 1.7092 + 0 0 5 5 1.8416 + 0 0 5 6 1.9882 + 0 0 5 7 2.1458 + 0 0 5 8 1.5406 + 0 0 5 9 1.6864 + 0 0 5 10 1.8454 + 0 0 5 11 2.0145 + 0 0 5 12 1.3842 + 0 0 5 13 1.5450 + 0 0 5 14 1.7173 + 0 0 5 15 1.8979 + 0 0 5 16 1.2450 + 0 0 5 17 1.4217 + 0 0 5 18 1.6073 + 0 0 5 19 1.7992 + 0 0 5 20 1.1292 + 0 0 5 21 1.3215 + 0 0 5 22 1.5196 + 0 0 5 23 1.7213 + 0 0 5 24 1.0449 + 0 0 5 25 1.2503 + 0 0 5 26 1.4581 + 0 0 5 27 1.6673 + 0 0 5 28 1.0000 + 0 0 5 29 1.2131 + 0 0 5 30 1.4264 + 0 0 5 31 1.6397 + 0 0 6 0 2.4459 + 0 0 6 1 2.6103 + 0 0 6 2 2.7810 + 0 0 6 3 2.9569 + 0 0 6 4 2.3123 + 0 0 6 5 2.4857 + 0 0 6 6 2.6647 + 0 0 6 7 2.8480 + 0 0 6 8 2.1911 + 0 0 6 9 2.3736 + 0 0 6 10 2.5606 + 0 0 6 11 2.7511 + 0 0 6 12 2.0846 + 0 0 6 13 2.2758 + 0 0 6 14 2.4704 + 0 0 6 15 2.6675 + 0 0 6 16 1.9953 + 0 0 6 17 2.1944 + 0 0 6 18 2.3957 + 0 0 6 19 2.5987 + 0 0 6 20 1.9254 + 0 0 6 21 2.1312 + 0 0 6 22 2.3381 + 0 0 6 23 2.5458 + 0 0 6 24 1.8774 + 0 0 6 25 2.0880 + 0 0 6 26 2.2989 + 0 0 6 27 2.5098 + 0 0 6 28 1.8530 + 0 0 6 29 2.0661 + 0 0 6 30 2.2790 + 0 0 6 31 2.4917 + 0 0 7 0 3.1370 + 0 0 7 1 3.3206 + 0 0 7 2 3.5070 + 0 0 7 3 3.6956 + 0 0 7 4 3.0348 + 0 0 7 5 3.2245 + 0 0 7 6 3.4163 + 0 0 7 7 3.6100 + 0 0 7 8 2.9443 + 0 0 7 9 3.1396 + 0 0 7 10 3.3366 + 0 0 7 11 3.5348 + 0 0 7 12 2.8665 + 0 0 7 13 3.0670 + 0 0 7 14 3.2686 + 0 0 7 15 3.4709 + 0 0 7 16 2.8027 + 0 0 7 17 3.0076 + 0 0 7 18 3.2130 + 0 0 7 19 3.4188 + 0 0 7 20 2.7539 + 0 0 7 21 2.9622 + 0 0 7 22 3.1707 + 0 0 7 23 3.3792 + 0 0 7 24 2.7208 + 0 0 7 25 2.9316 + 0 0 7 26 3.1422 + 0 0 7 27 3.3525 + 0 0 7 28 2.7041 + 0 0 7 29 2.9161 + 0 0 7 30 3.1278 + 0 0 7 31 3.3391 + 0 0 8 0 3.8861 + 0 0 8 1 4.0781 + 0 0 8 2 4.2712 + 0 0 8 3 4.4653 + 0 0 8 4 3.8050 + 0 0 8 5 4.0011 + 0 0 8 6 4.1981 + 0 0 8 7 4.3957 + 0 0 8 8 3.7340 + 0 0 8 9 3.9339 + 0 0 8 10 4.1343 + 0 0 8 11 4.3350 + 0 0 8 12 3.6737 + 0 0 8 13 3.8769 + 0 0 8 14 4.0803 + 0 0 8 15 4.2838 + 0 0 8 16 3.6247 + 0 0 8 17 3.8307 + 0 0 8 18 4.0366 + 0 0 8 19 4.2423 + 0 0 8 20 3.5875 + 0 0 8 21 3.7956 + 0 0 8 22 4.0034 + 0 0 8 23 4.2109 + 0 0 8 24 3.5625 + 0 0 8 25 3.7720 + 0 0 8 26 3.9812 + 0 0 8 27 4.1898 + 0 0 8 28 3.5499 + 0 0 8 29 3.7602 + 0 0 8 30 3.9700 + 0 0 8 31 4.1792 + 0 0 9 0 4.6600 + 0 0 9 1 4.8553 + 0 0 9 2 5.0509 + 0 0 9 3 5.2467 + 0 0 9 4 4.5937 + 0 0 9 5 4.7919 + 0 0 9 6 4.9903 + 0 0 9 7 5.1887 + 0 0 9 8 4.5359 + 0 0 9 9 4.7368 + 0 0 9 10 4.9377 + 0 0 9 11 5.1383 + 0 0 9 12 4.4872 + 0 0 9 13 4.6904 + 0 0 9 14 4.8933 + 0 0 9 15 5.0959 + 0 0 9 16 4.4477 + 0 0 9 17 4.6528 + 0 0 9 18 4.8575 + 0 0 9 19 5.0617 + 0 0 9 20 4.4179 + 0 0 9 21 4.6244 + 0 0 9 22 4.8304 + 0 0 9 23 5.0358 + 0 0 9 24 4.3979 + 0 0 9 25 4.6054 + 0 0 9 26 4.8123 + 0 0 9 27 5.0185 + 0 0 9 28 4.3878 + 0 0 9 29 4.5959 + 0 0 9 30 4.8032 + 0 0 9 31 5.0099 + 0 0 10 0 1.0000 + 0 0 10 1 1.2131 + 0 0 10 2 1.4264 + 0 0 10 3 1.6397 + 0 0 10 4 1.0449 + 0 0 10 5 1.2503 + 0 0 10 6 1.4581 + 0 0 10 7 1.6673 + 0 0 10 8 1.1292 + 0 0 10 9 1.3215 + 0 0 10 10 1.5196 + 0 0 10 11 1.7213 + 0 0 10 12 1.2450 + 0 0 10 13 1.4217 + 0 0 10 14 1.6073 + 0 0 10 15 1.7992 + 0 0 10 16 1.3842 + 0 0 10 17 1.5450 + 0 0 10 18 1.7173 + 0 0 10 19 1.8979 + 0 0 10 20 1.5406 + 0 0 10 21 1.6864 + 0 0 10 22 1.8454 + 0 0 10 23 2.0145 + 0 0 10 24 1.7092 + 0 0 10 25 1.8416 + 0 0 10 26 1.9882 + 0 0 10 27 2.1458 + 0 0 10 28 1.8868 + 0 0 10 29 2.0074 + 0 0 10 30 2.1425 + 0 0 10 31 2.2894 + 0 0 11 0 1.8530 + 0 0 11 1 2.0661 + 0 0 11 2 2.2790 + 0 0 11 3 2.4917 + 0 0 11 4 1.8774 + 0 0 11 5 2.0880 + 0 0 11 6 2.2989 + 0 0 11 7 2.5098 + 0 0 11 8 1.9254 + 0 0 11 9 2.1312 + 0 0 11 10 2.3381 + 0 0 11 11 2.5458 + 0 0 11 12 1.9953 + 0 0 11 13 2.1944 + 0 0 11 14 2.3957 + 0 0 11 15 2.5987 + 0 0 11 16 2.0846 + 0 0 11 17 2.2758 + 0 0 11 18 2.4704 + 0 0 11 19 2.6675 + 0 0 11 20 2.1911 + 0 0 11 21 2.3736 + 0 0 11 22 2.5606 + 0 0 11 23 2.7511 + 0 0 11 24 2.3123 + 0 0 11 25 2.4857 + 0 0 11 26 2.6647 + 0 0 11 27 2.8480 + 0 0 11 28 2.4459 + 0 0 11 29 2.6103 + 0 0 11 30 2.7810 + 0 0 11 31 2.9569 + 0 0 12 0 2.7041 + 0 0 12 1 2.9161 + 0 0 12 2 3.1278 + 0 0 12 3 3.3391 + 0 0 12 4 2.7208 + 0 0 12 5 2.9316 + 0 0 12 6 3.1422 + 0 0 12 7 3.3525 + 0 0 12 8 2.7539 + 0 0 12 9 2.9622 + 0 0 12 10 3.1707 + 0 0 12 11 3.3792 + 0 0 12 12 2.8027 + 0 0 12 13 3.0076 + 0 0 12 14 3.2130 + 0 0 12 15 3.4188 + 0 0 12 16 2.8665 + 0 0 12 17 3.0670 + 0 0 12 18 3.2686 + 0 0 12 19 3.4709 + 0 0 12 20 2.9443 + 0 0 12 21 3.1396 + 0 0 12 22 3.3366 + 0 0 12 23 3.5348 + 0 0 12 24 3.0348 + 0 0 12 25 3.2245 + 0 0 12 26 3.4163 + 0 0 12 27 3.6100 + 0 0 12 28 3.1370 + 0 0 12 29 3.3206 + 0 0 12 30 3.5070 + 0 0 12 31 3.6956 + 0 0 13 0 3.5499 + 0 0 13 1 3.7602 + 0 0 13 2 3.9700 + 0 0 13 3 4.1792 + 0 0 13 4 3.5625 + 0 0 13 5 3.7720 + 0 0 13 6 3.9812 + 0 0 13 7 4.1898 + 0 0 13 8 3.5875 + 0 0 13 9 3.7956 + 0 0 13 10 4.0034 + 0 0 13 11 4.2109 + 0 0 13 12 3.6247 + 0 0 13 13 3.8307 + 0 0 13 14 4.0366 + 0 0 13 15 4.2423 + 0 0 13 16 3.6737 + 0 0 13 17 3.8769 + 0 0 13 18 4.0803 + 0 0 13 19 4.2838 + 0 0 13 20 3.7340 + 0 0 13 21 3.9339 + 0 0 13 22 4.1343 + 0 0 13 23 4.3350 + 0 0 13 24 3.8050 + 0 0 13 25 4.0011 + 0 0 13 26 4.1981 + 0 0 13 27 4.3957 + 0 0 13 28 3.8861 + 0 0 13 29 4.0781 + 0 0 13 30 4.2712 + 0 0 13 31 4.4653 + 0 0 14 0 4.3878 + 0 0 14 1 4.5959 + 0 0 14 2 4.8032 + 0 0 14 3 5.0099 + 0 0 14 4 4.3979 + 0 0 14 5 4.6054 + 0 0 14 6 4.8123 + 0 0 14 7 5.0185 + 0 0 14 8 4.4179 + 0 0 14 9 4.6244 + 0 0 14 10 4.8304 + 0 0 14 11 5.0358 + 0 0 14 12 4.4477 + 0 0 14 13 4.6528 + 0 0 14 14 4.8575 + 0 0 14 15 5.0617 + 0 0 14 16 4.4872 + 0 0 14 17 4.6904 + 0 0 14 18 4.8933 + 0 0 14 19 5.0959 + 0 0 14 20 4.5359 + 0 0 14 21 4.7368 + 0 0 14 22 4.9377 + 0 0 14 23 5.1383 + 0 0 14 24 4.5937 + 0 0 14 25 4.7919 + 0 0 14 26 4.9903 + 0 0 14 27 5.1887 + 0 0 14 28 4.6600 + 0 0 14 29 4.8553 + 0 0 14 30 5.0509 + 0 0 14 31 5.2467 + 0 0 15 0 2.0708 + 0 0 15 1 2.1812 + 0 0 15 2 2.3059 + 0 0 15 3 2.4429 + 0 0 15 4 2.2597 + 0 0 15 5 2.3611 + 0 0 15 6 2.4767 + 0 0 15 7 2.6044 + 0 0 15 8 2.4521 + 0 0 15 9 2.5458 + 0 0 15 10 2.6531 + 0 0 15 11 2.7726 + 0 0 15 12 2.6473 + 0 0 15 13 2.7341 + 0 0 15 14 2.8342 + 0 0 15 15 2.9461 + 0 0 15 16 2.8444 + 0 0 15 17 2.9253 + 0 0 15 18 3.0188 + 0 0 15 19 3.1240 + 0 0 15 20 3.0431 + 0 0 15 21 3.1186 + 0 0 15 22 3.2064 + 0 0 15 23 3.3054 + 0 0 15 24 3.2428 + 0 0 15 25 3.3137 + 0 0 15 26 3.3963 + 0 0 15 27 3.4896 + 0 0 15 28 3.4434 + 0 0 15 29 3.5101 + 0 0 15 30 3.5880 + 0 0 15 31 3.6762 + 0 0 16 0 2.5899 + 0 0 16 1 2.7455 + 0 0 16 2 2.9081 + 0 0 16 3 3.0765 + 0 0 16 4 2.7427 + 0 0 16 5 2.8898 + 0 0 16 6 3.0444 + 0 0 16 7 3.2054 + 0 0 16 8 2.9026 + 0 0 16 9 3.0417 + 0 0 16 10 3.1888 + 0 0 16 11 3.3425 + 0 0 16 12 3.0685 + 0 0 16 13 3.2002 + 0 0 16 14 3.3400 + 0 0 16 15 3.4868 + 0 0 16 16 3.2395 + 0 0 16 17 3.3642 + 0 0 16 18 3.4971 + 0 0 16 19 3.6373 + 0 0 16 20 3.4145 + 0 0 16 21 3.5328 + 0 0 16 22 3.6593 + 0 0 16 23 3.7932 + 0 0 16 24 3.5929 + 0 0 16 25 3.7053 + 0 0 16 26 3.8258 + 0 0 16 27 3.9537 + 0 0 16 28 3.7742 + 0 0 16 29 3.8810 + 0 0 16 30 3.9959 + 0 0 16 31 4.1182 + 0 0 17 0 3.2497 + 0 0 17 1 3.4270 + 0 0 17 2 3.6076 + 0 0 17 3 3.7909 + 0 0 17 4 3.3717 + 0 0 17 5 3.5426 + 0 0 17 6 3.7173 + 0 0 17 7 3.8952 + 0 0 17 8 3.5021 + 0 0 17 9 3.6666 + 0 0 17 10 3.8353 + 0 0 17 11 4.0076 + 0 0 17 12 3.6397 + 0 0 17 13 3.7979 + 0 0 17 14 3.9607 + 0 0 17 15 4.1275 + 0 0 17 16 3.7838 + 0 0 17 17 3.9359 + 0 0 17 18 4.0929 + 0 0 17 19 4.2540 + 0 0 17 20 3.9336 + 0 0 17 21 4.0797 + 0 0 17 22 4.2309 + 0 0 17 23 4.3867 + 0 0 17 24 4.0882 + 0 0 17 25 4.2287 + 0 0 17 26 4.3744 + 0 0 17 27 4.5248 + 0 0 17 28 4.2472 + 0 0 17 29 4.3821 + 0 0 17 30 4.5225 + 0 0 17 31 4.6677 + 0 0 18 0 3.9766 + 0 0 18 1 4.1641 + 0 0 18 2 4.3531 + 0 0 18 3 4.5434 + 0 0 18 4 4.0758 + 0 0 18 5 4.2586 + 0 0 18 6 4.4433 + 0 0 18 7 4.6295 + 0 0 18 8 4.1830 + 0 0 18 9 4.3610 + 0 0 18 10 4.5412 + 0 0 18 11 4.7232 + 0 0 18 12 4.2976 + 0 0 18 13 4.4707 + 0 0 18 14 4.6462 + 0 0 18 15 4.8239 + 0 0 18 16 4.4189 + 0 0 18 17 4.5870 + 0 0 18 18 4.7579 + 0 0 18 19 4.9311 + 0 0 18 20 4.5464 + 0 0 18 21 4.7095 + 0 0 18 22 4.8756 + 0 0 18 23 5.0444 + 0 0 18 24 4.6793 + 0 0 18 25 4.8375 + 0 0 18 26 4.9990 + 0 0 18 27 5.1633 + 0 0 18 28 4.8172 + 0 0 18 29 4.9706 + 0 0 18 30 5.1274 + 0 0 18 31 5.2872 + 0 0 19 0 4.7346 + 0 0 19 1 4.9266 + 0 0 19 2 5.1192 + 0 0 19 3 5.3122 + 0 0 19 4 4.8170 + 0 0 19 5 5.0055 + 0 0 19 6 5.1948 + 0 0 19 7 5.3848 + 0 0 19 8 4.9067 + 0 0 19 9 5.0916 + 0 0 19 10 5.2774 + 0 0 19 11 5.4641 + 0 0 19 12 5.0033 + 0 0 19 13 5.1843 + 0 0 19 14 5.3666 + 0 0 19 15 5.5499 + 0 0 19 16 5.1064 + 0 0 19 17 5.2834 + 0 0 19 18 5.4620 + 0 0 19 19 5.6417 + 0 0 19 20 5.2154 + 0 0 19 21 5.3884 + 0 0 19 22 5.5631 + 0 0 19 23 5.7393 + 0 0 19 24 5.3300 + 0 0 19 25 5.4990 + 0 0 19 26 5.6698 + 0 0 19 27 5.8422 + 0 0 19 28 5.4497 + 0 0 19 29 5.6146 + 0 0 19 30 5.7815 + 0 0 19 31 5.9502 + 0 0 20 0 3.5928 + 0 0 20 1 3.6445 + 0 0 20 2 3.7074 + 0 0 20 3 3.7811 + 0 0 20 4 3.8647 + 0 0 20 5 3.9578 + 0 0 20 6 4.0595 + 0 0 20 7 4.1692 + 0 0 20 8 4.2862 + 0 0 20 9 4.4099 + 0 0 20 10 4.5396 + 0 0 20 11 4.6748 + 0 0 20 12 4.8150 + 0 0 20 13 4.9597 + 0 0 20 14 5.1083 + 0 0 20 15 5.2605 + 0 0 20 16 5.4159 + 0 0 20 17 5.5742 + 0 0 20 18 5.7350 + 0 0 20 19 5.8979 + 0 0 20 20 6.0629 + 0 0 20 21 6.2295 + 0 0 20 22 0.0000 + 0 0 20 23 0.0000 + 0 0 20 24 0.0000 + 0 0 20 25 0.0000 + 0 0 20 26 0.0000 + 0 0 20 27 0.0000 + 0 0 20 28 0.0000 + 0 0 20 29 0.0000 + 0 0 20 30 0.0000 + 0 0 20 31 0.0000 + 0 0 21 0 3.5928 + 0 0 21 1 3.6445 + 0 0 21 2 3.7074 + 0 0 21 3 3.7811 + 0 0 21 4 3.8647 + 0 0 21 5 3.9578 + 0 0 21 6 4.0595 + 0 0 21 7 4.1692 + 0 0 21 8 4.2862 + 0 0 21 9 4.4099 + 0 0 21 10 4.5396 + 0 0 21 11 4.6748 + 0 0 21 12 4.8150 + 0 0 21 13 4.9597 + 0 0 21 14 5.1083 + 0 0 21 15 5.2605 + 0 0 21 16 5.4159 + 0 0 21 17 5.5742 + 0 0 21 18 5.7350 + 0 0 21 19 5.8979 + 0 0 21 20 6.0629 + 0 0 21 21 6.2295 + 0 0 21 22 0.0000 + 0 0 21 23 0.0000 + 0 0 21 24 0.0000 + 0 0 21 25 0.0000 + 0 0 21 26 0.0000 + 0 0 21 27 0.0000 + 0 0 21 28 0.0000 + 0 0 21 29 0.0000 + 0 0 21 30 0.0000 + 0 0 21 31 0.0000 + 0 0 22 0 3.3886 + 0 0 22 1 3.1844 + 0 0 22 2 2.9807 + 0 0 22 3 2.7774 + 0 0 22 4 2.5751 + 0 0 22 5 2.3739 + 0 0 22 6 2.1744 + 0 0 22 7 1.9773 + 0 0 22 8 1.7836 + 0 0 22 9 1.5945 + 0 0 22 10 1.4121 + 0 0 22 11 1.2396 + 0 0 22 12 1.0818 + 0 0 22 13 0.9461 + 0 0 22 14 0.8437 + 0 0 22 15 0.7874 + 0 0 22 16 0.7874 + 0 0 22 17 0.8437 + 0 0 22 18 0.9461 + 0 0 22 19 1.0818 + 0 0 22 20 1.2396 + 0 0 22 21 1.4121 + 0 0 22 22 1.5945 + 0 0 22 23 1.7836 + 0 0 22 24 1.9773 + 0 0 22 25 2.1744 + 0 0 22 26 2.3739 + 0 0 22 27 2.5751 + 0 0 22 28 2.7774 + 0 0 22 29 2.9807 + 0 0 22 30 3.1844 + 0 0 22 31 3.3886 + 0 0 23 0 6.1204 + 0 0 23 1 6.0160 + 0 0 23 2 5.9166 + 0 0 23 3 5.8225 + 0 0 23 4 5.7340 + 0 0 23 5 5.6514 + 0 0 23 6 5.5752 + 0 0 23 7 5.5054 + 0 0 23 8 5.4426 + 0 0 23 9 5.3869 + 0 0 23 10 5.3387 + 0 0 23 11 5.2981 + 0 0 23 12 5.2653 + 0 0 23 13 5.2406 + 0 0 23 14 5.2241 + 0 0 23 15 5.2158 + 0 0 23 16 5.2158 + 0 0 23 17 5.2241 + 0 0 23 18 5.2406 + 0 0 23 19 5.2653 + 0 0 23 20 5.2981 + 0 0 23 21 5.3387 + 0 0 23 22 5.3869 + 0 0 23 23 5.4426 + 0 0 23 24 5.5054 + 0 0 23 25 5.5752 + 0 0 23 26 5.6514 + 0 0 23 27 5.7340 + 0 0 23 28 5.8225 + 0 0 23 29 5.9166 + 0 0 23 30 6.0160 + 0 0 23 31 6.1204 + 0 1 0 0 3.4434 + 0 1 0 1 3.5101 + 0 1 0 2 3.5880 + 0 1 0 3 3.6762 + 0 1 0 4 3.2428 + 0 1 0 5 3.3137 + 0 1 0 6 3.3963 + 0 1 0 7 3.4896 + 0 1 0 8 3.0431 + 0 1 0 9 3.1186 + 0 1 0 10 3.2064 + 0 1 0 11 3.3054 + 0 1 0 12 2.8444 + 0 1 0 13 2.9253 + 0 1 0 14 3.0188 + 0 1 0 15 3.1240 + 0 1 0 16 2.6473 + 0 1 0 17 2.7341 + 0 1 0 18 2.8342 + 0 1 0 19 2.9461 + 0 1 0 20 2.4521 + 0 1 0 21 2.5458 + 0 1 0 22 2.6531 + 0 1 0 23 2.7726 + 0 1 0 24 2.2597 + 0 1 0 25 2.3611 + 0 1 0 26 2.4767 + 0 1 0 27 2.6044 + 0 1 0 28 2.0708 + 0 1 0 29 2.1812 + 0 1 0 30 2.3059 + 0 1 0 31 2.4429 + 0 1 1 0 3.7742 + 0 1 1 1 3.8810 + 0 1 1 2 3.9959 + 0 1 1 3 4.1182 + 0 1 1 4 3.5929 + 0 1 1 5 3.7053 + 0 1 1 6 3.8258 + 0 1 1 7 3.9537 + 0 1 1 8 3.4145 + 0 1 1 9 3.5328 + 0 1 1 10 3.6593 + 0 1 1 11 3.7932 + 0 1 1 12 3.2395 + 0 1 1 13 3.3642 + 0 1 1 14 3.4971 + 0 1 1 15 3.6373 + 0 1 1 16 3.0685 + 0 1 1 17 3.2002 + 0 1 1 18 3.3400 + 0 1 1 19 3.4868 + 0 1 1 20 2.9026 + 0 1 1 21 3.0417 + 0 1 1 22 3.1888 + 0 1 1 23 3.3425 + 0 1 1 24 2.7427 + 0 1 1 25 2.8898 + 0 1 1 26 3.0444 + 0 1 1 27 3.2054 + 0 1 1 28 2.5899 + 0 1 1 29 2.7455 + 0 1 1 30 2.9081 + 0 1 1 31 3.0765 + 0 1 2 0 4.2472 + 0 1 2 1 4.3821 + 0 1 2 2 4.5225 + 0 1 2 3 4.6677 + 0 1 2 4 4.0882 + 0 1 2 5 4.2287 + 0 1 2 6 4.3744 + 0 1 2 7 4.5248 + 0 1 2 8 3.9336 + 0 1 2 9 4.0797 + 0 1 2 10 4.2309 + 0 1 2 11 4.3867 + 0 1 2 12 3.7838 + 0 1 2 13 3.9359 + 0 1 2 14 4.0929 + 0 1 2 15 4.2540 + 0 1 2 16 3.6397 + 0 1 2 17 3.7979 + 0 1 2 18 3.9607 + 0 1 2 19 4.1275 + 0 1 2 20 3.5021 + 0 1 2 21 3.6666 + 0 1 2 22 3.8353 + 0 1 2 23 4.0076 + 0 1 2 24 3.3717 + 0 1 2 25 3.5426 + 0 1 2 26 3.7173 + 0 1 2 27 3.8952 + 0 1 2 28 3.2497 + 0 1 2 29 3.4270 + 0 1 2 30 3.6076 + 0 1 2 31 3.7909 + 0 1 3 0 4.8172 + 0 1 3 1 4.9706 + 0 1 3 2 5.1274 + 0 1 3 3 5.2872 + 0 1 3 4 4.6793 + 0 1 3 5 4.8375 + 0 1 3 6 4.9990 + 0 1 3 7 5.1633 + 0 1 3 8 4.5464 + 0 1 3 9 4.7095 + 0 1 3 10 4.8756 + 0 1 3 11 5.0444 + 0 1 3 12 4.4189 + 0 1 3 13 4.5870 + 0 1 3 14 4.7579 + 0 1 3 15 4.9311 + 0 1 3 16 4.2976 + 0 1 3 17 4.4707 + 0 1 3 18 4.6462 + 0 1 3 19 4.8239 + 0 1 3 20 4.1830 + 0 1 3 21 4.3610 + 0 1 3 22 4.5412 + 0 1 3 23 4.7232 + 0 1 3 24 4.0758 + 0 1 3 25 4.2586 + 0 1 3 26 4.4433 + 0 1 3 27 4.6295 + 0 1 3 28 3.9766 + 0 1 3 29 4.1641 + 0 1 3 30 4.3531 + 0 1 3 31 4.5434 + 0 1 4 0 5.4497 + 0 1 4 1 5.6146 + 0 1 4 2 5.7815 + 0 1 4 3 5.9502 + 0 1 4 4 5.3300 + 0 1 4 5 5.4990 + 0 1 4 6 5.6698 + 0 1 4 7 5.8422 + 0 1 4 8 5.2154 + 0 1 4 9 5.3884 + 0 1 4 10 5.5631 + 0 1 4 11 5.7393 + 0 1 4 12 5.1064 + 0 1 4 13 5.2834 + 0 1 4 14 5.4620 + 0 1 4 15 5.6417 + 0 1 4 16 5.0033 + 0 1 4 17 5.1843 + 0 1 4 18 5.3666 + 0 1 4 19 5.5499 + 0 1 4 20 4.9067 + 0 1 4 21 5.0916 + 0 1 4 22 5.2774 + 0 1 4 23 5.4641 + 0 1 4 24 4.8170 + 0 1 4 25 5.0055 + 0 1 4 26 5.1948 + 0 1 4 27 5.3848 + 0 1 4 28 4.7346 + 0 1 4 29 4.9266 + 0 1 4 30 5.1192 + 0 1 4 31 5.3122 + 0 1 5 0 1.8868 + 0 1 5 1 2.0074 + 0 1 5 2 2.1425 + 0 1 5 3 2.2894 + 0 1 5 4 1.7092 + 0 1 5 5 1.8416 + 0 1 5 6 1.9882 + 0 1 5 7 2.1458 + 0 1 5 8 1.5406 + 0 1 5 9 1.6864 + 0 1 5 10 1.8454 + 0 1 5 11 2.0145 + 0 1 5 12 1.3842 + 0 1 5 13 1.5450 + 0 1 5 14 1.7173 + 0 1 5 15 1.8979 + 0 1 5 16 1.2450 + 0 1 5 17 1.4217 + 0 1 5 18 1.6073 + 0 1 5 19 1.7992 + 0 1 5 20 1.1292 + 0 1 5 21 1.3215 + 0 1 5 22 1.5196 + 0 1 5 23 1.7213 + 0 1 5 24 1.0449 + 0 1 5 25 1.2503 + 0 1 5 26 1.4581 + 0 1 5 27 1.6673 + 0 1 5 28 1.0000 + 0 1 5 29 1.2131 + 0 1 5 30 1.4264 + 0 1 5 31 1.6397 + 0 1 6 0 2.4459 + 0 1 6 1 2.6103 + 0 1 6 2 2.7810 + 0 1 6 3 2.9569 + 0 1 6 4 2.3123 + 0 1 6 5 2.4857 + 0 1 6 6 2.6647 + 0 1 6 7 2.8480 + 0 1 6 8 2.1911 + 0 1 6 9 2.3736 + 0 1 6 10 2.5606 + 0 1 6 11 2.7511 + 0 1 6 12 2.0846 + 0 1 6 13 2.2758 + 0 1 6 14 2.4704 + 0 1 6 15 2.6675 + 0 1 6 16 1.9953 + 0 1 6 17 2.1944 + 0 1 6 18 2.3957 + 0 1 6 19 2.5987 + 0 1 6 20 1.9254 + 0 1 6 21 2.1312 + 0 1 6 22 2.3381 + 0 1 6 23 2.5458 + 0 1 6 24 1.8774 + 0 1 6 25 2.0880 + 0 1 6 26 2.2989 + 0 1 6 27 2.5098 + 0 1 6 28 1.8530 + 0 1 6 29 2.0661 + 0 1 6 30 2.2790 + 0 1 6 31 2.4917 + 0 1 7 0 3.1370 + 0 1 7 1 3.3206 + 0 1 7 2 3.5070 + 0 1 7 3 3.6956 + 0 1 7 4 3.0348 + 0 1 7 5 3.2245 + 0 1 7 6 3.4163 + 0 1 7 7 3.6100 + 0 1 7 8 2.9443 + 0 1 7 9 3.1396 + 0 1 7 10 3.3366 + 0 1 7 11 3.5348 + 0 1 7 12 2.8665 + 0 1 7 13 3.0670 + 0 1 7 14 3.2686 + 0 1 7 15 3.4709 + 0 1 7 16 2.8027 + 0 1 7 17 3.0076 + 0 1 7 18 3.2130 + 0 1 7 19 3.4188 + 0 1 7 20 2.7539 + 0 1 7 21 2.9622 + 0 1 7 22 3.1707 + 0 1 7 23 3.3792 + 0 1 7 24 2.7208 + 0 1 7 25 2.9316 + 0 1 7 26 3.1422 + 0 1 7 27 3.3525 + 0 1 7 28 2.7041 + 0 1 7 29 2.9161 + 0 1 7 30 3.1278 + 0 1 7 31 3.3391 + 0 1 8 0 3.8861 + 0 1 8 1 4.0781 + 0 1 8 2 4.2712 + 0 1 8 3 4.4653 + 0 1 8 4 3.8050 + 0 1 8 5 4.0011 + 0 1 8 6 4.1981 + 0 1 8 7 4.3957 + 0 1 8 8 3.7340 + 0 1 8 9 3.9339 + 0 1 8 10 4.1343 + 0 1 8 11 4.3350 + 0 1 8 12 3.6737 + 0 1 8 13 3.8769 + 0 1 8 14 4.0803 + 0 1 8 15 4.2838 + 0 1 8 16 3.6247 + 0 1 8 17 3.8307 + 0 1 8 18 4.0366 + 0 1 8 19 4.2423 + 0 1 8 20 3.5875 + 0 1 8 21 3.7956 + 0 1 8 22 4.0034 + 0 1 8 23 4.2109 + 0 1 8 24 3.5625 + 0 1 8 25 3.7720 + 0 1 8 26 3.9812 + 0 1 8 27 4.1898 + 0 1 8 28 3.5499 + 0 1 8 29 3.7602 + 0 1 8 30 3.9700 + 0 1 8 31 4.1792 + 0 1 9 0 4.6600 + 0 1 9 1 4.8553 + 0 1 9 2 5.0509 + 0 1 9 3 5.2467 + 0 1 9 4 4.5937 + 0 1 9 5 4.7919 + 0 1 9 6 4.9903 + 0 1 9 7 5.1887 + 0 1 9 8 4.5359 + 0 1 9 9 4.7368 + 0 1 9 10 4.9377 + 0 1 9 11 5.1383 + 0 1 9 12 4.4872 + 0 1 9 13 4.6904 + 0 1 9 14 4.8933 + 0 1 9 15 5.0959 + 0 1 9 16 4.4477 + 0 1 9 17 4.6528 + 0 1 9 18 4.8575 + 0 1 9 19 5.0617 + 0 1 9 20 4.4179 + 0 1 9 21 4.6244 + 0 1 9 22 4.8304 + 0 1 9 23 5.0358 + 0 1 9 24 4.3979 + 0 1 9 25 4.6054 + 0 1 9 26 4.8123 + 0 1 9 27 5.0185 + 0 1 9 28 4.3878 + 0 1 9 29 4.5959 + 0 1 9 30 4.8032 + 0 1 9 31 5.0099 + 0 1 10 0 1.0000 + 0 1 10 1 1.2131 + 0 1 10 2 1.4264 + 0 1 10 3 1.6397 + 0 1 10 4 1.0449 + 0 1 10 5 1.2503 + 0 1 10 6 1.4581 + 0 1 10 7 1.6673 + 0 1 10 8 1.1292 + 0 1 10 9 1.3215 + 0 1 10 10 1.5196 + 0 1 10 11 1.7213 + 0 1 10 12 1.2450 + 0 1 10 13 1.4217 + 0 1 10 14 1.6073 + 0 1 10 15 1.7992 + 0 1 10 16 1.3842 + 0 1 10 17 1.5450 + 0 1 10 18 1.7173 + 0 1 10 19 1.8979 + 0 1 10 20 1.5406 + 0 1 10 21 1.6864 + 0 1 10 22 1.8454 + 0 1 10 23 2.0145 + 0 1 10 24 1.7092 + 0 1 10 25 1.8416 + 0 1 10 26 1.9882 + 0 1 10 27 2.1458 + 0 1 10 28 1.8868 + 0 1 10 29 2.0074 + 0 1 10 30 2.1425 + 0 1 10 31 2.2894 + 0 1 11 0 1.8530 + 0 1 11 1 2.0661 + 0 1 11 2 2.2790 + 0 1 11 3 2.4917 + 0 1 11 4 1.8774 + 0 1 11 5 2.0880 + 0 1 11 6 2.2989 + 0 1 11 7 2.5098 + 0 1 11 8 1.9254 + 0 1 11 9 2.1312 + 0 1 11 10 2.3381 + 0 1 11 11 2.5458 + 0 1 11 12 1.9953 + 0 1 11 13 2.1944 + 0 1 11 14 2.3957 + 0 1 11 15 2.5987 + 0 1 11 16 2.0846 + 0 1 11 17 2.2758 + 0 1 11 18 2.4704 + 0 1 11 19 2.6675 + 0 1 11 20 2.1911 + 0 1 11 21 2.3736 + 0 1 11 22 2.5606 + 0 1 11 23 2.7511 + 0 1 11 24 2.3123 + 0 1 11 25 2.4857 + 0 1 11 26 2.6647 + 0 1 11 27 2.8480 + 0 1 11 28 2.4459 + 0 1 11 29 2.6103 + 0 1 11 30 2.7810 + 0 1 11 31 2.9569 + 0 1 12 0 2.7041 + 0 1 12 1 2.9161 + 0 1 12 2 3.1278 + 0 1 12 3 3.3391 + 0 1 12 4 2.7208 + 0 1 12 5 2.9316 + 0 1 12 6 3.1422 + 0 1 12 7 3.3525 + 0 1 12 8 2.7539 + 0 1 12 9 2.9622 + 0 1 12 10 3.1707 + 0 1 12 11 3.3792 + 0 1 12 12 2.8027 + 0 1 12 13 3.0076 + 0 1 12 14 3.2130 + 0 1 12 15 3.4188 + 0 1 12 16 2.8665 + 0 1 12 17 3.0670 + 0 1 12 18 3.2686 + 0 1 12 19 3.4709 + 0 1 12 20 2.9443 + 0 1 12 21 3.1396 + 0 1 12 22 3.3366 + 0 1 12 23 3.5348 + 0 1 12 24 3.0348 + 0 1 12 25 3.2245 + 0 1 12 26 3.4163 + 0 1 12 27 3.6100 + 0 1 12 28 3.1370 + 0 1 12 29 3.3206 + 0 1 12 30 3.5070 + 0 1 12 31 3.6956 + 0 1 13 0 3.5499 + 0 1 13 1 3.7602 + 0 1 13 2 3.9700 + 0 1 13 3 4.1792 + 0 1 13 4 3.5625 + 0 1 13 5 3.7720 + 0 1 13 6 3.9812 + 0 1 13 7 4.1898 + 0 1 13 8 3.5875 + 0 1 13 9 3.7956 + 0 1 13 10 4.0034 + 0 1 13 11 4.2109 + 0 1 13 12 3.6247 + 0 1 13 13 3.8307 + 0 1 13 14 4.0366 + 0 1 13 15 4.2423 + 0 1 13 16 3.6737 + 0 1 13 17 3.8769 + 0 1 13 18 4.0803 + 0 1 13 19 4.2838 + 0 1 13 20 3.7340 + 0 1 13 21 3.9339 + 0 1 13 22 4.1343 + 0 1 13 23 4.3350 + 0 1 13 24 3.8050 + 0 1 13 25 4.0011 + 0 1 13 26 4.1981 + 0 1 13 27 4.3957 + 0 1 13 28 3.8861 + 0 1 13 29 4.0781 + 0 1 13 30 4.2712 + 0 1 13 31 4.4653 + 0 1 14 0 4.3878 + 0 1 14 1 4.5959 + 0 1 14 2 4.8032 + 0 1 14 3 5.0099 + 0 1 14 4 4.3979 + 0 1 14 5 4.6054 + 0 1 14 6 4.8123 + 0 1 14 7 5.0185 + 0 1 14 8 4.4179 + 0 1 14 9 4.6244 + 0 1 14 10 4.8304 + 0 1 14 11 5.0358 + 0 1 14 12 4.4477 + 0 1 14 13 4.6528 + 0 1 14 14 4.8575 + 0 1 14 15 5.0617 + 0 1 14 16 4.4872 + 0 1 14 17 4.6904 + 0 1 14 18 4.8933 + 0 1 14 19 5.0959 + 0 1 14 20 4.5359 + 0 1 14 21 4.7368 + 0 1 14 22 4.9377 + 0 1 14 23 5.1383 + 0 1 14 24 4.5937 + 0 1 14 25 4.7919 + 0 1 14 26 4.9903 + 0 1 14 27 5.1887 + 0 1 14 28 4.6600 + 0 1 14 29 4.8553 + 0 1 14 30 5.0509 + 0 1 14 31 5.2467 + 0 1 15 0 2.0708 + 0 1 15 1 2.1812 + 0 1 15 2 2.3059 + 0 1 15 3 2.4429 + 0 1 15 4 2.2597 + 0 1 15 5 2.3611 + 0 1 15 6 2.4767 + 0 1 15 7 2.6044 + 0 1 15 8 2.4521 + 0 1 15 9 2.5458 + 0 1 15 10 2.6531 + 0 1 15 11 2.7726 + 0 1 15 12 2.6473 + 0 1 15 13 2.7341 + 0 1 15 14 2.8342 + 0 1 15 15 2.9461 + 0 1 15 16 2.8444 + 0 1 15 17 2.9253 + 0 1 15 18 3.0188 + 0 1 15 19 3.1240 + 0 1 15 20 3.0431 + 0 1 15 21 3.1186 + 0 1 15 22 3.2064 + 0 1 15 23 3.3054 + 0 1 15 24 3.2428 + 0 1 15 25 3.3137 + 0 1 15 26 3.3963 + 0 1 15 27 3.4896 + 0 1 15 28 3.4434 + 0 1 15 29 3.5101 + 0 1 15 30 3.5880 + 0 1 15 31 3.6762 + 0 1 16 0 2.5899 + 0 1 16 1 2.7455 + 0 1 16 2 2.9081 + 0 1 16 3 3.0765 + 0 1 16 4 2.7427 + 0 1 16 5 2.8898 + 0 1 16 6 3.0444 + 0 1 16 7 3.2054 + 0 1 16 8 2.9026 + 0 1 16 9 3.0417 + 0 1 16 10 3.1888 + 0 1 16 11 3.3425 + 0 1 16 12 3.0685 + 0 1 16 13 3.2002 + 0 1 16 14 3.3400 + 0 1 16 15 3.4868 + 0 1 16 16 3.2395 + 0 1 16 17 3.3642 + 0 1 16 18 3.4971 + 0 1 16 19 3.6373 + 0 1 16 20 3.4145 + 0 1 16 21 3.5328 + 0 1 16 22 3.6593 + 0 1 16 23 3.7932 + 0 1 16 24 3.5929 + 0 1 16 25 3.7053 + 0 1 16 26 3.8258 + 0 1 16 27 3.9537 + 0 1 16 28 3.7742 + 0 1 16 29 3.8810 + 0 1 16 30 3.9959 + 0 1 16 31 4.1182 + 0 1 17 0 3.2497 + 0 1 17 1 3.4270 + 0 1 17 2 3.6076 + 0 1 17 3 3.7909 + 0 1 17 4 3.3717 + 0 1 17 5 3.5426 + 0 1 17 6 3.7173 + 0 1 17 7 3.8952 + 0 1 17 8 3.5021 + 0 1 17 9 3.6666 + 0 1 17 10 3.8353 + 0 1 17 11 4.0076 + 0 1 17 12 3.6397 + 0 1 17 13 3.7979 + 0 1 17 14 3.9607 + 0 1 17 15 4.1275 + 0 1 17 16 3.7838 + 0 1 17 17 3.9359 + 0 1 17 18 4.0929 + 0 1 17 19 4.2540 + 0 1 17 20 3.9336 + 0 1 17 21 4.0797 + 0 1 17 22 4.2309 + 0 1 17 23 4.3867 + 0 1 17 24 4.0882 + 0 1 17 25 4.2287 + 0 1 17 26 4.3744 + 0 1 17 27 4.5248 + 0 1 17 28 4.2472 + 0 1 17 29 4.3821 + 0 1 17 30 4.5225 + 0 1 17 31 4.6677 + 0 1 18 0 3.9766 + 0 1 18 1 4.1641 + 0 1 18 2 4.3531 + 0 1 18 3 4.5434 + 0 1 18 4 4.0758 + 0 1 18 5 4.2586 + 0 1 18 6 4.4433 + 0 1 18 7 4.6295 + 0 1 18 8 4.1830 + 0 1 18 9 4.3610 + 0 1 18 10 4.5412 + 0 1 18 11 4.7232 + 0 1 18 12 4.2976 + 0 1 18 13 4.4707 + 0 1 18 14 4.6462 + 0 1 18 15 4.8239 + 0 1 18 16 4.4189 + 0 1 18 17 4.5870 + 0 1 18 18 4.7579 + 0 1 18 19 4.9311 + 0 1 18 20 4.5464 + 0 1 18 21 4.7095 + 0 1 18 22 4.8756 + 0 1 18 23 5.0444 + 0 1 18 24 4.6793 + 0 1 18 25 4.8375 + 0 1 18 26 4.9990 + 0 1 18 27 5.1633 + 0 1 18 28 4.8172 + 0 1 18 29 4.9706 + 0 1 18 30 5.1274 + 0 1 18 31 5.2872 + 0 1 19 0 4.7346 + 0 1 19 1 4.9266 + 0 1 19 2 5.1192 + 0 1 19 3 5.3122 + 0 1 19 4 4.8170 + 0 1 19 5 5.0055 + 0 1 19 6 5.1948 + 0 1 19 7 5.3848 + 0 1 19 8 4.9067 + 0 1 19 9 5.0916 + 0 1 19 10 5.2774 + 0 1 19 11 5.4641 + 0 1 19 12 5.0033 + 0 1 19 13 5.1843 + 0 1 19 14 5.3666 + 0 1 19 15 5.5499 + 0 1 19 16 5.1064 + 0 1 19 17 5.2834 + 0 1 19 18 5.4620 + 0 1 19 19 5.6417 + 0 1 19 20 5.2154 + 0 1 19 21 5.3884 + 0 1 19 22 5.5631 + 0 1 19 23 5.7393 + 0 1 19 24 5.3300 + 0 1 19 25 5.4990 + 0 1 19 26 5.6698 + 0 1 19 27 5.8422 + 0 1 19 28 5.4497 + 0 1 19 29 5.6146 + 0 1 19 30 5.7815 + 0 1 19 31 5.9502 + 0 1 20 0 3.5928 + 0 1 20 1 3.6445 + 0 1 20 2 3.7074 + 0 1 20 3 3.7811 + 0 1 20 4 3.8647 + 0 1 20 5 3.9578 + 0 1 20 6 4.0595 + 0 1 20 7 4.1692 + 0 1 20 8 4.2862 + 0 1 20 9 4.4099 + 0 1 20 10 4.5396 + 0 1 20 11 4.6748 + 0 1 20 12 4.8150 + 0 1 20 13 4.9597 + 0 1 20 14 5.1083 + 0 1 20 15 5.2605 + 0 1 20 16 5.4159 + 0 1 20 17 5.5742 + 0 1 20 18 5.7350 + 0 1 20 19 5.8979 + 0 1 20 20 6.0629 + 0 1 20 21 6.2295 + 0 1 20 22 0.0000 + 0 1 20 23 0.0000 + 0 1 20 24 0.0000 + 0 1 20 25 0.0000 + 0 1 20 26 0.0000 + 0 1 20 27 0.0000 + 0 1 20 28 0.0000 + 0 1 20 29 0.0000 + 0 1 20 30 0.0000 + 0 1 20 31 0.0000 + 0 1 21 0 3.5928 + 0 1 21 1 3.6445 + 0 1 21 2 3.7074 + 0 1 21 3 3.7811 + 0 1 21 4 3.8647 + 0 1 21 5 3.9578 + 0 1 21 6 4.0595 + 0 1 21 7 4.1692 + 0 1 21 8 4.2862 + 0 1 21 9 4.4099 + 0 1 21 10 4.5396 + 0 1 21 11 4.6748 + 0 1 21 12 4.8150 + 0 1 21 13 4.9597 + 0 1 21 14 5.1083 + 0 1 21 15 5.2605 + 0 1 21 16 5.4159 + 0 1 21 17 5.5742 + 0 1 21 18 5.7350 + 0 1 21 19 5.8979 + 0 1 21 20 6.0629 + 0 1 21 21 6.2295 + 0 1 21 22 0.0000 + 0 1 21 23 0.0000 + 0 1 21 24 0.0000 + 0 1 21 25 0.0000 + 0 1 21 26 0.0000 + 0 1 21 27 0.0000 + 0 1 21 28 0.0000 + 0 1 21 29 0.0000 + 0 1 21 30 0.0000 + 0 1 21 31 0.0000 + 0 1 22 0 3.3886 + 0 1 22 1 3.1844 + 0 1 22 2 2.9807 + 0 1 22 3 2.7774 + 0 1 22 4 2.5751 + 0 1 22 5 2.3739 + 0 1 22 6 2.1744 + 0 1 22 7 1.9773 + 0 1 22 8 1.7836 + 0 1 22 9 1.5945 + 0 1 22 10 1.4121 + 0 1 22 11 1.2396 + 0 1 22 12 1.0818 + 0 1 22 13 0.9461 + 0 1 22 14 0.8437 + 0 1 22 15 0.7874 + 0 1 22 16 0.7874 + 0 1 22 17 0.8437 + 0 1 22 18 0.9461 + 0 1 22 19 1.0818 + 0 1 22 20 1.2396 + 0 1 22 21 1.4121 + 0 1 22 22 1.5945 + 0 1 22 23 1.7836 + 0 1 22 24 1.9773 + 0 1 22 25 2.1744 + 0 1 22 26 2.3739 + 0 1 22 27 2.5751 + 0 1 22 28 2.7774 + 0 1 22 29 2.9807 + 0 1 22 30 3.1844 + 0 1 22 31 3.3886 + 0 1 23 0 6.1204 + 0 1 23 1 6.0160 + 0 1 23 2 5.9166 + 0 1 23 3 5.8225 + 0 1 23 4 5.7340 + 0 1 23 5 5.6514 + 0 1 23 6 5.5752 + 0 1 23 7 5.5054 + 0 1 23 8 5.4426 + 0 1 23 9 5.3869 + 0 1 23 10 5.3387 + 0 1 23 11 5.2981 + 0 1 23 12 5.2653 + 0 1 23 13 5.2406 + 0 1 23 14 5.2241 + 0 1 23 15 5.2158 + 0 1 23 16 5.2158 + 0 1 23 17 5.2241 + 0 1 23 18 5.2406 + 0 1 23 19 5.2653 + 0 1 23 20 5.2981 + 0 1 23 21 5.3387 + 0 1 23 22 5.3869 + 0 1 23 23 5.4426 + 0 1 23 24 5.5054 + 0 1 23 25 5.5752 + 0 1 23 26 5.6514 + 0 1 23 27 5.7340 + 0 1 23 28 5.8225 + 0 1 23 29 5.9166 + 0 1 23 30 6.0160 + 0 1 23 31 6.1204 diff --git a/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_hcal_et_gains.txt b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_hcal_et_gains.txt new file mode 100644 index 00000000000..2c627b2274e --- /dev/null +++ b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/fcs_hcal_et_gains.txt @@ -0,0 +1,577 @@ +#ehp ns dep ch EtGain + 1 0 0 0 3.1326 + 1 0 0 1 3.2777 + 1 0 0 2 3.4618 + 1 0 0 3 3.6788 + 1 0 0 4 2.7612 + 1 0 0 5 2.9251 + 1 0 0 6 3.1306 + 1 0 0 7 3.3698 + 1 0 0 8 2.3959 + 1 0 0 9 2.5835 + 1 0 0 10 2.8146 + 1 0 0 11 3.0791 + 1 0 0 12 2.0408 + 1 0 0 13 2.2585 + 1 0 0 14 2.5201 + 1 0 0 15 2.8131 + 1 0 0 16 1.7033 + 1 0 0 17 1.9592 + 1 0 0 18 2.2563 + 1 0 0 19 2.5800 + 1 0 0 20 1.3970 + 1 0 0 21 1.6999 + 1 0 0 22 2.0356 + 1 0 0 23 2.3898 + 1 0 0 24 1.1478 + 1 0 0 25 1.5021 + 1 0 0 26 1.8738 + 1 0 0 27 2.2540 + 1 0 0 28 1.0000 + 1 0 0 29 1.3926 + 1 0 0 30 1.7874 + 1 0 0 31 2.1828 + 1 0 1 0 3.9231 + 1 0 1 1 4.1895 + 1 0 1 2 4.4737 + 1 0 1 3 4.7722 + 1 0 1 4 3.6357 + 1 0 1 5 3.9227 + 1 0 1 6 4.2259 + 1 0 1 7 4.5418 + 1 0 1 8 3.3689 + 1 0 1 9 3.6776 + 1 0 1 10 4.0005 + 1 0 1 11 4.3339 + 1 0 1 12 3.1284 + 1 0 1 13 3.4594 + 1 0 1 14 3.8017 + 1 0 1 15 4.1520 + 1 0 1 16 2.9212 + 1 0 1 17 3.2739 + 1 0 1 18 3.6344 + 1 0 1 19 4.0001 + 1 0 1 20 2.7552 + 1 0 1 21 3.1272 + 1 0 1 22 3.5034 + 1 0 1 23 3.8820 + 1 0 1 24 2.6385 + 1 0 1 25 3.0253 + 1 0 1 26 3.4131 + 1 0 1 27 3.8011 + 1 0 1 28 2.5782 + 1 0 1 29 2.9730 + 1 0 1 30 3.3670 + 1 0 1 31 3.7600 + 1 0 2 0 5.0820 + 1 0 2 1 5.4007 + 1 0 2 2 5.7264 + 1 0 2 3 6.0575 + 1 0 2 4 4.8675 + 1 0 2 5 5.2006 + 1 0 2 6 5.5394 + 1 0 2 7 5.8823 + 1 0 2 8 4.6751 + 1 0 2 9 5.0220 + 1 0 2 10 5.3731 + 1 0 2 11 5.7271 + 1 0 2 12 4.5079 + 1 0 2 13 4.8677 + 1 0 2 14 5.2301 + 1 0 2 15 5.5942 + 1 0 2 16 4.3691 + 1 0 2 17 4.7403 + 1 0 2 18 5.1125 + 1 0 2 19 5.4851 + 1 0 2 20 4.2619 + 1 0 2 21 4.6422 + 1 0 2 22 5.0223 + 1 0 2 23 5.4018 + 1 0 2 24 4.1887 + 1 0 2 25 4.5755 + 1 0 2 26 4.9612 + 1 0 2 27 5.3454 + 1 0 2 28 4.1516 + 1 0 2 29 4.5418 + 1 0 2 30 4.9303 + 1 0 2 31 5.3169 + 1 0 3 0 1.0000 + 1 0 3 1 1.3926 + 1 0 3 2 1.7874 + 1 0 3 3 2.1828 + 1 0 3 4 1.1478 + 1 0 3 5 1.5021 + 1 0 3 6 1.8738 + 1 0 3 7 2.2540 + 1 0 3 8 1.3970 + 1 0 3 9 1.6999 + 1 0 3 10 2.0356 + 1 0 3 11 2.3898 + 1 0 3 12 1.7033 + 1 0 3 13 1.9592 + 1 0 3 14 2.2563 + 1 0 3 15 2.5800 + 1 0 3 16 2.0408 + 1 0 3 17 2.2585 + 1 0 3 18 2.5201 + 1 0 3 19 2.8131 + 1 0 3 20 2.3959 + 1 0 3 21 2.5835 + 1 0 3 22 2.8146 + 1 0 3 23 3.0791 + 1 0 3 24 2.7612 + 1 0 3 25 2.9251 + 1 0 3 26 3.1306 + 1 0 3 27 3.3698 + 1 0 3 28 3.1326 + 1 0 3 29 3.2777 + 1 0 3 30 3.4618 + 1 0 3 31 3.6788 + 1 0 4 0 2.5782 + 1 0 4 1 2.9730 + 1 0 4 2 3.3670 + 1 0 4 3 3.7600 + 1 0 4 4 2.6385 + 1 0 4 5 3.0253 + 1 0 4 6 3.4131 + 1 0 4 7 3.8011 + 1 0 4 8 2.7552 + 1 0 4 9 3.1272 + 1 0 4 10 3.5034 + 1 0 4 11 3.8820 + 1 0 4 12 2.9212 + 1 0 4 13 3.2739 + 1 0 4 14 3.6344 + 1 0 4 15 4.0001 + 1 0 4 16 3.1284 + 1 0 4 17 3.4594 + 1 0 4 18 3.8017 + 1 0 4 19 4.1520 + 1 0 4 20 3.3689 + 1 0 4 21 3.6776 + 1 0 4 22 4.0005 + 1 0 4 23 4.3339 + 1 0 4 24 3.6357 + 1 0 4 25 3.9227 + 1 0 4 26 4.2259 + 1 0 4 27 4.5418 + 1 0 4 28 3.9231 + 1 0 4 29 4.1895 + 1 0 4 30 4.4737 + 1 0 4 31 4.7722 + 1 0 5 0 4.1516 + 1 0 5 1 4.5418 + 1 0 5 2 4.9303 + 1 0 5 3 5.3169 + 1 0 5 4 4.1887 + 1 0 5 5 4.5755 + 1 0 5 6 4.9612 + 1 0 5 7 5.3454 + 1 0 5 8 4.2619 + 1 0 5 9 4.6422 + 1 0 5 10 5.0223 + 1 0 5 11 5.4018 + 1 0 5 12 4.3691 + 1 0 5 13 4.7403 + 1 0 5 14 5.1125 + 1 0 5 15 5.4851 + 1 0 5 16 4.5079 + 1 0 5 17 4.8677 + 1 0 5 18 5.2301 + 1 0 5 19 5.5942 + 1 0 5 20 4.6751 + 1 0 5 21 5.0220 + 1 0 5 22 5.3731 + 1 0 5 23 5.7271 + 1 0 5 24 4.8675 + 1 0 5 25 5.2006 + 1 0 5 26 5.5394 + 1 0 5 27 5.8823 + 1 0 5 28 5.0820 + 1 0 5 29 5.4007 + 1 0 5 30 5.7264 + 1 0 5 31 6.0575 + 1 0 6 0 3.8848 + 1 0 6 1 4.0020 + 1 0 6 2 4.1530 + 1 0 6 3 4.3342 + 1 0 6 4 3.5077 + 1 0 6 5 3.6375 + 1 0 6 6 3.8036 + 1 0 6 7 4.0015 + 1 0 6 8 4.5417 + 1 0 6 9 4.7718 + 1 0 6 10 5.0210 + 1 0 6 11 5.2864 + 1 0 6 12 4.2263 + 1 0 6 13 4.4737 + 1 0 6 14 4.7398 + 1 0 6 15 5.0214 + 1 0 6 16 5.5652 + 1 0 6 17 5.8551 + 1 0 6 18 6.1542 + 1 0 6 19 6.4607 + 1 0 6 20 5.3155 + 1 0 6 21 5.6197 + 1 0 6 22 5.9321 + 1 0 6 23 6.2510 + 1 0 6 24 0.0000 + 1 0 6 25 0.0000 + 1 0 6 26 0.0000 + 1 0 6 27 0.0000 + 1 0 6 28 0.0000 + 1 0 6 29 0.0000 + 1 0 6 30 0.0000 + 1 0 6 31 0.0000 + 1 0 7 0 3.5077 + 1 0 7 1 3.6375 + 1 0 7 2 3.8036 + 1 0 7 3 4.0015 + 1 0 7 4 3.8848 + 1 0 7 5 4.0020 + 1 0 7 6 4.1530 + 1 0 7 7 4.3342 + 1 0 7 8 4.2263 + 1 0 7 9 4.4737 + 1 0 7 10 4.7398 + 1 0 7 11 5.0214 + 1 0 7 12 4.5417 + 1 0 7 13 4.7718 + 1 0 7 14 5.0210 + 1 0 7 15 5.2864 + 1 0 7 16 5.3155 + 1 0 7 17 5.6197 + 1 0 7 18 5.9321 + 1 0 7 19 6.2510 + 1 0 7 20 5.5652 + 1 0 7 21 5.8551 + 1 0 7 22 6.1542 + 1 0 7 23 6.4607 + 1 0 7 24 0.0000 + 1 0 7 25 0.0000 + 1 0 7 26 0.0000 + 1 0 7 27 0.0000 + 1 0 7 28 0.0000 + 1 0 7 29 0.0000 + 1 0 7 30 0.0000 + 1 0 7 31 0.0000 + 1 0 8 0 6.7731 + 1 0 8 1 6.5750 + 1 0 8 2 6.3927 + 1 0 8 3 6.2282 + 1 0 8 4 6.0830 + 1 0 8 5 5.9589 + 1 0 8 6 5.8575 + 1 0 8 7 5.7801 + 1 0 8 8 5.7278 + 1 0 8 9 5.7015 + 1 0 8 10 5.7015 + 1 0 8 11 5.7278 + 1 0 8 12 5.7801 + 1 0 8 13 5.8575 + 1 0 8 14 5.9589 + 1 0 8 15 6.0830 + 1 0 8 16 6.2282 + 1 0 8 17 6.3927 + 1 0 8 18 6.5750 + 1 0 8 19 6.7731 + 1 0 8 20 0.0000 + 1 0 8 21 0.0000 + 1 0 8 22 0.0000 + 1 0 8 23 0.0000 + 1 0 8 24 0.0000 + 1 0 8 25 0.0000 + 1 0 8 26 0.0000 + 1 0 8 27 0.0000 + 1 0 8 28 0.0000 + 1 0 8 29 0.0000 + 1 0 8 30 0.0000 + 1 0 8 31 0.0000 + 1 1 0 0 3.1326 + 1 1 0 1 3.2777 + 1 1 0 2 3.4618 + 1 1 0 3 3.6788 + 1 1 0 4 2.7612 + 1 1 0 5 2.9251 + 1 1 0 6 3.1306 + 1 1 0 7 3.3698 + 1 1 0 8 2.3959 + 1 1 0 9 2.5835 + 1 1 0 10 2.8146 + 1 1 0 11 3.0791 + 1 1 0 12 2.0408 + 1 1 0 13 2.2585 + 1 1 0 14 2.5201 + 1 1 0 15 2.8131 + 1 1 0 16 1.7033 + 1 1 0 17 1.9592 + 1 1 0 18 2.2563 + 1 1 0 19 2.5800 + 1 1 0 20 1.3970 + 1 1 0 21 1.6999 + 1 1 0 22 2.0356 + 1 1 0 23 2.3898 + 1 1 0 24 1.1478 + 1 1 0 25 1.5021 + 1 1 0 26 1.8738 + 1 1 0 27 2.2540 + 1 1 0 28 1.0000 + 1 1 0 29 1.3926 + 1 1 0 30 1.7874 + 1 1 0 31 2.1828 + 1 1 1 0 3.9231 + 1 1 1 1 4.1895 + 1 1 1 2 4.4737 + 1 1 1 3 4.7722 + 1 1 1 4 3.6357 + 1 1 1 5 3.9227 + 1 1 1 6 4.2259 + 1 1 1 7 4.5418 + 1 1 1 8 3.3689 + 1 1 1 9 3.6776 + 1 1 1 10 4.0005 + 1 1 1 11 4.3339 + 1 1 1 12 3.1284 + 1 1 1 13 3.4594 + 1 1 1 14 3.8017 + 1 1 1 15 4.1520 + 1 1 1 16 2.9212 + 1 1 1 17 3.2739 + 1 1 1 18 3.6344 + 1 1 1 19 4.0001 + 1 1 1 20 2.7552 + 1 1 1 21 3.1272 + 1 1 1 22 3.5034 + 1 1 1 23 3.8820 + 1 1 1 24 2.6385 + 1 1 1 25 3.0253 + 1 1 1 26 3.4131 + 1 1 1 27 3.8011 + 1 1 1 28 2.5782 + 1 1 1 29 2.9730 + 1 1 1 30 3.3670 + 1 1 1 31 3.7600 + 1 1 2 0 5.0820 + 1 1 2 1 5.4007 + 1 1 2 2 5.7264 + 1 1 2 3 6.0575 + 1 1 2 4 4.8675 + 1 1 2 5 5.2006 + 1 1 2 6 5.5394 + 1 1 2 7 5.8823 + 1 1 2 8 4.6751 + 1 1 2 9 5.0220 + 1 1 2 10 5.3731 + 1 1 2 11 5.7271 + 1 1 2 12 4.5079 + 1 1 2 13 4.8677 + 1 1 2 14 5.2301 + 1 1 2 15 5.5942 + 1 1 2 16 4.3691 + 1 1 2 17 4.7403 + 1 1 2 18 5.1125 + 1 1 2 19 5.4851 + 1 1 2 20 4.2619 + 1 1 2 21 4.6422 + 1 1 2 22 5.0223 + 1 1 2 23 5.4018 + 1 1 2 24 4.1887 + 1 1 2 25 4.5755 + 1 1 2 26 4.9612 + 1 1 2 27 5.3454 + 1 1 2 28 4.1516 + 1 1 2 29 4.5418 + 1 1 2 30 4.9303 + 1 1 2 31 5.3169 + 1 1 3 0 1.0000 + 1 1 3 1 1.3926 + 1 1 3 2 1.7874 + 1 1 3 3 2.1828 + 1 1 3 4 1.1478 + 1 1 3 5 1.5021 + 1 1 3 6 1.8738 + 1 1 3 7 2.2540 + 1 1 3 8 1.3970 + 1 1 3 9 1.6999 + 1 1 3 10 2.0356 + 1 1 3 11 2.3898 + 1 1 3 12 1.7033 + 1 1 3 13 1.9592 + 1 1 3 14 2.2563 + 1 1 3 15 2.5800 + 1 1 3 16 2.0408 + 1 1 3 17 2.2585 + 1 1 3 18 2.5201 + 1 1 3 19 2.8131 + 1 1 3 20 2.3959 + 1 1 3 21 2.5835 + 1 1 3 22 2.8146 + 1 1 3 23 3.0791 + 1 1 3 24 2.7612 + 1 1 3 25 2.9251 + 1 1 3 26 3.1306 + 1 1 3 27 3.3698 + 1 1 3 28 3.1326 + 1 1 3 29 3.2777 + 1 1 3 30 3.4618 + 1 1 3 31 3.6788 + 1 1 4 0 2.5782 + 1 1 4 1 2.9730 + 1 1 4 2 3.3670 + 1 1 4 3 3.7600 + 1 1 4 4 2.6385 + 1 1 4 5 3.0253 + 1 1 4 6 3.4131 + 1 1 4 7 3.8011 + 1 1 4 8 2.7552 + 1 1 4 9 3.1272 + 1 1 4 10 3.5034 + 1 1 4 11 3.8820 + 1 1 4 12 2.9212 + 1 1 4 13 3.2739 + 1 1 4 14 3.6344 + 1 1 4 15 4.0001 + 1 1 4 16 3.1284 + 1 1 4 17 3.4594 + 1 1 4 18 3.8017 + 1 1 4 19 4.1520 + 1 1 4 20 3.3689 + 1 1 4 21 3.6776 + 1 1 4 22 4.0005 + 1 1 4 23 4.3339 + 1 1 4 24 3.6357 + 1 1 4 25 3.9227 + 1 1 4 26 4.2259 + 1 1 4 27 4.5418 + 1 1 4 28 3.9231 + 1 1 4 29 4.1895 + 1 1 4 30 4.4737 + 1 1 4 31 4.7722 + 1 1 5 0 4.1516 + 1 1 5 1 4.5418 + 1 1 5 2 4.9303 + 1 1 5 3 5.3169 + 1 1 5 4 4.1887 + 1 1 5 5 4.5755 + 1 1 5 6 4.9612 + 1 1 5 7 5.3454 + 1 1 5 8 4.2619 + 1 1 5 9 4.6422 + 1 1 5 10 5.0223 + 1 1 5 11 5.4018 + 1 1 5 12 4.3691 + 1 1 5 13 4.7403 + 1 1 5 14 5.1125 + 1 1 5 15 5.4851 + 1 1 5 16 4.5079 + 1 1 5 17 4.8677 + 1 1 5 18 5.2301 + 1 1 5 19 5.5942 + 1 1 5 20 4.6751 + 1 1 5 21 5.0220 + 1 1 5 22 5.3731 + 1 1 5 23 5.7271 + 1 1 5 24 4.8675 + 1 1 5 25 5.2006 + 1 1 5 26 5.5394 + 1 1 5 27 5.8823 + 1 1 5 28 5.0820 + 1 1 5 29 5.4007 + 1 1 5 30 5.7264 + 1 1 5 31 6.0575 + 1 1 6 0 3.8848 + 1 1 6 1 4.0020 + 1 1 6 2 4.1530 + 1 1 6 3 4.3342 + 1 1 6 4 3.5077 + 1 1 6 5 3.6375 + 1 1 6 6 3.8036 + 1 1 6 7 4.0015 + 1 1 6 8 4.5417 + 1 1 6 9 4.7718 + 1 1 6 10 5.0210 + 1 1 6 11 5.2864 + 1 1 6 12 4.2263 + 1 1 6 13 4.4737 + 1 1 6 14 4.7398 + 1 1 6 15 5.0214 + 1 1 6 16 5.5652 + 1 1 6 17 5.8551 + 1 1 6 18 6.1542 + 1 1 6 19 6.4607 + 1 1 6 20 5.3155 + 1 1 6 21 5.6197 + 1 1 6 22 5.9321 + 1 1 6 23 6.2510 + 1 1 6 24 0.0000 + 1 1 6 25 0.0000 + 1 1 6 26 0.0000 + 1 1 6 27 0.0000 + 1 1 6 28 0.0000 + 1 1 6 29 0.0000 + 1 1 6 30 0.0000 + 1 1 6 31 0.0000 + 1 1 7 0 3.5077 + 1 1 7 1 3.6375 + 1 1 7 2 3.8036 + 1 1 7 3 4.0015 + 1 1 7 4 3.8848 + 1 1 7 5 4.0020 + 1 1 7 6 4.1530 + 1 1 7 7 4.3342 + 1 1 7 8 4.2263 + 1 1 7 9 4.4737 + 1 1 7 10 4.7398 + 1 1 7 11 5.0214 + 1 1 7 12 4.5417 + 1 1 7 13 4.7718 + 1 1 7 14 5.0210 + 1 1 7 15 5.2864 + 1 1 7 16 5.3155 + 1 1 7 17 5.6197 + 1 1 7 18 5.9321 + 1 1 7 19 6.2510 + 1 1 7 20 5.5652 + 1 1 7 21 5.8551 + 1 1 7 22 6.1542 + 1 1 7 23 6.4607 + 1 1 7 24 0.0000 + 1 1 7 25 0.0000 + 1 1 7 26 0.0000 + 1 1 7 27 0.0000 + 1 1 7 28 0.0000 + 1 1 7 29 0.0000 + 1 1 7 30 0.0000 + 1 1 7 31 0.0000 + 1 1 8 0 6.7731 + 1 1 8 1 6.5750 + 1 1 8 2 6.3927 + 1 1 8 3 6.2282 + 1 1 8 4 6.0830 + 1 1 8 5 5.9589 + 1 1 8 6 5.8575 + 1 1 8 7 5.7801 + 1 1 8 8 5.7278 + 1 1 8 9 5.7015 + 1 1 8 10 5.7015 + 1 1 8 11 5.7278 + 1 1 8 12 5.7801 + 1 1 8 13 5.8575 + 1 1 8 14 5.9589 + 1 1 8 15 6.0830 + 1 1 8 16 6.2282 + 1 1 8 17 6.3927 + 1 1 8 18 6.5750 + 1 1 8 19 6.7731 + 1 1 8 20 0.0000 + 1 1 8 21 0.0000 + 1 1 8 22 0.0000 + 1 1 8 23 0.0000 + 1 1 8 24 0.0000 + 1 1 8 25 0.0000 + 1 1 8 26 0.0000 + 1 1 8 27 0.0000 + 1 1 8 28 0.0000 + 1 1 8 29 0.0000 + 1 1 8 30 0.0000 + 1 1 8 31 0.0000 diff --git a/StRoot/StFcsFastSimulatorMaker/macro/stage_params.txt b/StRoot/StSpinPool/StFcsTriggerSimMaker/files/stage_params.txt similarity index 100% rename from StRoot/StFcsFastSimulatorMaker/macro/stage_params.txt rename to StRoot/StSpinPool/StFcsTriggerSimMaker/files/stage_params.txt diff --git a/StRoot/StSpinPool/StWalgo2011/WeventDisplay.cxx b/StRoot/StSpinPool/StWalgo2011/WeventDisplay.cxx index 3a58c4ef8cb..4814b4751cc 100644 --- a/StRoot/StSpinPool/StWalgo2011/WeventDisplay.cxx +++ b/StRoot/StSpinPool/StWalgo2011/WeventDisplay.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/StRoot/StSpinPool/StWalgoB2009/WeventDisplay.cxx b/StRoot/StSpinPool/StWalgoB2009/WeventDisplay.cxx index fbbc0190d60..49451a5774e 100644 --- a/StRoot/StSpinPool/StWalgoB2009/WeventDisplay.cxx +++ b/StRoot/StSpinPool/StWalgoB2009/WeventDisplay.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/StRoot/StSvtSeqAdjMaker/StSvtSeqAdjMaker.cxx b/StRoot/StSvtSeqAdjMaker/StSvtSeqAdjMaker.cxx index 13d9218eaec..ec3fccb235e 100644 --- a/StRoot/StSvtSeqAdjMaker/StSvtSeqAdjMaker.cxx +++ b/StRoot/StSvtSeqAdjMaker/StSvtSeqAdjMaker.cxx @@ -221,6 +221,7 @@ StSvtSeqAdjMaker::StSvtSeqAdjMaker(const char *name) : StMaker(name) // Set up some defaults mPedFile = NULL; + hfile = NULL; mPedOffSet = 20; m_thresh_lo = 3+mPedOffSet; m_thresh_hi = 5+mPedOffSet; @@ -237,7 +238,6 @@ StSvtSeqAdjMaker::~StSvtSeqAdjMaker(){ Int_t StSvtSeqAdjMaker::Init(){ - hfile = NULL; GetSvtRawData(); SetSvtData(); diff --git a/StRoot/StTpcHitMaker/StTpcHitMaker.cxx b/StRoot/StTpcHitMaker/StTpcHitMaker.cxx index 146cc020ad6..2c6de24fadd 100644 --- a/StRoot/StTpcHitMaker/StTpcHitMaker.cxx +++ b/StRoot/StTpcHitMaker/StTpcHitMaker.cxx @@ -305,12 +305,11 @@ static Int_t _debug = 0; static const Char_t *Names[StTpcHitMaker::kAll] = {"undef", "tpc_hits","tpx_hits","itpc_hits", "TpcPulser","TpxPulser","iTPCPulser", - "TpcDumpPxls2Nt","TpxDumpPxls2Nt", "TpcRaw","TpxRaw","iTPCRaw", - "TpcAvLaser","TpxAvLaser"}; + "TpcAvLaser","TpxAvLaser","tpc_hitsO"}; //_____________________________________________________________ StTpcHitMaker::StTpcHitMaker(const char *name) : StRTSBaseMaker("tpc",name), kMode(kUndefined), - kReaderType(kUnknown), mQuery(""), fTpc(0), fAvLaser(0), fSectCounts(0) { + kReaderType(kUnknown), mQuery(""), fTpc(0), fAvLaser(0), fSectCounts(0), fThr(0), fSeq(0) { SetAttr("minSector",1); SetAttr("maxSector",24); SetAttr("minRow",1); @@ -318,8 +317,8 @@ StTpcHitMaker::StTpcHitMaker(const char *name) : StRTSBaseMaker("tpc",name), kMo } //_____________________________________________________________ Int_t StTpcHitMaker::Init() { - LOG_INFO << "StTpcHitMaker::Init as\t" << GetName() << endm; - TString MkName(GetName()); + LOG_INFO << "StTpcHitMaker::Init as\t" << GetName() << endm; + TString MkName(GetName()); for (Int_t k = 1; k < kAll; k++) { if (MkName.CompareTo(Names[k],TString::kIgnoreCase) == 0) {kMode = (EMode) k; break;} } @@ -497,6 +496,7 @@ Int_t StTpcHitMaker::Make() { switch (kMode) { case kTpc: case kiTPC: + case kTpxO: case kTpx: hitsAdded += UpdateHitCollection(sector); break; case kTpcPulser: case kTpxPulser: if (fTpc) DoPulser(sector); break; @@ -506,13 +506,11 @@ Int_t StTpcHitMaker::Make() { else TpxAvLaser(sector); fSectCounts->Fill(sector); break; - case kTpcDumpPxls2Nt: - case kTpxDumpPxls2Nt: if (fTpc) DumpPixels2Ntuple(sector); break; case kTpcRaw: case kTpxRaw: case kiTPCRaw: if ( fTpc) RawTpcData(sector); - else RawTpxData(sector); + else RawTpxData(sector); break; default: break; @@ -534,16 +532,71 @@ Int_t StTpcHitMaker::Make() { << ") starting at time bin 0. Skipping event." << endm; return kStSkip; } - if (kMode == kTpc || kMode == kTpx) { // || kMode == kiTPC) { --> no after burner for iTpc + if (kMode == kTpc || kMode == kTpx || kMode == kTpxO) { // || kMode == kiTPC) { --> no after burner for iTpc StEvent *pEvent = dynamic_cast (GetInputDS("StEvent")); if (Debug()) {LOG_INFO << "StTpcHitMaker::Make : StEvent has been retrieved " <tpcHitCollection(); if (hitCollection && ! IAttr("NoTpxAfterBurner")) AfterBurner(hitCollection); } + if (IAttr("CheckThrSeq") && (kMode == kTpcRaw || kMode == kTpxRaw || kMode == kiTPCRaw)) { + CheckThrSeq(); + } return kStOK; } //_____________________________________________________________ +void StTpcHitMaker::CheckThrSeq() { + if (! fThr || !fSeq) { + fThr = new TH2C("Thr","ADC Thresold value versus sector and row",24,0.5,24.5,72,0.5,72.5); fThr->SetDirectory(0); + fSeq = new TH2C("Seq","ADC sequnce value versus sector and row",24,0.5,24.5,72,0.5,72.5); fSeq->SetDirectory(0); + for (Int_t s = 1; s <= 24; s++) + for (Int_t r = 1; r <= 72; r++) { + fThr->SetBinContent(s,r,127); + fSeq->SetBinContent(s,r,127); + } + } + for (Int_t s = 1; s <= 24; s++){ + StTpcDigitalSector *digitalSector = GetDigitalSector(s); + if (! digitalSector) continue; + Int_t Nrows = digitalSector->numberOfRows(); + for (Int_t r = 1; r <= Nrows; r++) { + Int_t Npads = digitalSector->numberOfPadsInRow(r); + for (Int_t p = 1; p <= Npads; p++) { + Int_t ntb = digitalSector->numberOfTimeBins(r,p); + if (! ntb) continue; + digitalSector->getTimeAdc(r,p,ADCs,IDTs); + Int_t adcMin = 127; + Int_t seq = 127; + Int_t tbF = -1, tbL = -1; + for (Int_t tb = 0; tb < __MaxNumberOfTimeBins__; tb++) { + if (! ADCs[tb]) { + if (tbF > -1 && tbL >= tbF) { + if (seq > tbL - tbF + 1) seq = tbL - tbF + 1; + } + tbF = tbL = -1; + continue; + } + if (ADCs[tb] < adcMin) { + adcMin = TMath::Max(ADCs[tb-2],TMath::Max(ADCs[tb-1],TMath::Max(ADCs[tb],TMath::Max(ADCs[tb+1],ADCs[tb+1])))); + } + if (tbF < 0) tbF = tb; + tbL = tb; + } + if (adcMin < 127 && seq < 127) { + if (seq == 1 && adcMin == 1) { + static Int_t ibreak = 0; + ibreak++; + } + Char_t th = fThr->GetBinContent(s,r); + if (th > adcMin) fThr->SetBinContent(s,r, adcMin); + Char_t sq = fSeq->GetBinContent(s,r); + if (sq > seq) fSeq->SetBinContent(s,r, seq); + } + } + } + } +} +//_____________________________________________________________ Int_t StTpcHitMaker::Finish() { #ifdef __USE__THnSparse__ if (GetTFile() && fAvLaser) { @@ -558,6 +611,38 @@ Int_t StTpcHitMaker::Finish() { } } #endif /* __USE__THnSparse__ */ + if (fThr && fSeq) { + Int_t adcMinFL = 127; + Int_t seqFL = 127; + Int_t s1 = -1, s2 = -1, r1 = -1, r2 = -1; + for (Int_t s = 1; s <= 24; s++){ + for (Int_t r = 1; r <= 72; r++) { + Int_t adcMin = fThr->GetBinContent(s,r); + Int_t seq = fSeq->GetBinContent(s,r); + if (adcMin == 127 || seq == 127) continue; + if (adcMinFL == 127 && seqFL == 127) { + adcMinFL = adcMin; + seqFL = seq; + s1 = s2 = s; + r1 = r2 = r; + } else { + if (adcMinFL == adcMin && seqFL == seq) { + r2 = r; + s2 = s; + } else { + LOG_INFO << "StTpcHitMaker::Finish CheckThrSeq in sectors [" << s1 << "," << s2 << "] and rows[" << r1 << "," << r2 << "] Threshold = " << adcMinFL << " and sequence = " << seqFL << endm; + adcMinFL = adcMin; + seqFL = seq; + s1 = s2 = s; + r1 = r2 = r; + } + } + } + } + LOG_INFO << "StTpcHitMaker::Finish CheckThrSeq in sectors [" << s1 << "," << s2 << "] and rows[" << r1 << "," << r2 << "] Threshold = " << adcMinFL << " and sequence = " << seqFL << endm; + } + SafeDelete(fThr); + SafeDelete(fSeq); return StMaker::Finish(); } //_____________________________________________________________ @@ -588,6 +673,7 @@ Int_t StTpcHitMaker::UpdateHitCollection(Int_t sector) { if (! c || ! c->charge) continue; if (c->flags && (c->flags & ~(FCF_ONEPAD | FCF_MERGED | FCF_BIG_CHARGE))) continue; + if (kMode == kTpxO) c->flags |= 256; // mark cluster if it is coming from extra online maker Int_t row = padrow + 1; Float_t pad = c->p; Int_t iRdo = StDetectorDbTpcRDOMasks::instance()->rdoForPadrow(sector,row,pad); @@ -624,6 +710,7 @@ Int_t StTpcHitMaker::UpdateHitCollection(Int_t sector) { if (cld->t2 < 0 || cld->t2 >= __MaxNumberOfTimeBins__) continue; if (cld->flags && (cld->flags & ~(FCF_ONEPAD | FCF_MERGED | FCF_BIG_CHARGE))) continue; + if (kMode == kTpxO) cld->flags |= 256; // mark cluster if it is coming from extra online maker Float_t pad = cld->pad; Int_t iRdo = StDetectorDbTpcRDOMasks::instance()->rdoForPadrow(sector,row,pad); if ( ! StDetectorDbTpcRDOMasks::instance()->isOn(sector,iRdo)) continue; @@ -661,7 +748,6 @@ StTpcHit *StTpcHitMaker::CreateTpcHit(const tpc_cl &cluster, Int_t sector, Int_t Double_t wire_coupling = (row<=St_tpcPadConfigC::instance()->innerPadRows(sector)) ? St_tss_tssparC::instance()->wire_coupling_in() : St_tss_tssparC::instance()->wire_coupling_out(); #endif Double_t q = 0; //cluster.charge * ((Double_t)St_tss_tssparC::instance()->ave_ion_pot() * (Double_t)St_tss_tssparC::instance()->scale())/(gain*wire_coupling) ; - StTpcHit *hit = StTpcHitFlag(global.position(),hard_coded_errors,hw,q , (UChar_t ) 0 // c , (Int_t) 0 // idTruth=0 @@ -674,7 +760,7 @@ StTpcHit *StTpcHitMaker::CreateTpcHit(const tpc_cl &cluster, Int_t sector, Int_t , pad , time , cluster.charge - , cluster.flags); + ,cluster.flags); if (hit->minTmbk() == 0) bin0Hits++; if (Debug()) { LOG_INFO << "StTpcHitMaker::CreateTpcHit fromt tpc_cl\t" <<*hit << endm; @@ -694,10 +780,14 @@ StTpcHit *StTpcHitMaker::CreateTpcHit(const daq_cld &cluster, Int_t sector, Int_ #else /* used in TFG till 07/31/20 */ Double_t q = 0; #endif - - // Correct for slewing (needs corrected q, and time in microsec) - Double_t freq = gStTpcDb->Electronics()->samplingFrequency(); - time = freq * St_tpcSlewingC::instance()->correctedT(sector,row,q,time/freq); + // Check that slewing is active + static St_tpcSlewingC *tpcSlewing = St_tpcSlewingC::instance(); + if (tpcSlewing && tpcSlewing->type() != 1001) tpcSlewing = 0; + if (tpcSlewing) { + // Correct for slewing (needs corrected q, and time in microsec) + Double_t freq = gStTpcDb->Electronics()->samplingFrequency(); + time = freq * tpcSlewing->correctedT(sector,row,q,time/freq); + } static StTpcCoordinateTransform transform(gStTpcDb); static StTpcLocalSectorCoordinate local; static StTpcLocalCoordinate global; @@ -709,6 +799,8 @@ StTpcHit *StTpcHitMaker::CreateTpcHit(const daq_cld &cluster, Int_t sector, Int_ hw += sector << 4; // (row/100 << 4); // sector hw += row << 9; // (row%100 << 9); // row static StThreeVector hard_coded_errors(fgDp,fgDt,fgDperp); + UShort_t flag = cluster.flags; + if (kMode == kTpxO) flag |= 256; // mark cluster if it is coming from extra online maker StTpcHit *hit = StTpcHitFlag(global.position(),hard_coded_errors,hw,q , (UChar_t ) 0 // c @@ -722,7 +814,7 @@ StTpcHit *StTpcHitMaker::CreateTpcHit(const daq_cld &cluster, Int_t sector, Int_ , pad , time , cluster.charge - , cluster.flags); + , flag); if (hit->minTmbk() == 0) bin0Hits++; if (Debug()) { LOG_INFO << "StTpcHitMaker::CreateTpcHit fromt daq_cld\t" <<*hit << endm; @@ -888,75 +980,28 @@ void StTpcHitMaker::TpxAvLaser(Int_t sector) { } } //________________________________________________________________________________ -void StTpcHitMaker::DumpPixels2Ntuple(Int_t sector) { +void StTpcHitMaker::DumpPixels2Ntuple(Int_t sector, Int_t row, Int_t pad) { struct BPoint_t { - Float_t sector, row, pad, tb, adc, ped, t0, peak; + Float_t event, sector, row, pad, tb, adc, idt; }; - static const Char_t *BName = "sector:row:pad:tb:adc:ped:t0:peak"; + static const Char_t *BName = "event:sector:row:pad:tb:adc:idt"; static TNtuple *adcP = 0; - if (! adcP) { - assert(GetTFile()); + if (! adcP && GetTFile() ) { GetTFile()->cd(); adcP = new TNtuple("adcP","Pulser ADC",BName); } + if (! adcP) return; static BPoint_t P; - if (! fTpc) return; - Int_t r, p, tb, tbmax; - // if (! fTpc->channels_sector) return; - for(Int_t row = 1; row <= St_tpcPadConfigC::instance()->numberOfRows(sector); row++) { - r = row - 1; - for (Int_t pad = 1; pad <= 182; pad++) { - p = pad - 1; - Int_t ncounts = fTpc->counts[r][p]; - if (! ncounts) continue; - static UShort_t adc[512]; - memset (adc, 0, sizeof(adc)); - tbmax = 513; - UShort_t adcmax = 0; - for (Int_t i = 0; i < ncounts; i++) { - tb = fTpc->timebin[r][p][i]; - adc[tb] = log8to10_table[fTpc->adc[r][p][i]]; - if (adc[tb] > adcmax) { - tbmax = tb; - adcmax = adc[tb]; - } - } - if (tbmax < 2 || tbmax > 504) continue; - Int_t npeak = 0, nped = 0; - Int_t i1s = TMath::Max( 0, tbmax - 2); - Int_t i2s = TMath::Min(511, tbmax + 7); - Int_t i1 = TMath::Max(0 ,i1s - 20); - Int_t i2 = TMath::Min(511,i2s + 20); - Double_t peak = 0; - Double_t ped = 0; - Double_t t0 = 0; - for (Int_t i = i1; i <= i2; i++) { - if (i >= i1s && i <= i2s) continue; - nped++; - ped += adc[i]; - } - if (nped) ped /= nped; - for (Int_t i = i1s; i <= i2s; i++) { - npeak++; - peak += adc[i] - ped; - t0 += i*(adc[i] - ped); - } - if (peak <= 0) continue; - t0 /= peak; - i1 = (Int_t) TMath::Max(0.,t0 - 20); - i2 = (Int_t) TMath::Min(511., t0 + 80); - for (Int_t i = i1; i <= i2; i++) { - P.sector = sector; - P.row = row; - P.pad = pad; - P.tb = i - t0; - P.adc = adc[i]; - P.ped = ped; - P.t0 = t0; - P.peak = peak; - adcP->Fill(&P.sector); - } - } + P.event = GetEventNumber(); + P.sector = sector; + P.row = row; + P.pad = pad; + for (Int_t i = 0; i < __MaxNumberOfTimeBins__; i++) { + if (! ADCs[i]) continue; + P.tb = i; + P.adc = ADCs[i]; + P.idt = IDTs[i]; + adcP->Fill(&P.event); } } //________________________________________________________________________________ @@ -1067,6 +1112,9 @@ Int_t StTpcHitMaker::RawTpxData(Int_t sector) { } } digitalSector->putTimeAdc(r_old+1,p_old+1,ADCs,IDTs); + if (IAttr("TpxDumpPxls2Nt")) { + DumpPixels2Ntuple(sector,r_old+1,p_old+1); + } memset(ADCs, 0, sizeof(ADCs)); memset(IDTs, 0, sizeof(IDTs)); } @@ -1131,6 +1179,9 @@ Int_t StTpcHitMaker::RawTpcData(Int_t sector) { #endif } digitalSector->putTimeAdc(row,pad,ADCs,IDTs); + if (IAttr("TpxDumpPxls2Nt")) { + DumpPixels2Ntuple(sector,row,pad); + } } } if (Total_data) { diff --git a/StRoot/StTpcHitMaker/StTpcHitMaker.h b/StRoot/StTpcHitMaker/StTpcHitMaker.h index 02bfffe9b96..97ed33695fc 100644 --- a/StRoot/StTpcHitMaker/StTpcHitMaker.h +++ b/StRoot/StTpcHitMaker/StTpcHitMaker.h @@ -87,6 +87,7 @@ #include "StThreeVectorF.hh" //#define __USE__THnSparse__ #include "TH1.h" +#include "TH2.h" #ifdef __USE__THnSparse__ #include "THnSparse.h" #else /* ! __USE__THnSparse__ */ @@ -104,9 +105,9 @@ class StTpcHitMaker : public StRTSBaseMaker { enum EMode {kUndefined, kTpc, kTpx, kiTPC, kTpcPulser, kTpxPulser, kiTPCPulser, - kTpcDumpPxls2Nt, kTpxDumpPxls2Nt, kTpcRaw, kTpxRaw, kiTPCRaw, kTpcAvLaser, kTpxAvLaser, // averaging on pixel level + kTpxO, kAll}; StTpcHitMaker(const char *name="tpc_hits"); virtual ~StTpcHitMaker() {} @@ -119,16 +120,20 @@ class StTpcHitMaker : public StRTSBaseMaker { void TpcAvLaser(Int_t sector); void PadMonitor(Int_t sector); Int_t UpdateHitCollection(Int_t sector); - void DumpPixels2Ntuple(Int_t sector); + void DumpPixels2Ntuple(Int_t sector, Int_t row, Int_t pad); void PrintSpecial(Int_t sector); Int_t RawTpcData(Int_t sector); Int_t RawTpxData(Int_t sector); void InitializeHistograms(Int_t token); + void CheckThrSeq(); + TH2C *Thr() {return fThr;} + TH2C *Seq() {return fSeq;} #ifdef __USE__THnSparse__ THnSparseF *CompressTHn(THnSparseF *hist, Double_t compress = 1e4); #endif /* __USE__THnSparse__ */ StTpcDigitalSector *GetDigitalSector(Int_t sector); virtual Int_t Finish(); + Int_t getADC(Int_t i) {if (i < 0 || i > 511) {return 0;} else {return ADCs[i];}} private: EMode kMode; @@ -171,6 +176,8 @@ class StTpcHitMaker : public StRTSBaseMaker { static Float_t fgDt; static Float_t fgDperp; static Bool_t fgCosmics; + TH2C *fThr; + TH2C *fSeq; // cvs virtual const char *GetCVS() const { static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs; diff --git a/StRoot/StTpcHitMaker/StTpcRTSHitMaker.cxx b/StRoot/StTpcHitMaker/StTpcRTSHitMaker.cxx index d088730d6a2..e5ca8598abd 100644 --- a/StRoot/StTpcHitMaker/StTpcRTSHitMaker.cxx +++ b/StRoot/StTpcHitMaker/StTpcRTSHitMaker.cxx @@ -6,7 +6,6 @@ *************************************************************************** * * Description: Make clusters from StTpcRawData and fill the StEvent */ -//#define __USE_GAIN_FROM_FILE__ #include #include #include "StTpcHitMaker.h" @@ -29,10 +28,9 @@ #include "StDetectorDbMaker/St_itpcPadPlanesC.h" #include "StDetectorDbMaker/St_tpcPadConfigC.h" #include "StDetectorDbMaker/St_tpcStatusC.h" -#ifdef __USE_GAIN_FROM_FILE__ #include "StDetectorDbMaker/StPath2tpxGain.h" #include "StDetectorDbMaker/StPath2itpcGain.h" -#endif /* __USE_GAIN_FROM_FILE__ */ +#include "StDetectorDbMaker/St_tpcPadConfigC.h" #include "StMessMgr.h" #include "StDAQMaker/StDAQReader.h" #include "StRtsTable.h" @@ -49,11 +47,14 @@ #include "RTS/src/DAQ_TPX/tpxFCF.h" #include "RTS/src/DAQ_TPX/tpxStat.h" #include "RTS/src/DAQ_ITPC/itpcFCF.h" -#ifdef __TFG__VERSION__ -#include "TPC23/tpx23.h" -#include "TPC23/itpc23.h" -#endif /* __TFG__VERSION__ */ +#include "RTS/src/DAQ_TPC23/tpc23_base.h" +#include "RTS/src/DAQ_TPC23/tpx23.h" +#include "RTS/src/DAQ_TPC23/itpc23.h" #include "TBenchmark.h" +#include "TH2.h" +#include "TFile.h" +#include "TPolyMarker.h" +#include "TBox.h" ClassImp(StTpcRTSHitMaker); #define __DEBUG__ #ifdef __DEBUG__ @@ -61,14 +62,13 @@ ClassImp(StTpcRTSHitMaker); #else #define PrPP(A,B) #endif +StTpcRTSHitMaker *StTpcRTSHitMaker::fgStTpcRTSHitMaker = 0; //________________________________________________________________________________ StTpcRTSHitMaker::~StTpcRTSHitMaker() { SafeDelete(fTpx); SafeDelete(fiTpc); -#ifdef __TFG__VERSION__ SafeDelete(fTpx23); SafeDelete(fiTpc23); -#endif /* __TFG__VERSION__ */ } //________________________________________________________________________________ Int_t StTpcRTSHitMaker::Init() { @@ -77,7 +77,6 @@ Int_t StTpcRTSHitMaker::Init() { bin0Hits = 0; return StMaker::Init(); } -#ifdef __USE_GAIN_FROM_FILE__ //________________________________________________________________________________ Int_t StTpcRTSHitMaker::from_file(daq_dta *gain_dta, const Char_t *fname) { // example of gains; will use file for that @@ -127,7 +126,27 @@ Int_t StTpcRTSHitMaker::from_file(daq_dta *gain_dta, const Char_t *fname) { } return 1; } -#endif /* __USE_GAIN_FROM_FILE__ */ +//________________________________________________________________________________ +Int_t StTpcRTSHitMaker::FixGains(tpc23_base *tpc23, Int_t sec, Int_t row, Int_t Npads) { + // from tpc23_base::gains_from_cache, fix dead pads and edges + Int_t ok = 0; + tpc23_base::row_pad_t (*rp_gain)[tpc23_base::ROW_MAX+1][tpc23_base::PAD_MAX+1] = tpc23->rp_gain; + for (Int_t pad = 1; pad <= Npads; pad++) { + Float_t g = rp_gain[sec-1][row][pad].gain; + if(g<0.01) { + int p1 = pad - 1 ; + int p2 = pad + 1 ; + if(p1<1) p1 = 1 ; + if(p2>Npads) p2 = Npads ; + rp_gain[sec-1][row][pad].flags |= FCF_DEAD_EDGE ; + rp_gain[sec-1][row][p1].flags |= FCF_DEAD_EDGE ; + rp_gain[sec-1][row][p2].flags |= FCF_DEAD_EDGE ; + } + } + rp_gain[sec-1][row][1].flags |= FCF_ROW_EDGE ; // row edge + rp_gain[sec-1][row][Npads].flags |= FCF_ROW_EDGE ; // row edge + return ok; +} //________________________________________________________________________________ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { SetAttr("minSector",1); @@ -137,31 +156,45 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { SetAttr("maxRow",St_tpcPadConfigC::instance()->numberOfRows(20)); SafeDelete(fTpx); SafeDelete(fiTpc); -#ifdef __TFG__VERSION__ SafeDelete(fTpx23); SafeDelete(fiTpc23); -#endif /* __TFG__VERSION__ */ -#ifdef __USE_GAIN_FROM_FILE__ - const Char_t *fname = StPath2tpxGain::instance()->GetPath(); - const Char_t *fnameITPC = StPath2itpcGain::instance()->GetPath(); -#else - const Char_t *fname = "none"; - const Char_t *fnameITPC = "none"; -#endif /* __USE_GAIN_FROM_FILE__ */ -#ifdef __TFG__VERSION__ + TString fnameTPX("none"); + TString fnameITPC("none"); + if (IAttr("USE_GAIN_FROM_FILE")) { + fnameTPX = StPath2tpxGain::instance()->GetPath(); + LOG_INFO << "StTpcRTSHitMaker::InitRun: use " << fnameTPX.Data() << " for TPX" << endm; + fnameITPC = StPath2itpcGain::instance()->GetPath(); + LOG_INFO << "StTpcRTSHitMaker::InitRun: use " << fnameITPC.Data() << " for iTPC" << endm; + } if ( IAttr("TPC23")) { // TPC23 + LOG_INFO << "StTpcRTSHitMaker::InitRun:: use TPC23 mode" << endm; Int_t log_level = 0 ; + // Int_t fmt_version = 0 ; + Int_t run_type = 3; + Int_t online = 0 ; // NOTE setting for Offline mode! fTpx23 = new tpx23; - fTpx23->log_level = log_level; - if (fTpx23->gains_from_cache(fname) < 0) { // REQUIRED even if no gain correction + fTpx23->online = online ; + fTpx23->run_type = run_type ; + fTpx23->log_level = log_level ; + if (fTpx23->gains_from_cache(fnameTPX) < 0 || fnameTPX == "none") { // REQUIRED even if no gain correction // Tpx Load gains from Db + Int_t NoPadsWithLoadedGain = 0; for(Int_t sector=1;sector<=24;sector++) { Int_t rowMin = 1; if (St_tpcPadConfigC::instance()->iTPC(sector)) rowMin = 14; - for(Int_t rowO = 1; rowO <= 45; rowO++) { + for(Int_t rowO = 1; rowO < rowMin; rowO++) { + Int_t Npads = St_tpcPadPlanesC::instance()->padsPerRow(rowO); + for(Int_t pad = 0; pad <= Npads; pad++) { + fTpx23->rp_gain[sector-1][rowO][pad].gain = 0.; // be sure that dead pads are killed + fTpx23->rp_gain[sector-1][rowO][pad].t0 = -9.99; + fTpx23->rp_gain[sector-1][rowO][pad].flags = 64; + } + } + for(Int_t rowO = rowMin; rowO <= 45; rowO++) { Int_t Npads = St_tpcPadPlanesC::instance()->padsPerRow(rowO); Int_t padMin = 1; Int_t padMax = Npads; + Int_t NoPadsWithLoadedGainPerRow = 0; for(Int_t pad = 0; pad <= Npads; pad++) { fTpx23->rp_gain[sector-1][rowO][pad].gain = 0.; // be sure that dead pads are killed fTpx23->rp_gain[sector-1][rowO][pad].t0 = 0.; @@ -169,20 +202,44 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { if (St_tpcPadGainT0C::instance()->Gain(sector,rowO,pad) <= 0) continue; fTpx23->rp_gain[sector-1][rowO][pad].gain = St_tpcPadGainT0C::instance()->Gain(sector,rowO,pad); fTpx23->rp_gain[sector-1][rowO][pad].t0 = St_tpcPadGainT0C::instance()->T0(sector,rowO,pad); + NoPadsWithLoadedGainPerRow++; } } + if (NoPadsWithLoadedGainPerRow > 0) { + NoPadsWithLoadedGain += NoPadsWithLoadedGainPerRow; + FixGains(fTpx23, sector, rowO, Npads); + } } } + LOG_INFO << "StTpcRTSHitMaker::InitRun:: loaded gains for " << NoPadsWithLoadedGain << " pads in TPX23" << endm; + } + //#define __DEBUG_GAIN__ +#ifdef __DEBUG_GAIN__ + LOG_INFO << "StTpcRTSHitMaker::InitRun:: Print gains for Tpx23" << endm; + for(Int_t sector=1;sector<=24;sector++) { + for(Int_t rowO = 1; rowO <= 45; rowO++) { + Int_t Npads = St_tpcPadPlanesC::instance()->padsPerRow(rowO); + for(Int_t pad = 1; pad <= Npads; pad++) { + cout << Form("Gain/T0 s/r/p %3i/%3i/%3i %7.3f %7.3f %i",sector,rowO,pad,fTpx23->rp_gain[sector-1][rowO][pad].gain,fTpx23->rp_gain[sector-1][rowO][pad].t0,fTpx23->rp_gain[sector-1][rowO][pad].flags) << endl; + } + } + } +#endif /* __DEBUG_GAIN__ */ fTpx23->run_start() ; // iTPC23 fiTpc23 = new itpc23 ; - fiTpc23->log_level = log_level; - if (fiTpc23->gains_from_cache(fnameITPC) < 0) { // REQUIRED even if no gain correction + fiTpc23->online = online ; + fiTpc23->run_type = run_type ; + fiTpc23->log_level = log_level ; + Int_t ok = fiTpc23->gains_from_cache(fnameITPC); + if (ok < 0 || fnameITPC == "none") { // REQUIRED even if no gain correction + Int_t NoPadsWithLoadedGain = 0; for(Int_t sector=1;sector<=24;sector++) { if (! St_tpcPadConfigC::instance()->iTPC(sector)) continue; for(Int_t row = 1; row <= 40; row++) { Int_t Npads = St_itpcPadPlanesC::instance()->padsPerRow(row); + Int_t NoPadsWithLoadedGainPerRow = 0; for(Int_t pad = 0; pad <= Npads; pad++) { fiTpc23->rp_gain[sector-1][row][pad].gain = 0.; // be sure that dead pads are killed fiTpc23->rp_gain[sector-1][row][pad].t0 = 0.; @@ -191,16 +248,29 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { fiTpc23->rp_gain[sector-1][row][pad].gain = St_itpcPadGainT0C::instance()->Gain(sector,row,pad); fiTpc23->rp_gain[sector-1][row][pad].t0 = St_itpcPadGainT0C::instance()->T0(sector,row,pad); //#define __DEBUG_GAIN__ -#ifdef __DEBUG_GAIN__ - cout << Form("Gain/T0 s/r/p %3i/%3i/%3i %7.2f %7.2f",sector,row,pad,fiTpc23->rp_gain[sector-1][row][pad].gain,fiTpc23->rp_gain[sector-1][row][pad].t0) << endl; -#endif /* __DEBUG_GAIN__ */ + NoPadsWithLoadedGainPerRow++; + } + if (NoPadsWithLoadedGainPerRow > 0) { + NoPadsWithLoadedGain += NoPadsWithLoadedGainPerRow; + FixGains(fiTpc23, sector, row, Npads); } } } + LOG_INFO << "StTpcRTSHitMaker::InitRun:: loaded gains for " << NoPadsWithLoadedGain << " pads in iTPC23" << endm; } +#ifdef __DEBUG_GAIN__ + LOG_INFO << "StTpcRTSHitMaker::InitRun:: Print gains for iTpc23" << endm; + for(Int_t sector=1;sector<=24;sector++) { + for(Int_t row = 1; row <= 40; row++) { + Int_t Npads = St_itpcPadPlanesC::instance()->padsPerRow(row); + for(Int_t pad = 1; pad <= Npads; pad++) { + cout << Form("Gain/T0 s/r/p %3i/%3i/%3i %7.3f %7.3f %i",sector,row,pad,fiTpc23->rp_gain[sector-1][row][pad].gain,fiTpc23->rp_gain[sector-1][row][pad].t0,fiTpc23->rp_gain[sector-1][row][pad].flags) << endl; + } + } + } +#endif /* __DEBUG_GAIN__ */ fiTpc23->run_start() ; } else { -#endif /* __TFG__VERSION__ */ fTpx = new daq_tpx() ; if (GetDate() >= 20091215) fTpx->fcf_run_compatibility = 10 ; if (GetDate() >= 20191215) fTpx->fcf_run_compatibility = 22 ; @@ -212,7 +282,8 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { // daq_dta *dta_Tpx = fTpx->put("gain"); tpxGain *gain = fTpx->gain_algo; // gain->do_default(sector) ; // zap to all 1... - if (gain->from_file(fname, 0) < 0) { + Int_t ok = gain->from_file(fnameTPX, 0); + if (ok < 0 &&fnameTPX == "none") { for(Int_t sector=1;sector<=24;sector++) { // Tpx Int_t rowMin = 1; @@ -252,9 +323,8 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { // iTpc if (fiTpc) { daq_dta * dta_iTpc = fiTpc->put("gain"); // , 0, 40, 0, miTpc_RowLen); -#ifdef __USE_GAIN_FROM_FILE__ - if (from_file(dta_iTpc, fname) < 0) { -#endif /* __USE_GAIN_FROM_FILE__ */ + Int_t ok = from_file(dta_iTpc, fnameITPC); + if (ok < 0 || fnameITPC == "none") { for(Int_t sector=1;sector<=24;sector++) { if (! St_tpcPadConfigC::instance()->iTPC(sector)) continue; for(Int_t row = 1; row <= 40; row++) { @@ -277,13 +347,9 @@ Int_t StTpcRTSHitMaker::InitRun(Int_t runnumber) { } // ((daq_itpc *) dta_iTpc)->InitRun(runnumber); } -#ifdef __USE_GAIN_FROM_FILE__ } -#endif /* __USE_GAIN_FROM_FILE__ */ } // -#ifdef __TFG__VERSION__ } -#endif /* __TFG__VERSION__ */ PrintAttr(); ////////////////////////////////////// @@ -408,9 +474,7 @@ Int_t StTpcRTSHitMaker::Make() { LOG_WARN << "TPC status indicates it is unusable for this event. Ignoring hits." << endm; return kStOK; } -#ifdef __TFG__VERSION__ if (IAttr("TPC23")) return Make23(); -#endif /* __TFG__VERSION__ */ static Short_t ADCs[__MaxNumberOfTimeBins__]; #ifdef __TFG__VERSION__ static Int_t IDTs[__MaxNumberOfTimeBins__]; @@ -662,7 +726,6 @@ Int_t StTpcRTSHitMaker::Make() { #endif return kStOK; } -#ifdef __TFG__VERSION__ //________________________________________________________________________________ Int_t StTpcRTSHitMaker::Make23() { if (! fTpx23 && ! fiTpc23) return kStErr; @@ -676,7 +739,11 @@ Int_t StTpcRTSHitMaker::Make23() { return kStOK; } static Short_t ADCs[__MaxNumberOfTimeBins__]; +#ifdef __TFG__VERSION__ static Int_t IDTs[__MaxNumberOfTimeBins__]; +#else + static UShort_t IDTs[__MaxNumberOfTimeBins__]; +#endif static StTpcCoordinateTransform transform; static StThreeVectorF hard_coded_errors; StEvent* rEvent = (StEvent*) GetInputDS("StEvent"); @@ -735,6 +802,10 @@ Int_t StTpcRTSHitMaker::Make23() { tpc23 = fTpx23; } if (! tpc23) continue; +#ifndef __TFG__VERSION__ + Double_t ADC2GeV = 0; + Int_t rowOld = -1; +#endif /* ! __TFG__VERSION__ */ for (Int_t row = row1; row <= row2; row++) { if (! St_tpcPadGainT0BC::instance()->livePadrow(sector,row)) continue; tpc23->sim_evt_start(sector) ; // prepare start of event @@ -755,14 +826,21 @@ Int_t StTpcRTSHitMaker::Make23() { // add adc data for this specific sector:row:pad digitalSector->getTimeAdc(row,pad,ADCs,IDTs); UInt_t l = 0; + static UShort_t adcs[__MaxNumberOfTimeBins__]; + memset(adcs, 0, sizeof(adcs)); + static Int_t idts[__MaxNumberOfTimeBins__]; + memset(idts, 0, sizeof(idts)); for (UInt_t k = 0; k < __MaxNumberOfTimeBins__; k++) { if (ADCs[k]) { + adcs[k] = ADCs[k]; + idts[k] = IDTs[k]; l++; } } if (l > 0) { Int_t padrow = rowO; - tpc23->sim_do_pad(padrow,pad,ADCs,IDTs) ; + // tpc23->sim_do_pad(padrow,pad,ADCs,IDTs) ; + tpc23->do_ch_sim(padrow,pad,adcs,idts) ; NoAdcs += l; } } // pad loop @@ -806,7 +884,7 @@ Int_t StTpcRTSHitMaker::Make23() { version = (padrow>>16) ; - ints_per_cluster = 5 ; // 5 for sim, 2 for real + ints_per_cluster = fTpx23 -> online? 2 : 5; // 5 for sim, 2 for real, Tommy's fix } else { padrow = *p_buff++ ; @@ -887,6 +965,17 @@ Int_t StTpcRTSHitMaker::Make23() { hw += sector << 4; // (row/100 << 4); // sector hw += row << 9; // (row%100 << 9); // row #ifndef __TFG__VERSION__ + if (row != rowOld) { + rowOld = row; + Double_t gain = St_tpcPadConfigC::instance()->IsRowInner(sector,row) ? + St_tss_tssparC::instance()->gain_in() : + St_tss_tssparC::instance()->gain_out(); + Double_t wire_coupling = St_tpcPadConfigC::instance()->IsRowInner(sector,row) ? + St_tss_tssparC::instance()->wire_coupling_in() : + St_tss_tssparC::instance()->wire_coupling_out(); + ADC2GeV = ((Double_t) St_tss_tssparC::instance()->ave_ion_pot() * + (Double_t) St_tss_tssparC::instance()->scale())/(gain*wire_coupling) ; + } Double_t q = ADC2GeV*dc.cld.charge; #else /* used in TFG till 07/31/20 */ Double_t q = 0; @@ -938,4 +1027,87 @@ Int_t StTpcRTSHitMaker::Make23() { #endif return kStOK; } -#endif /* __TFG__VERSION__ */ +//________________________________________________________________________________ +TH2F *StTpcRTSHitMaker::PlotSecRow(Int_t sec, Int_t row, Int_t flags) { + /* + Usage: + root.exe ' bfc.C(1,"P2019a,StiCA,evout,NoHistos,noTags,noRunco,PicoVtxVpdOrDefault,TpxRaw,TPC23,TpxRaw,TPC23,USE_GAIN_FROM_FILE,tpxO,NoTpxAfterBurner","/RTS/TONKO/data/st_physics_adc_20192001_raw_5500002.daq","","Plot.root")' + TH2F *plot = StTpcRTSHitMaker::instance()->PlotSecRow(2,43,-1); + */ + TH2F *plot = 0; + StEvent* pEvent = (StEvent*) StMaker::GetChain()->GetInputDS("StEvent"); + if (!pEvent) { cout << "Can't find StEvent" << endl; return plot;} + StTpcHitCollection* TpcHitCollection = pEvent->tpcHitCollection(); + if (! TpcHitCollection) { cout << "No TPC Hit Collection" << endl; return plot;} + StTpcSectorHitCollection* sectorCollection = TpcHitCollection->sector(sec-1); + if (! sectorCollection) { cout << "No TPC Hit Collection for sector " << sec << endl; return plot;} + StTpcPadrowHitCollection *rowCollection = sectorCollection->padrow(row-1); + if (! rowCollection) { cout << "No TPC Hit Collection for sector " << sec << " and row " << row << endl; return plot;} + TFile *f = StMaker::GetChain()->GetTFile(); + if (! f) {cout << "No TFile is opened" << endl; return plot;} + f->cd(); + TString PlotName(Form("s%02ir%03i",sec,row)); + plot = (TH2F *) f->Get(PlotName); + if (plot) { + plot->Reset(); + plot->SetTitle(Form("ADC versus pad and time buckets for sec = %i and row = %i in event %i",sec,row, pEvent->id())); + } else { + Int_t npad = St_tpcPadConfigC::instance()->padsPerRow(sec,row); + plot = new TH2F(PlotName,Form("ADC versus pad and time buckets for sec = %i and row = %i in event %i",sec,row, pEvent->id()), 360,-0.5,359.5,npad,0.5,npad+0.5); + plot->SetStats(1); + } + TDataSet* tpcRawEvent = StMaker::GetChain()->GetInputDS("Event"); + if (! tpcRawEvent) { + LOG_WARN << "There is not Tpc Raw Event" << endm; + } else { + StTpcRawData *tpcRawData = (StTpcRawData *) tpcRawEvent->GetObject(); + if (! tpcRawData) { + LOG_WARN << "There is not Tpc Raw Data" << endm; + } else { + StTpcDigitalSector *digitalSector = tpcRawData->GetSector(sec); + if (! digitalSector) { + LOG_WARN << "There is not digital sector" << sec << endm; + } else { + Int_t Npads = digitalSector->numberOfPadsInRow(row); + for(Int_t pad = 1; pad <= Npads; pad++) { + static Short_t ADCs[__MaxNumberOfTimeBins__]; +#ifdef __TFG__VERSION__ + static Int_t IDTs[__MaxNumberOfTimeBins__]; +#else + static UShort_t IDTs[__MaxNumberOfTimeBins__]; +#endif + digitalSector->getTimeAdc(row,pad,ADCs,IDTs); + for (UInt_t k = 0; k < __MaxNumberOfTimeBins__; k++) { + if (ADCs[k]) plot->Fill(k,pad,ADCs[k]); + } + } + } + } + } + StSPtrVecTpcHit &hits = rowCollection->hits(); + Long_t NoHits = hits.size(); + for (Long64_t k = 0; k < NoHits; k++) { + const StTpcHit *tpcHit = static_cast (hits[k]); + Int_t color = 1; + Int_t style = 43; + Double_t offset = 0.0; + Int_t flag = tpcHit->flag(); + if (flag & 256) {color = 2; style = 29; offset = 0.1; flag &= ~0x100;} // online kTpxO + if (flags > -1 && flag < flags) continue; + Double_t tb = tpcHit->timeBucket(); + Double_t pad = tpcHit->pad(); + TPolyMarker *pm = new TPolyMarker(1,&tb, &pad); + pm->SetMarkerStyle(style); + pm->SetMarkerColor(color); + pm->SetMarkerSize(2); + plot->GetListOfFunctions()->Add(pm); + TBox *box = new TBox(tpcHit->minTmbk()-0.5 + offset,tpcHit->minPad()-0.5 + offset, tpcHit->maxTmbk()+0.5 + offset,tpcHit->maxPad()+0.5 + offset); + box->SetLineWidth(4); + box->SetLineColor(color); + box->SetFillStyle(0); + box->SetFillColor(0); + plot->GetListOfFunctions()->Add(box); + } + plot->Draw("colz"); + return plot; +} diff --git a/StRoot/StTpcHitMaker/StTpcRTSHitMaker.h b/StRoot/StTpcHitMaker/StTpcRTSHitMaker.h index 263455fedae..c570724c234 100644 --- a/StRoot/StTpcHitMaker/StTpcRTSHitMaker.h +++ b/StRoot/StTpcHitMaker/StTpcRTSHitMaker.h @@ -71,39 +71,35 @@ class daq_itpc; class daq_dta; class daq_cld; class tpc23_base; +class TH2F; class StTpcRTSHitMaker : public StMaker { public: StTpcRTSHitMaker(const char *name="tpc_hits") : StMaker(name), fTpx(0), fiTpc(0), -#ifdef __TFG__VERSION__ fTpx23(0), fiTpc23(0), -#endif /* __TFG__VERSION__ */ - fminCharge(0) {} + fminCharge(0) {fgStTpcRTSHitMaker = this;} virtual ~StTpcRTSHitMaker(); - + static StTpcRTSHitMaker *instance() {return fgStTpcRTSHitMaker;} Int_t Init(); Int_t InitRun(Int_t runnumber); Int_t InitRun23(Int_t runnumber); Int_t Make(); -#ifdef __TFG__VERSION__ Int_t Make23(); -#endif /* __TFG__VERSION__ */ -#ifdef __USE_GAIN_FROM_FILE__ Int_t from_file(daq_dta *gain_dta, const Char_t *fname = ""); -#endif /* __USE_GAIN_FROM_FILE__ */ void PrintCld(daq_cld *cld = 0, Int_t IdTruth = 0, Int_t quality=0); void PrintAdc(daq_dta *dta = 0); + static TH2F *PlotSecRow(Int_t sec = 1, Int_t row = 1, Int_t flags = 2); private: daq_tpx *fTpx; //! daq_itpc *fiTpc; //! -#ifdef __TFG__VERSION__ tpc23_base *fTpx23; //! tpc23_base *fiTpc23; //! -#endif /* __TFG__VERSION__ */ + Int_t FixGains(tpc23_base *tpc23, Int_t sector, Int_t row, Int_t npads); // fix dead pads and edges Bool_t fNoiTPCLu; //! Double_t fminCharge; // ! minimum cluster charge in ADC Int_t maxHits[24]; Int_t maxBin0Hits; Int_t bin0Hits; + static StTpcRTSHitMaker *fgStTpcRTSHitMaker; // cvs virtual const char *GetCVS() const { static const char cvs[]="Tag $Name: $ $Id: StTpcRTSHitMaker.h,v 1.19 2021/05/10 21:13:19 fisyak Exp $ built " __DATE__ " " __TIME__ ; return cvs; diff --git a/StRoot/StTpcRSMaker/StTpcRSMaker.cxx b/StRoot/StTpcRSMaker/StTpcRSMaker.cxx index 84ebddc4005..291596a9f77 100644 --- a/StRoot/StTpcRSMaker/StTpcRSMaker.cxx +++ b/StRoot/StTpcRSMaker/StTpcRSMaker.cxx @@ -51,6 +51,8 @@ #include "StDetectorDbMaker/St_TpcPadPedRMSC.h" #include "StEventUtilities/StEbyET0.h" #include "StDetectorDbMaker/St_beamInfoC.h" +#include "StDetectorDbMaker/St_GatingGridBC.h" +#include "StDetectorDbMaker/St_starTriggerDelayC.h" #if 0 #include "StParticleTable.hh" #include "StParticleDefinition.hh" @@ -58,6 +60,7 @@ #include "Altro.h" #include "TRVector.h" #include "StBichsel/Bichsel.h" +#include "StBichsel/StdEdxModel.h" #include "StdEdxY2Maker/StTpcdEdxCorrection.h" // g2t tables #include "tables/St_g2t_track_Table.h" @@ -104,14 +107,16 @@ static Double_t fgTriggerT0 = 0; //! TPC trigger T0 (seconds) is sup static Double_t timeBinMin = -0.5; static Double_t timeBinMax = 44.5; //________________________________________________________________________________ -static const Int_t nx[2] = {200,500}; -static const Double_t xmin[2] = {-10., -6}; -static const Double_t xmax[2] = { 10., 44}; +static const Int_t nx[4] = {200,500, 145, 401}; +static const Double_t xmin[4] = {-10., -6, -0.5, -0.5}; +static const Double_t xmax[4] = { 10., 44,144.5, 400.5}; static const Int_t nz = 42; static const Double_t zmin = -210; static const Double_t zmax = -zmin; // io pt -static TProfile2D *hist[5][3] = {0}; +static TProfile2D *hist[4][2] = {0}; +static TProfile2D *PixelHist[2] = {0}; +static TProfile2D *GainHist[2] = {0}; static const Int_t nChecks = 22; static TH1 *checkList[2][22] = {0}; static TString TpcMedium("TPCE_SENSITIVE_GAS"); @@ -146,9 +151,6 @@ StTpcRSMaker::~StTpcRSMaker() { Int_t StTpcRSMaker::Finish() { // SafeDelete(fTree); if (m_SignalSum) {free(m_SignalSum); m_SignalSum = 0;} - SafeDelete(mdNdx); - SafeDelete(mdNdxL10); - SafeDelete(mdNdEL10); for (Int_t io = 0; io < 2; io++) {// Inner/Outer for (Int_t sec = 0; sec < NoOfSectors; sec++) { if (mShaperResponses[io][sec] && !mShaperResponses[io][sec]->TestBit(kNotDeleted)) {SafeDelete(mShaperResponses[io][sec]);} @@ -180,45 +182,28 @@ Int_t StTpcRSMaker::InitRun(Int_t /* runnumber */) { LOG_ERROR << "StTpcRSMaker::InitRun: mCutEle has not been found in GEANT3 for \"" << TpcMedium.Data() << "\" parameters." << "Probably due to missing Set it to default " << mCutEle << endm; } - LOG_INFO << "StTpcRSMaker:: use H.Bichsel model for dE/dx simulation" << endm; - if (! mdNdEL10 || ! mdNdx) { - const Char_t *path = ".:./StarDb/dEdxModel:./StarDb/global/dEdx" - ":./StRoot/StBichsel:$STAR/StarDb/dEdxModel:$STAR/StarDb/global/dEdx:$STAR/StRoot/StBichsel"; - const Char_t *Files[2] = {"dNdE_Bichsel.root","dNdx_Bichsel.root"}; - for (Int_t i = 0; i < 2; i++) { // Inner/Outer - Char_t *file = gSystem->Which(path,Files[i],kReadPermission); - if (! file) Fatal("StTpcRSMaker::Init","File %s has not been found in path %s",Files[i],path); - else Warning("StTpcRSMaker::Init","File %s has been found as %s",Files[i],file); - TFile *pFile = new TFile(file); - if (i == 0) {mdNdEL10 = (TH1D *) pFile->Get("dNdEL10"); assert(mdNdEL10); mdNdEL10->SetDirectory(0);} - if (i == 1) {mdNdx = (TH1D *) pFile->Get("dNdx"); assert(mdNdx); mdNdx->SetDirectory(0);} - delete pFile; - delete [] file; - } - assert(mdNdEL10 && mdNdx); - } // Distortions if (TESTBIT(m_Mode,kdEdxCorr)) { LOG_INFO << "StTpcRSMaker:: use Tpc dE/dx correction from calibaration" << endm; Long_t Mask = -1; // 64 bits CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrection); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrectionC); + CLRBIT(Mask,StTpcdEdxCorrection::kEdge); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrectionMDF); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrection3MDF); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrection4MDF); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrection5MDF); CLRBIT(Mask,StTpcdEdxCorrection::kAdcCorrection6MDF); - CLRBIT(Mask,StTpcdEdxCorrection::kEdge); CLRBIT(Mask,StTpcdEdxCorrection::kEtaCorrection); -#if 0 - CLRBIT(Mask,StTpcdEdxCorrection::kdXCorrection); + CLRBIT(Mask,StTpcdEdxCorrection::knTbk); CLRBIT(Mask,StTpcdEdxCorrection::kzCorrectionC); CLRBIT(Mask,StTpcdEdxCorrection::kzCorrection); +#if 0 + CLRBIT(Mask,StTpcdEdxCorrection::kdXCorrection); CLRBIT(Mask,StTpcdEdxCorrection::kTpcPadTBins); CLRBIT(Mask,StTpcdEdxCorrection::kTanL); CLRBIT(Mask,StTpcdEdxCorrection::kAdcI); CLRBIT(Mask,StTpcdEdxCorrection::knPad); - CLRBIT(Mask,StTpcdEdxCorrection::knTbk); CLRBIT(Mask,StTpcdEdxCorrection::kdZdY); CLRBIT(Mask,StTpcdEdxCorrection::kdXdY); #endif @@ -568,8 +553,6 @@ select firstInnerSectorAnodeWire,lastInnerSectorAnodeWire,numInnerSectorAnodeWir } // sector } // io if (Debug()) Print(); - memset (hist, 0, sizeof(hist)); - memset (checkList, 0, sizeof(checkList)); if (ClusterProfile && GetTFile()) GetTFile()->cd(); #if 0 StMagUtilities::SetDoDistortionT(gFile); @@ -590,29 +573,35 @@ select firstInnerSectorAnodeWire,lastInnerSectorAnodeWire,numInnerSectorAnodeWir {"I","Inner"}, {"O","Outer"} }; - const Name_t PadTime[3] = { - {"Pad","Pad"}, - {"Time","Time"}, - {"Row","Row"}, + const Name_t PadTime[4] = { + {"Pad","Pad - ; Z"}, + {"Time","Time - ; Z"}, + {"PixelPad","Pad ; row ; pad"}, + {"PixelTime","Time ; row ; time "}, }; for (Int_t io = 2; io < 4; io++) { for (Int_t pt = 0; pt < 2; pt++) { TString Name(InOut[io].Name); Name += PadTime[pt].Name; Name += "Mc"; - TString Title(InOut[io].Title); Title += PadTime[pt].Title; Title += "Mc"; + TString Title(InOut[io].Title); Title += PadTime[pt].Title; Title += " Mc"; hist[io][pt] = (TProfile2D *) gDirectory->Get(Name); if (! hist[io][pt]) { - hist[io][pt] = new TProfile2D(Name,Title,nx[pt],xmin[pt],xmax[pt],nz,zmin,zmax,""); - hist[io][pt]->SetMarkerStyle(20); - hist[io][pt]->SetMarkerColor(color++); + hist[io][pt] = new TProfile2D(Name,Title,nx[pt],xmin[pt],xmax[pt],nz,zmin,zmax,""); + hist[io][pt]->SetMarkerStyle(20); + hist[io][pt]->SetMarkerColor(color++); } } } - hist[4][0] = new TProfile2D("dEdxCorSecRow","dEdx correction versus sector and row", - NoOfSectors,0.5,NoOfSectors+0.5, - St_tpcPadConfigC::instance()->numberOfRows(20),0.5,St_tpcPadConfigC::instance()->numberOfRows(20)+0.5,""); - hist[4][1] = new TProfile2D("GainSecRow","Overall gain versus sector and row", - NoOfSectors,0.5,NoOfSectors+0.5, - St_tpcPadConfigC::instance()->numberOfRows(20),0.5,St_tpcPadConfigC::instance()->numberOfRows(20)+0.5,""); + GainHist[0] = new TProfile2D("dEdxCorSecRow","dEdx correction ; sector ; row", + NoOfSectors,0.5,NoOfSectors+0.5, + St_tpcPadConfigC::instance()->numberOfRows(20),0.5,St_tpcPadConfigC::instance()->numberOfRows(20)+0.5,""); + GainHist[1] = new TProfile2D("GainSecRow","Overall gain ; sector ; row", + NoOfSectors,0.5,NoOfSectors+0.5, + St_tpcPadConfigC::instance()->numberOfRows(20),0.5,St_tpcPadConfigC::instance()->numberOfRows(20)+0.5,""); + for (Int_t pt = 0; pt < 2; pt++) { + TString Name(PadTime[pt+2].Name); + TString Title(PadTime[pt+2].Title); Title += " Mc"; + PixelHist[pt] = new TProfile2D(Name,Title, 72, 0.5, 72.5, nx[pt+2],xmin[pt+2],xmax[pt+2],""); + } const Name_t Checks[22] = { {"dEGeant","dE in Geant"}, // 0 {"dSGeant","ds in Geant"}, // 1 @@ -633,9 +622,9 @@ select firstInnerSectorAnodeWire,lastInnerSectorAnodeWire,numInnerSectorAnodeWir {"dS","dS"}, // 16 {"adc","adc"},// 17 {"NE","Total no. of generated electors"}, // 18 - {"dECl","Total log(signal/Nt) in a cluster versus Wire Index"}, // 19 - {"nPdT","log(Total no. of conducting electrons) - log(no. of primary one) versus log(no. primary electrons)"}, // 20 - {"bgVsbg","log10(bg_from_gkin) versus log10(bg_from_mom"} // 21 + {"dECl","Total log(signal/Nt) in a cluster ; Wire Index"}, // 19 + {"nPdT","log(Total no. of conducting electrons) - log(no. of primary one) ; log(no. primary electrons)"}, // 20 + {"bgVsbg","log10(bg_from_gkin) ; log10(bg_from_mom"} // 21 }; const Int_t Npbins = 151; const Int_t NpbinsL = 10; @@ -817,9 +806,6 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); continue; } } // special treatment for electron/positron - Int_t qcharge = charge; - if (ipart == 2) qcharge = 101; - if (ipart == 3) qcharge = -101; // Track segment to propagate enum {NoMaxTrackSegmentHits = 100}; static HitPoint_t TrackSegmentHits[NoMaxTrackSegmentHits]; @@ -927,18 +913,22 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); checkList[io][3]->Fill(TrackSegmentHits[iSegHits].xyzG.position().z(),Gain); } // dE/dx correction - Double_t dEdxCor = dEdxCorrection(TrackSegmentHits[iSegHits]); + Double_t dEdxCor = 1.0; + if (TrackSegmentHits[iSegHits].coorLS.position().z() < -0.6) {// prompt hist + dEdxCor = 1.0; + } else { + dEdxCor = dEdxCorrection(TrackSegmentHits[iSegHits]); + } #ifdef __DEBUG__ if (TMath::IsNaN(dEdxCor)) { iBreak++; } #endif - if (dEdxCor <= 0.) continue; + if (dEdxCor < minSignal) continue; if (ClusterProfile) { checkList[io][4]->Fill(TrackSegmentHits[iSegHits].xyzG.position().z(),dEdxCor); - hist[4][0]->Fill(TrackSegmentHits[iSegHits].Pad.sector(),TrackSegmentHits[iSegHits].Pad.row(),dEdxCor); + GainHist[0]->Fill(TrackSegmentHits[iSegHits].Pad.sector(),TrackSegmentHits[iSegHits].Pad.row(),dEdxCor); } - if (dEdxCor < minSignal) continue; // Initialize propagation Float_t BField[3] = {(Float_t ) TrackSegmentHits[iSegHits].BLS.position().x(), (Float_t ) TrackSegmentHits[iSegHits].BLS.position().y(), @@ -1001,9 +991,9 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); Double_t tbkH = TrackSegmentHits[iSegHits].Pad.timeBucket(); tpc_hitC->pad = padH; tpc_hitC->timebucket = tbkH; - pad0 = TMath::Nint(padH + xmin[0]); - tbk0 = TMath::Nint(tbkH + xmin[1]); - Double_t OmegaTau =St_TpcResponseSimulatorC::instance()->OmegaTau()* + pad0 = TMath::Max(1,TMath::Nint(padH + xmin[0])); + tbk0 = TMath::Max(0,TMath::Nint(tbkH + xmin[1])); + Double_t OmegaTau = St_TpcResponseSimulatorC::instance()->OmegaTau()* TrackSegmentHits[iSegHits].BLS.position().z()/5.0;// from diffusion 586 um / 106 um at B = 0/ 5kG Double_t NP = TMath::Abs(tpc_hitC->de)/(St_TpcResponseSimulatorC::instance()->W()*eV* St_TpcResponseSimulatorC::instance()->Cluster()); // from GEANT @@ -1038,14 +1028,7 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); mGainLocal = Gain/dEdxCor/NoElPerAdc; // Account dE/dx calibration // end of dE/dx correction // generate electrons: No. of primary clusters per cm - if (mdNdx || mdNdxL10) { - NP = GetNoPrimaryClusters(betaGamma,qcharge); // per cm -#ifdef __DEBUG__ - if (NP <= 0.0) { - iBreak++; continue; - } -#endif - } + NP = StdEdxModel::instance()->dNdx(betaGamma,charge); // per cm if (ClusterProfile) { checkList[io][7]->Fill(TrackSegmentHits[iSegHits].xyzG.position().z(),NP); } @@ -1057,12 +1040,9 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); Float_t dS = 0; Float_t dE = 0; NP = tpc_hitC->dNdx; - static Double_t cLog10 = TMath::Log(10.); if (charge) { dS = zIntDr/NP; - if (mdNdEL10) dE = TMath::Exp(cLog10*mdNdEL10->GetRandom()); - else dE = St_TpcResponseSimulatorC::instance()->W()* - gRandom->Poisson(St_TpcResponseSimulatorC::instance()->Cluster()); + dE = StdEdxModel::instance()->dNdE(); } else { // charge == 0 geantino // for Laserino assume dE/dx = 25 keV/cm; dE = 10; // eV @@ -1121,8 +1101,6 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); TotalSignalInCluster = 0; Int_t WireIndex = 0; for (Int_t ie = 0; ie < Nt; ie++) { - tpc_hitC->ne++; - QAv = mPolya[io]->GetRandom(); // transport to wire gRandom->Rannor(rX,rY); StTpcLocalSectorCoordinate xyzE(xyzC.x()+rX*sigmaT, @@ -1141,6 +1119,19 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); #endif TCL::vadd(xyzE.position().xyz(),xyzR.GetArray(),xyzE.position().xyz(),3); } + // Check Gatting Grid + Double_t zGG = xyzE.position().z(); + Double_t GGTransperency = 1.0; + if (zGG > -0.6) { // non Prompt hits before Cathode wire plane + Double_t driftTime = 1e6*zGG/driftVelocity; // usec + driftTime -= St_starTriggerDelayC::instance()->TrigT0GG(io); // trigger delay + Gating Grid cables + Double_t lGGTransperency = St_GatingGridBC::instance()->CalcCorrection(0,driftTime); + if (lGGTransperency < -9) continue; + GGTransperency = TMath::Exp(lGGTransperency); + if (GGTransperency < minSignal) continue; + } + tpc_hitC->ne++; + QAv = GGTransperency*mPolya[io]->GetRandom(); Double_t y = xyzE.position().y(); Double_t alphaVariation = InnerAlphaVariation[sector-1]; // Transport to wire @@ -1219,12 +1210,16 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); if (ClusterProfile) { if (TotalSignal > 0) { if (hist[ioH][0]) { - for (Int_t p = 0; p < kPadMax; p++) + for (Int_t p = 0; p < kPadMax; p++) { hist[ioH][0]->Fill((p+pad0)-padH,TrackSegmentHits[iSegHits].xyzG.position().z(),padsdE[p]/TotalSignal); + PixelHist[0]->Fill(row, p+pad0,padsdE[p]/TotalSignal); + } } if (hist[ioH][1]) { - for (Int_t t = 0; t < kTimeBacketMax; t++) + for (Int_t t = 0; t < kTimeBacketMax; t++) { hist[ioH][1]->Fill((t+tbk0+0.5)-tbkH,TrackSegmentHits[iSegHits].xyzG.position().z(),tbksdE[t]/TotalSignal); + PixelHist[1]->Fill(row, (t+tbk0+0.5),tbksdE[t]/TotalSignal); + } } } checkList[io][15]->Fill(TrackSegmentHits[iSegHits].xyzG.position().z(),tpc_hitC->de); @@ -1277,37 +1272,6 @@ Int_t StTpcRSMaker::Make(){ // PrintInfo(); return kStOK; } //________________________________________________________________________________ -Double_t StTpcRSMaker::GetNoPrimaryClusters(Double_t betaGamma, Int_t charge) { - Double_t beta = betaGamma/TMath::Sqrt(1.0 + betaGamma*betaGamma); -#if defined(Old_dNdx_Table) - Double_t dNdx = 1.21773e+01*Bichsel::Instance()->GetI70M(TMath::Log10(betaGamma)); -#else -#if defined(ElectronHack) - Int_t elepos = charge/100; - Double_t dNdx = 0; - if (mdNdx ) dNdx = mdNdx->Interpolate(betaGamma); - else if (mdNdxL10) dNdx = mdNdxL10->Interpolate(TMath::Log10(betaGamma)); - if (elepos) { - dNdx += 1.21773e+01*Bichsel::Instance()->GetI70M(TMath::Log10(betaGamma)); - dNdx /= 2; - } -#else /* new H.Bichsel dNdx table 09/12/11 */ - Double_t dNdx = 0; - if (mdNdx ) dNdx = mdNdx->Interpolate(betaGamma); - else if (mdNdxL10) dNdx = mdNdxL10->Interpolate(TMath::Log10(betaGamma)); -#endif /* Old_dNdx_Table || ElectronHack */ -#endif - Double_t Q_eff = TMath::Abs(charge%100); - if (Q_eff > 1) { - // Effective charge from GEANT gthion.F - Double_t w1 = 1.034 - 0.1777*TMath::Exp(-0.08114*Q_eff); - Double_t w2 = beta*TMath::Power(Q_eff,-2./3.); - Double_t w3 = 121.4139*w2 + 0.0378*TMath::Sin(190.7165*w2); - Q_eff *= 1. -w1*TMath::Exp(-w3); - } - return Q_eff*Q_eff*dNdx; -} -//________________________________________________________________________________ Double_t StTpcRSMaker::ShaperFunc(Double_t *x, Double_t *par) { Double_t tau = par[0]; Double_t width = par[1]; @@ -2059,7 +2023,7 @@ void StTpcRSMaker::GenerateSignal(HitPoint_t &TrackSegmentHits, Int_t sector, In } if (ClusterProfile) { checkList[io][12]->Fill(TrackSegmentHits.xyzG.position().z(),gain); - hist[4][1]->Fill(sector,row,gain); + GainHist[1]->Fill(sector,row,gain); } // Double_t localXDirectionCoupling = localXDirectionCouplings[pad-padMin]; Double_t localXDirectionCoupling = gain*XDirectionCouplings[pad-padMin]; @@ -2181,324 +2145,3 @@ Double_t StTpcRSMaker::dEdxCorrection(HitPoint_t &TrackSegmentHits) { } //________________________________________________________________________________ #undef PrPP -//________________________________________________________________________________ -// $Id: StTpcRSMaker.cxx,v 1.92 2020/05/22 20:49:19 fisyak Exp $ -// $Log: StTpcRSMaker.cxx,v $ -// Revision 1.92 2020/05/22 20:49:19 fisyak -// Wrong alarm, take it back -// -// Revision 1.91 2020/05/22 20:15:15 fisyak -// Fix bug in fgTriggerT0 (seconds <=> microseconds) -// -// Revision 1.90 2020/05/17 15:43:49 fisyak -// Acount StTpcBXT0CorrEPDC correction -// -// Revision 1.89 2019/05/22 21:30:58 fisyak -// Fix bug3390 (thanks to Irakli), add St_TpcAdcCorrectionMDF -// -// Revision 1.88 2019/04/29 20:11:21 fisyak -// Fix for TrackDirection, add extra correction for the 1st pad row -// -// Revision 1.87 2019/04/18 14:02:23 fisyak -// Keep hits with bad dE/dx information, revisit handling of pedRMS for Tpx and iTPC -// -// Revision 1.86 2018/12/16 14:26:30 fisyak -// Switch off DEBUG, use local position for phi correction -// -// Revision 1.85 2018/12/09 23:22:59 fisyak -// Reshape -// -// Revision 1.84 2018/11/29 22:19:49 fisyak -// Restore __STOPPED_ELECTRONS__, split for Inner and Outer sectors, adjusted gain for Run XVIII -// -// Revision 1.83 2018/11/20 19:51:15 fisyak -// Temporarely disable __STOPPED_ELECTRONS__ to check effect of this on no. of primary tracks for 2010 AuAu200 sample -// -// Revision 1.82 2018/11/05 01:05:19 fisyak -// Replace assert to error message -// -// Revision 1.81 2018/11/01 13:27:20 fisyak -// Synchronize mCutEle with GEANT3 tracking media setting for TPCE_SENSITIVE_GAS, bug#3369 -// -// Revision 1.80 2018/10/17 20:45:28 fisyak -// Restore update for Run XVIII dE/dx calibration removed by Gene on 08/07/2018 -// -// Revision 1.77 2018/02/18 21:08:54 perev -// Move back DSmirnov correction -// -// Revision 1.75 2017/02/14 23:40:35 fisyak -// Add new Table to correct dE/dx pad dependence, 2017 dAu20-62 calibration -// -// Revision 1.74 2016/12/29 16:30:56 fisyak -// make switch to account __STOPPED_ELECTRONS__ -// -// Revision 1.73 2016/12/19 15:22:39 fisyak -// Fix typo -// -// Revision 1.72 2016/12/19 15:20:20 fisyak -// Fix bug 3268: add missing correction for TpcAvgPowerSupply, add treatment for stopping electrons and gammas -// -// Revision 1.71 2016/09/18 22:45:25 fisyak -// Clean up, add Heed model, adjust for new StTpcdEdxCorrections -// -// Revision 1.71 2015/10/08 13:58:45 fisyak -// Add requirement for Check Plots for TTree file -// -// Revision 1.70 2015/07/19 22:14:07 fisyak -// Clean up __PAD_BLOCK__, recalculate no. of real hits in g2t_track n_tpc_hitC (excluding pseudo pad row), add current and accumulated charge in dE/dx correction -// -// Revision 1.69 2014/10/21 15:33:48 fisyak -// Clean up, fix bug found by gcc482 -// -// Revision 1.68 2014/07/27 13:26:26 fisyak -// Add cast for c++11 option -// -// Revision 1.67 2013/02/01 15:54:09 fisyak -// Add handle for separate Inner and Outer sector time off set -// -// Revision 1.66 2012/11/13 20:46:16 fisyak -// Add wider Voltage range for accepted clusteds (-500V) than for dEdx calculation -// -// Revision 1.65 2012/10/23 20:08:57 fisyak -// Add corrections for iTpx upgrade -// -// Revision 1.64 2012/09/27 19:17:02 fisyak -// Fix missing declaration -// -// Revision 1.63 2012/09/27 16:14:43 fisyak -// Change debug print out scheme -// -// Revision 1.62 2012/09/13 21:54:43 fisyak -// replace elsif by else and if -// -// Revision 1.61 2012/09/13 21:02:52 fisyak -// Corrections for iTpx -// -// Revision 1.60 2012/06/04 15:14:18 fisyak -// restore old hack for dN/dx table to fix bug #2347 -// -// Revision 1.59 2012/05/07 15:36:22 fisyak -// Remove hardcoded TPC parameters -// -// Revision 1.58 2012/04/03 14:05:18 fisyak -// Speed up using GetSaveL (__PAD_BLOCK__), sluggish shape histograms, Heed electron generation -// -// Revision 1.57 2011/12/23 16:38:25 fisyak -// Remove __DEBUG__ and __ClusterProfile__ from default, reduce arrays and add check for bounds -// -// Revision 1.55 2011/12/20 21:09:56 fisyak -// change defaults: shark measurements: old default => 46.6%, wire histograms => 38.9%, wire map => 12.5 + 10.2, pad block => 15% -// -// Revision 1.54 2011/12/13 17:23:22 fisyak -// remove YXTProd, add WIREHISTOGRAM and WIREMAP, use particle definition from StarClassLibrary -// -// Revision 1.53 2011/10/14 23:27:51 fisyak -// Back to standard version -// -// Revision 1.51 2011/09/21 15:34:31 fisyak -// Restore K3IP parameter -// -// Revision 1.50 2011/09/18 22:39:48 fisyak -// Extend dN/dx table (H.Bichsel 09/12/2011) to fix bug #2174 and #2181, clean-up -// -// Revision 1.49 2011/04/05 20:55:02 fisyak -// Fix betaMin calculations (thanx VP) -// -// Revision 1.48 2011/03/17 14:29:31 fisyak -// Add extrapolation in region beta*gamma < 0.3 -// -// Revision 1.47 2011/03/13 15:46:44 fisyak -// Replace step function by interpolation for dN/dx versus beta*gamma -// -// Revision 1.46 2011/02/23 20:14:31 perev -// Hack to avoid sqrt(-) -// -// Revision 1.45 2010/12/16 15:36:07 fisyak -// cut hits outside time buckets range -// -// Revision 1.44 2010/12/01 20:59:46 fisyak -// Remove special treatment for delta-electrons, this will cause that IdTruth for cluster will be degradated because charge from delta-electrons will be accounted with delta-electons track Id but not with original particle Id as was before -// -// Revision 1.43 2010/10/28 23:42:34 fisyak -// extra t0 off set for Altro chip -// -// Revision 1.42 2010/10/22 18:13:33 fisyak -// Add fix from Lokesh AuAu7 2010 embdedding -// -// Revision 1.41 2010/09/01 23:12:01 fisyak -// take out __ClusterProfile__ -// -// Revision 1.40 2010/06/14 23:34:26 fisyak -// Freeze at Version V -// -// Revision 1.39 2010/05/24 16:11:03 fisyak -// Return back to time simulation for each pad, organize parameters into TpcResponseSimulator table -// -// Revision 1.38 2010/04/24 19:58:54 fisyak -// swap shift sign -// -// Revision 1.37 2010/04/24 15:56:32 fisyak -// Jan found shift in z by one time bucket -// -// Revision 1.36 2010/04/20 13:56:24 fisyak -// Switch off __ClusterProfile__ -// -// Revision 1.35 2010/04/16 19:29:35 fisyak -// W is in eV now -// -// Revision 1.34 2010/04/01 22:17:06 fisyak -// Add checking for TPC is switched off at all and stop if so -// -// Revision 1.33 2010/03/22 23:45:05 fisyak -// Freeze version with new parameters table -// -// Revision 1.32 2010/03/16 19:41:46 fisyak -// Move diffusion and sec/row correction in DB, clean up -// -// Revision 1.31 2010/03/02 21:10:27 fisyak -// Make aware about TpcRDOMasks -// -// Revision 1.30 2010/02/26 18:53:33 fisyak -// Take longitudinal Diffusion from Laser track fit, add Gating Grid -// -// Revision 1.29 2010/02/16 00:21:23 fisyak -// Speed up by a factor 3.5 by ignoring individual pad T0 -// -// Revision 1.28 2010/01/26 19:47:25 fisyak -// Include dE/dx calibration and distortions in the simulation -// -// Revision 1.27 2009/11/25 21:32:52 fisyak -// Comment out cluster profile histograms -// -// Revision 1.26 2009/11/03 22:38:53 fisyak -// Freeze version rcf9108.J -// -// Revision 1.25 2009/10/30 21:12:00 fisyak -// Freeze version rcf9108.F, Clean up -// -// Revision 1.24 2009/10/26 18:50:58 fisyak -// Clean up from Bichel's stuff -// -// Revision 1.23 2009/10/12 23:54:12 fisyak -// Restore T0Jitter, remove differential in Tpx signal -// -// Revision 1.22 2009/10/03 21:29:09 fisyak -// Clean up, move all TpcT related macro into StTpcMcAnalysisMaker -// -// Revision 1.21 2009/10/01 14:53:06 fisyak -// Add T0Jitter -// -// Revision 1.20 2009/09/27 01:30:48 fisyak -// Restate T0Jitter -// -// Revision 1.19 2009/09/27 01:24:58 fisyak -// Restate T0Jitter -// -// Revision 1.18 2009/09/21 13:20:39 fisyak -// Variant O4, no mSigmaJitter, 100 keV -// -// Revision 1.17 2009/09/01 15:06:44 fisyak -// Version N -// -// Revision 1.16 2009/08/25 20:39:40 fisyak -// Variant K -// -// Revision 1.15 2009/08/25 15:45:58 fisyak -// Version J -// -// Revision 1.14 2009/08/24 20:16:41 fisyak -// Freeze with new Altro parameters -// -// Revision 1.13 2008/12/29 15:24:54 fisyak -// Freeze ~/WWW/star/Tpc/TpcRS/ComparisonMIP31 -// -// Revision 1.12 2008/12/18 23:06:37 fisyak -// Take care about references to TGiant -// -// Revision 1.11 2008/12/12 21:41:41 fisyak -// Freeze -// -// Revision 1.10 2008/10/06 19:10:23 fisyak -// BichlePPMIP3 -// -// Revision 1.9 2008/10/03 20:25:29 fisyak -// Version BichselMIP2 -// -// Revision 1.8 2008/08/19 16:01:15 fisyak -// Version 21 -// -// Revision 1.7 2008/08/18 15:54:25 fisyak -// Version 20 -// -// Revision 1.6 2008/07/30 23:53:19 fisyak -// Freeze -// -// Revision 1.5 2008/07/18 16:22:50 fisyak -// put a factor 2.5 for tauIntegration -// -// Revision 1.3 2008/06/25 20:02:32 fisyak -// The first set of parametrs for Altro, Remove gains for the moment -// -// Revision 1.2 2008/06/19 22:45:43 fisyak -// Freeze problem with TPX parameterization -// -// Revision 1.1.1.1 2008/04/28 14:39:47 fisyak -// Start new Tpc Response Simulator -// -// Revision 1.20 2008/04/24 10:42:03 fisyak -// Fix binning issues -// -// Revision 1.19 2008/04/04 15:00:11 fisyak -// Freeze before shaper modifications -// -// Revision 1.18 2005/02/07 21:40:31 fisyak -// rename antique TGeant3 to TGiant3 -// -// Revision 1.17 2005/01/26 23:28:38 fisyak -// Check boundary for sorted tpc_hit array -// -// Revision 1.16 2005/01/26 21:45:31 fisyak -// Freeze correction made in June -// -// Revision 1.14 2004/06/04 17:09:02 fisyak -// Change tau in Chaper and OmegaTau for gas -// -// Revision 1.13 2004/05/29 21:16:27 fisyak -// Fix pad direction, add sorting for ADC/cluster nonlinearity, replace product by sum of logs -// -// Revision 1.12 2004/05/17 19:45:08 fisyak -// Clean up, add pseudo padrows -// -// Revision 1.11 2004/05/05 17:41:52 fisyak -// Take K3 from E.Mathieson book -// -// Revision 1.10 2004/05/04 13:39:06 fisyak -// Add TF1 -// -// Revision 1.9 2004/05/02 20:54:18 fisyak -// fix t0 offset -// -// Revision 1.8 2004/04/22 01:05:03 fisyak -// Freeze the version before modification parametrization for K3 -// -// Revision 1.7 2004/04/12 14:30:07 fisyak -// Propagate cluster as a whole -// -// Revision 1.6 2004/04/06 01:50:13 fisyak -// Switch from Double_t to Float_t for sum -// -// Revision 1.5 2004/03/30 19:30:04 fisyak -// Add Laser -// -// Revision 1.4 2004/03/21 19:00:43 fisyak -// switch to GEANT step length -// -// Revision 1.3 2004/03/20 17:57:15 fisyak -// Freeze the version of PAI model -// -// Revision 1.2 2004/03/17 20:47:43 fisyak -// Add version with TrsCluster TTree -// -// Revision 1.1.1.1 2004/03/05 20:51:25 fisyak -// replacement for Trs -// diff --git a/StRoot/StTpcRSMaker/StTpcRSMaker.h b/StRoot/StTpcRSMaker/StTpcRSMaker.h index 66e3bbf6c60..ada9282164b 100644 --- a/StRoot/StTpcRSMaker/StTpcRSMaker.h +++ b/StRoot/StTpcRSMaker/StTpcRSMaker.h @@ -58,7 +58,6 @@ class StTpcRSMaker : public StMaker { TF1 *GetTimeShape0(Int_t io = 0) {return fgTimeShape0[io];} TF1 *GetTimeShape3(Int_t io = 0) {return fgTimeShape3[io];} TF1 *GetHeed() {return mHeed;} - Double_t GetNoPrimaryClusters(Double_t betaGamma, Int_t charge); virtual void Print(Option_t *option="") const; StTpcDigitalSector *DigitizeSector(Int_t sector); void SetLaserScale(Double_t m=1) {mLaserScale = m;} @@ -100,9 +99,6 @@ class StTpcRSMaker : public StMaker { Char_t beg[1]; //! TTree *fTree; //! SignalSum_t *m_SignalSum; //! - TH1D* mdNdx; //! - TH1D* mdNdxL10; //! - TH1D* mdNdEL10; //! TF1F *mShaperResponses[2][24]; //! TF1F *mChargeFraction[2][24]; //! TF1F *mPadResponseFunction[2][24]; //! diff --git a/StRoot/StXTrakMaker/StXTrak.cxx b/StRoot/StXTrakMaker/StXTrak.cxx deleted file mode 100644 index ffebef0f71b..00000000000 --- a/StRoot/StXTrakMaker/StXTrak.cxx +++ /dev/null @@ -1,238 +0,0 @@ -// $Id: StXTrak.cxx,v 1.5 2016/08/05 18:10:37 perev Exp $ -/// \File StXTrak.cxx -/// \author V.Perev 2016 -// -/*! - -\class StXTrak - -A class StXTrak is a auxiliary for Sti/StiCA/Stv packages. -
-Main tasks: -
    -
  • Xtend/prolong StTrack to far detector; -
  • Save produced data into StEvent. -
-*/ -#include -#include -#include -#include "TMath.h" -#include "TCernLib.h" -#include "TVector3.h" -#include "StXTrak.h" -#include "TGeoManager.h" -#include "TGeoSwim.h" -#include "TGeoManager.h" -#include "TGeoNode.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoMaterial.h" -#include "StThreeVectorD.hh" -#include "THelixTrack.h" -#include "StiUtilities/StiDebug.h" - -#include "StiUtilities/StiDebug.h" - -//_____________________________________________________________________________ -StXTrak::StXTrak(MyMag *myMag,MyLoss* eLoss,TGeoSwimEnd* myEnd) -{ - mMyLoss= eLoss; //ELoss calculator - if (!mMyLoss) mMyLoss = new MyLoss(); - - mMyMag = myMag; //Mag field calculator - if (!mMyMag) mMyMag = new MyMag(); - - - mMyEnd = myEnd; //End condition - - static const char* farDets[]={ - "BTOF","BBCA","CALB","ECAL","ETTV", - "FGTM","FBOX","FSCE","HCMO","MUTD", - "PHMD","VPDD","ZCAL", - 0}; - - if (!mMyEnd ) mMyEnd = new TGeoSwimDefaultEnd(TGeoSwimEnd::kNameVolu,farDets); - - mSwim = new TGeoSwim(); - mSwim->Set(mMyMag,mMyLoss,mMyEnd); - mSwim->Set(500.,-400.,400.,5.); - - mMass = 0.1349766; - if (mMyLoss) mMass = mMyLoss->GetMass(); -} - -//_____________________________________________________________________________ -void StXTrak::Clear() -{ - memset(mBeg,0,mEnd-mBeg+1); -} - -//_____________________________________________________________________________ -void StXTrak::Set1stPoint(int charge1st,double pos1st[3],double mom1st[3]) -{ -static const double kHftRad = 3; -enum {kUndef, kPrimary, kDca,k1stPoint}; - - memcpy(m1stTk.mPos,pos1st,sizeof(m1stTk.mPos)); - memcpy(m1stTk.mMom,mom1st,sizeof(m1stTk.mMom)); - m1stTk.mCosLam = sin(TVector3(m1stTk.mMom).Theta()); - m1stTk.mCharge=charge1st; - TVector3 vMom(m1stTk.mMom),vPos(m1stTk.mPos); - double B[3]; - (*mMyMag)(m1stTk.mPos,B); - m1stTk.mCurv= -B[2]*m1stTk.mCharge/vMom.Perp(); - m1stTk.mP = vMom.Mag();; - m1stTk.mPti = -m1stTk.mCharge/vMom.Perp(); - m1stTk.mPt = 1./(fabs(m1stTk.mPti)+1e-10); - m1stTk.mLen= 0; - double dis = vPos.Perp(); - mFlag1st=k1stPoint; //0=undefined, 1=primary, 2=dca,3=1st point - if (dis1e-3)? fabs(asin(sinAlf)*2./m1stTk.mCurv):dis; - m1stTk.mLen/= m1stTk.mCosLam; - } -} - - - -//_____________________________________________________________________________ -void StXTrak::Set2ndPoint(int charge2nd,double pos2nd[3],double mom2nd[3]) -{ - memcpy(m2ndTk.mPos,pos2nd,sizeof(m2ndTk.mPos)); - memcpy(m2ndTk.mMom,mom2nd,sizeof(m2ndTk.mMom)); - m2ndTk.mCosLam = sin(TVector3(m2ndTk.mMom).Theta()); - m2ndTk.mCharge=charge2nd; - TVector3 vPos(m2ndTk.mPos); - TVector3 vMom(m2ndTk.mMom); - TVector3 dPos = (vPos - TVector3(m1stTk.mPos)); - TVector3 aMom = (vMom + TVector3(m1stTk.mMom))*0.5; - - - double B[3]; - (*mMyMag)(m2ndTk.mPos,B); - m2ndTk.mCurv= -B[2]*m2ndTk.mCharge/vMom.Perp(); - m2ndTk.mP = vMom.Mag();; - m2ndTk.mPti = -m2ndTk.mCharge/vMom.Perp(); - m2ndTk.mPt = 1./(fabs(m2ndTk.mPti)+1e-10); - m2ndTk.mLen= 0; - double curv = (fabs(m1stTk.mCurv)>0)?(m1stTk.mCurv+m2ndTk.mCurv)*0.5 - :( m2ndTk.mCurv); - double dis = dPos.Perp(); - double sinAlf = dis*curv/2; - m2ndTk.mLen = (fabs(sinAlf)>1e-3)? fabs(asin(sinAlf)*2./curv):dis; - double cosLam = (fabs(m1stTk.mCosLam)>0) ? (m1stTk.mCosLam+m2ndTk.mCosLam)*0.5 - : ( m2ndTk.mCosLam); - m2ndTk.mLen/= cosLam; - m2ndTk.mLen+=m1stTk.mLen; - - mCurTk = m2ndTk; - double P1 = m1stTk.mP; - double P2 = m2ndTk.mP; - double betInv1 = sqrt(1.+mMass*mMass/(P1*P1)); - double betInv2 = sqrt(1.+mMass*mMass/(P2*P2)); - double betInv = 0.5*(betInv1+betInv2); - mAveBeta = 1./betInv; - assert(mAveBeta<1); - mAveMom = mMass*mAveBeta/sqrt(1-mAveBeta*mAveBeta); - -} -//_____________________________________________________________________________ -double StXTrak::Get2ndTimeF() const -{ - double betInv = 1./mAveBeta; - return m2ndTk.mLen*betInv/TMath::C(); -} -//_____________________________________________________________________________ -double StXTrak::GetTimeF() const -{ - return Get2ndTimeF()+mSwim->GetTime(); -} -//_____________________________________________________________________________ -void StXTrak::SetLen2nd(double length) -{ - m2ndTk.mLen = length + m1stTk.mLen; - mCurTk.mLen = m2ndTk.mLen; -} - -//_____________________________________________________________________________ -int StXTrak::Next() -{ - - mSwim->Set(mCurTk.mPos,mCurTk.mMom,mCurTk.mCurv); - auto ans = mSwim->Swim(500); - - memcpy(mCurTk.mPos,mSwim->GetPos(),sizeof(mCurTk.mPos)); - memcpy(mCurTk.mMom,mSwim->GetDir(),sizeof(mCurTk.mMom)); - mCurTk.mCurv = mSwim->GetCurv(); - mCurTk.mP = mSwim->GetP(); - mCurTk.mPt = mSwim->GetPt(); - mCurTk.mPti = mSwim->GetPti(); - mCurTk.mLen+= mSwim->GetLen(); - mCurTk.mPLoss = mSwim->GetPLoss(); - double d = mSwim->GetLen(1)-mSwim->GetLen(0); - StiDebug::Count("Thick",d); - return ans; -} -#include "StarMagField/StarMagField.h" -//______________________________________________________________________________ -/*! Calculates mag field - Field is calcualated via StarMagField class -*/ -void MyMag::operator()(const double x[3],double b[3]) -{ - -static const double EC = 2.99792458e-4; -static StarMagField *magf = StarMagField::Instance(); - magf->BField(x,b); - b[0]*=EC; - b[1]*=EC; - b[2]*=EC; -} - -#if 0 -#include "StvUtil/StvELossTrak.h" -MyLoss::MyLoss() -{ - mELoss = new StvELossTrak; - mELoss->Reset(1); -} - - -double MyLoss::operator()(const TGeoMaterial* mate,double P,double len - ,double *theta2) -{ - mELoss->Reset(1); - mELoss->Set(mate,P); - mELoss->Add(len); - double dP = mELoss->PLoss(P); - if (theta2){}; - return dP; -} -#endif -#if 1 -#include "Sti/StiElossCalculator.h" -MyLoss::MyLoss() -{ - mELoss = new StiElossCalculator; -} - - -double MyLoss::operator()(const TGeoMaterial* gmate,double P,double len - ,double *theta2) -{ - double A = gmate->GetA(),Z=gmate->GetZ(),D=gmate->GetDensity(); -//double X0=gmate->GetRadLen(); - mELoss->set(Z/A,0,A,Z,D); - double beta2 = P*P/(P*P+mMass*mMass); - double dedx = mELoss->calculate(1., mMass,beta2); - double dP = dedx*len*sqrt(1+pow(mMass/P,2)); - if (theta2){}; - return dP; -} - -#endif diff --git a/StRoot/StXTrakMaker/StXTrak.h b/StRoot/StXTrakMaker/StXTrak.h deleted file mode 100644 index c6140265b6a..00000000000 --- a/StRoot/StXTrakMaker/StXTrak.h +++ /dev/null @@ -1,107 +0,0 @@ -//StXTrak.h - -#ifndef StXTrak_HH -#define StXTrak_HH -#include "TGeoSwim.h" -class TGeoSwim; -class MyMag; -class MyLoss; - - -class StXTrakAux -{ -public: -double mPos[3]; -double mMom[3]; -double mCosLam; -double mCurv; -double mP; -double mPt; -double mPti; -double mLen; -double mPLoss; -double mTimeF; -int mCharge; -}; -class StXTrak -{ - public: - - StXTrak(MyMag* myMag=0,MyLoss* eLoss=0,TGeoSwimEnd* myEnd=0); - virtual ~StXTrak(){;} - - void Clear(); - void Set1stPoint(int charge1st,double pos1st[3],double mom1st[3]); - void Set2ndPoint(int charge2nd,double pos2nd[3],double mom2nd[3]); - void SetLen2nd (double length); - - StXTrakAux &GetAux(int idx=3) {return (&m1stTk)[idx-1];} -const StXTrakAux &GetAux(int idx=3) const {return (&m1stTk)[idx-1];} - double Get2ndTimeF() const; - double GetTimeF() const; - double GetMass() const {return mMass;} - double GetLen (int idx=3) const {return GetAux(idx).mLen;} -const char *GetName() const {return (mMyEnd)?mMyEnd->GetName():"" ;} -TGeoSwimMag *GetMag() {return mMyMag;} - - int Next(); -//========================= - - protected: - TGeoSwim* mSwim; //Swimmer - TGeoSwimMag* mMyMag; - TGeoSwimLoss* mMyLoss; - TGeoSwimEnd* mMyEnd; - private: -double mMass; - -char mBeg[1]; -int mFlag1st; //0=undefined, 1=primary, 2=dca,3=1st point -double mAveBeta; //ave beta used for timing -double mAveMom; //ave momentum used for timing -StXTrakAux m1stTk; -StXTrakAux m2ndTk; -StXTrakAux mCurTk; - - -char mEnd[1]; - -}; - -class MyMag: public TGeoSwimMag -{ -public: - MyMag(){} - virtual void operator()(const double* x, double* b); -}; - -#if 0 -class StvELossTrak; -class MyLoss: public TGeoSwimLoss { -public: -MyLoss(); -// returns momentum loss -virtual double operator()(const TGeoMaterial* mate,double P,double len - ,double *theta2=0); -protected: -StvELossTrak *mELoss; -}; -#endif -#if 1 -class StiElossCalculator; -class MyLoss: public TGeoSwimLoss { -public: -MyLoss(); -// returns momentum loss -virtual double operator()(const TGeoMaterial* mate,double P,double len - ,double *theta2=0); -protected: -StiElossCalculator *mELoss; -}; -#endif - - - - - -#endif diff --git a/StRoot/StXTrakMaker/StXTrakMaker.cxx b/StRoot/StXTrakMaker/StXTrakMaker.cxx deleted file mode 100644 index 1d34eca78aa..00000000000 --- a/StRoot/StXTrakMaker/StXTrakMaker.cxx +++ /dev/null @@ -1,221 +0,0 @@ -// $Id: StXTrakMaker.cxx,v 1.10 2018/10/06 23:42:55 perev Exp $ -/// \File StXTrakMaker.cxx -/// \author V.Perev 2016 -// -/*! - -\class StXTrakMaker - -A maker StXTrakMaker is a auxiliary maker for Sti/StiCA/Stv packages. -
-Main tasks: -
    -
  • Xtend/prolong StTrack to far detector; -
  • Save produced data into StEvent. -
-*/ -#include -#include -#include -#include "TSystem.h" -#include "TCernLib.h" -#include "TVector3.h" -#include "StDetectorId.h" -#include "StEventTypes.h" -#include "StEvent/StTrack.h" -#include "StEvent/StPrimaryTrack.h" -#include "StEvent/StTrackNode.h" -#include "StEvent/StTrackGeometry.h" -#include "StEvent/StExtGeometry.h" -#include "StEvent/StContainers.h" -#include "StEvent/StVertex.h" -#include "StThreeVectorD.hh" - -#include "StXTrakMaker.h" -#include "StXTrak.h" -#include "TGeoManager.h" -#include "TGeoSwim.h" -#include "TGeoManager.h" -#include "TGeoNode.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoMaterial.h" -#include "TFile.h" - -#include "Sti/StiElossCalculator.h" -//#include "StvUtil/StvELossTrak.h" -#include "StiUtilities/StiDebug.h" -#include "StEvent/StEventSummary.h" - -ClassImp(StXTrakMaker) - - -//_____________________________________________________________________________ -StXTrakMaker::StXTrakMaker(const Char_t *name) : - StMaker(name) - -{ -} - -//_____________________________________________________________________________ -StXTrakMaker::~StXTrakMaker() -{ - cout <<"StXTrakMaker::~StXTrakMaker() -I- Started/Done"<GetMag(); - double B[3]; - static double B00=0; - if (B00<=0) { - double pos[3]={0}; - (*myMag)(pos,B); - B00=B[2]; - } - - StEvent * event = dynamic_cast( GetInputDS("StEvent") ); - if (!event) return kStWarn; - double rxy,dca,*pos; - const StEventSummary *summ = event->summary();if(summ){}; - double lenStTr=0,lenOutHlx=0,lenInnHlx=0,lenExt=0; - const StSPtrVecTrackNode& nodes= event->trackNodes(); - int nNodes = nodes.size(); - for (int iNode = 0;iNode Clear(); -// =================================================== - StTrackNode *node = nodes[iNode]; - StTrack *track = node->track(primary); - int iprim = track!=0; - if (!iprim) continue; - if (!track) { track = node->track(global);} - assert(track); - lenStTr = track->length(); - - const StTrackGeometry* geo1st = track->geometry(); - assert(geo1st); - StThreeVectorD priPOS = geo1st->origin(); - StThreeVectorD priMOM = geo1st->momentum(); - int priCHARGE = geo1st->charge(); - auto h = geo1st->helicity(); - double priCURV = geo1st->curvature(); if (h<0) priCURV = -priCURV; - if (fabs(priCURV )>1./90) continue; - THelixTrack priHLX(priPOS.xyz(),priMOM.xyz(),priCURV); - - mSwim->Set1stPoint(priCHARGE,priPOS.xyz(),priMOM.xyz()); -// =================================================== - const StTrackGeometry* geo2nd = track->outerGeometry(); - assert(geo2nd); - int CHARGE = geo2nd->charge(); - h = geo2nd->helicity(); - double CURV = geo2nd->curvature(); if (h<0) CURV = -CURV; - if (fabs(CURV )>1./90) continue; - StThreeVectorD STPOS = geo2nd->origin(); - StThreeVectorD STMOM = geo2nd->momentum(); - mSwim->Set2ndPoint(CHARGE,STPOS.xyz(),STMOM.xyz()); - double lenSimp = mSwim->GetLen(2); - mSwim->SetLen2nd(lenStTr); -// =================================================== - THelixTrack HLX(STPOS.xyz(),STMOM.xyz(),CURV); - TString found; - - while(1) {// Loop along the track - - int iEnd = mSwim->Next(); - // =================================================== - - if (iEnd) break; - if (found == mSwim->GetName()) continue; - found = mSwim->GetName(); - auto &aux = mSwim->GetAux(); - pos = aux.mPos; - lenExt = aux.mLen-lenStTr; - rxy = TVector3(pos).Perp(); - dca = HLX.Dca(pos); - lenOutHlx = HLX.Path(pos); - lenInnHlx = fabs(HLX.Path(0.,0.)); - - StExtGeometry *xg = new StExtGeometry; - xg->setName(found.Data()); - double pars[6]; - pars[StExtGeometry::kPhi ] = atan2(pos[1],pos[0]); - pars[StExtGeometry::kZ ] = pos[2]; - pars[StExtGeometry::kPsi ] = atan2(aux.mMom[1],aux.mMom[0]); - pars[StExtGeometry::kPti ] = aux.mPti; - pars[StExtGeometry::kTan ] = atan2(aux.mMom[2],aux.mPt); - pars[StExtGeometry::kCurv] = aux.mCurv; - xg->setLength(aux.mLen); - xg->set(rxy,pars,0); - track->addExtGeometry(xg); - - - - TString ts; - if (iprim) { - ts ="PriDca:Z."; ts+=found; - StiDebug::Count(ts ,pos[2] , dca); - ts ="PriDca:Rxy."; ts+=found; - StiDebug::Count(ts,rxy , dca); - ts ="PriDca:Ptinv."; ts+=found; - StiDebug::Count(ts,aux.mPti, dca); - ts ="PriDca:PLoss."; ts+=found; - StiDebug::Count(ts,aux.mPLoss, dca); - ts ="PriY:X."; - StiDebug::Count(ts,pos[0], pos[1]); - ts ="PriRxy:Z."; - StiDebug::Count(ts,pos[2], rxy); - ts ="PriPLoss:Z."; ts+=found; - StiDebug::Count(ts,pos[2],aux.mPLoss); - ts ="PriPLoss:Pti."; ts+=found; - StiDebug::Count(ts,aux.mPti, aux.mPLoss); - ts ="LenOutRes:Z."; ts+=found; - StiDebug::Count(ts,pos[2],lenExt-lenOutHlx); - ts ="LenInnRes1:Z."; - StiDebug::Count(ts,pos[2],(lenSimp-lenStTr)); - ts ="LenInnRes2:Z."; - StiDebug::Count(ts,pos[2],(lenInnHlx-lenStTr)); - StiDebug::Count("Detectors",found.Data()); - - if (found.Contains("TOF")) { - double myTime = mSwim->GetTimeF(); - StiDebug::Count("myTOFTime",myTime*1e6); - double beta = (lenSimp+lenOutHlx)/myTime/TMath::C(); - if(beta<1) { - double p = mSwim->GetAux(1).mP; - double mass = p*sqrt((1.-beta)*(1+beta))/beta-mSwim->GetMass(); - StiDebug::Count("DeltaMass_1",p,mass); - p = mSwim->GetAux(2).mP; - mass = p*sqrt((1.-beta)*(1+beta))/beta-mSwim->GetMass(); - StiDebug::Count("DeltaMass_2",p,mass); - } - - } - - - } else {//global track - } - }// end along the track - }//End stnodes - return kStOK; -} - diff --git a/StRoot/StXTrakMaker/StXTrakMaker.h b/StRoot/StXTrakMaker/StXTrakMaker.h deleted file mode 100644 index 30b13ca7b44..00000000000 --- a/StRoot/StXTrakMaker/StXTrakMaker.h +++ /dev/null @@ -1,36 +0,0 @@ -//StXTrakMaker.h - -#ifndef StXTrakMaker_HH -#define StXTrakMaker_HH - -#include "StMaker.h" -#include "StEvent/StEnumerations.h" -class StvELossTrak; -class MyMag; -class StXTrak; -class TGeoSwim; - -class StXTrakMaker : public StMaker -{ - public: - - StXTrakMaker(const char* name = "StXTrak"); - virtual ~StXTrakMaker(); - virtual void Clear(const char* opt=""); - virtual Int_t Init(); - virtual Int_t Make(); - virtual Int_t Finish(); - - virtual const char* GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StXTrakMaker.h,v 1.3 2016/07/22 19:00:20 perev Exp $ built " __DATE__ " " __TIME__; return cvs;} - - protected: - StXTrak *mSwim; //Swimmer - - private: - ClassDef(StXTrakMaker,0) -}; - -//inlines - -#endif diff --git a/StRoot/StXTrakMaker/StXTrakTestMaker.cxx b/StRoot/StXTrakMaker/StXTrakTestMaker.cxx deleted file mode 100644 index 653c8eaeda7..00000000000 --- a/StRoot/StXTrakMaker/StXTrakTestMaker.cxx +++ /dev/null @@ -1,129 +0,0 @@ -// $Id: StXTrakTestMaker.cxx,v 1.1 2017/05/04 01:22:15 perev Exp $ -/// \File StXTrakTestMaker.cxx -/// \author V.Perev 2016 -// -/*! - -\class StXTrakTestMaker - -A maker StXTrakTestMaker is a auxiliary maker for Sti/StiCA/Stv packages. -
-Main tasks: -
    -
  • Xtend/prolong StTrack to far detector; -
  • Save produced data into StEvent. -
-*/ -#include -#include -#include -#include "TSystem.h" -#include "TVector3.h" -#include "TH2F.h" -#include "TCanvas.h" -#include "StDetectorId.h" -#include "StEventTypes.h" -#include "StEvent/StTrack.h" -#include "StEvent/StPrimaryTrack.h" -#include "StEvent/StTrackNode.h" -#include "StEvent/StTrackGeometry.h" -#include "StEvent/StExtGeometry.h" -#include "StEvent/StContainers.h" -#include "StEvent/StVertex.h" -#include "StThreeVectorD.hh" - -#include "StXTrakTestMaker.h" -#include "StEvent/StEventSummary.h" - -ClassImp(StXTrakTestMaker) - -//_____________________________________________________________________________ -StXTrakTestMaker::StXTrakTestMaker(const Char_t *name) : - StMaker(name) - -{ -} - -//_____________________________________________________________________________ -StXTrakTestMaker::~StXTrakTestMaker() -{ - cout <<"StXTrakTestMaker::~StXTrakTestMaker() -I- Started/Done"<GetName()); - auto *C = new TCanvas(h->GetName(),h->GetName(),600,800); - C->cd(); h->Draw(); - } - return 0; -} - -//_____________________________________________________________________________ -Int_t StXTrakTestMaker::Init() -{ - return 0; -} -//_____________________________________________________________________________ -TH2 *StXTrakTestMaker::GetTH2(const char *name) -{ - TH2* &th = (TH2*&)mMap[name]; - if (!th) th = new TH2F(name, name, 100, 0,0,100,0,0); - return th; -} - -//_____________________________________________________________________________ -Int_t StXTrakTestMaker::Make() -{ - - StEvent * event = dynamic_cast( GetInputDS("StEvent") ); - if (!event) return kStWarn; - const StSPtrVecTrackNode& nodes= event->trackNodes(); - int nNodes = nodes.size(); - for (int iNode = 0;iNode track(primary):node->track(global); - if (!track) continue; - const StExtGeometry *xg = track->extGeometry(); - if (!xg) continue; //No extention - do {// Loop along the track extentions - TString name(xg->name()); - name+= (iprim)? "_Prim":"_Glob"; - double Rxy = xg->rxy(); - double Z = xg->z(); - double L = xg->length(); - double Phi = xg->phi(); - - TString ts; - ts = name; ts+="_Rxy_vs_Z"; - GetTH2(ts)->Fill(Z,Rxy); - ts = name; ts+="_Len_vs_Z"; - GetTH2(ts)->Fill(Z,L); - - ts = name; ts+="_Rxy_vs_Phi"; - GetTH2(ts)->Fill(Phi*67,Rxy); - ts = name; ts+="_Len_vs_Phi"; - GetTH2(ts)->Fill(Phi*57,L); - ts = name; ts+="_Y_vs_X"; - GetTH2(ts)->Fill(Rxy*cos(Phi),Rxy*sin(Phi)); - } while((xg = xg->next())); //end Xtentions - } //End Glob/Prim - }//End stnodes - return kStOK; -} - diff --git a/StRoot/StXTrakMaker/StXTrakTestMaker.h b/StRoot/StXTrakMaker/StXTrakTestMaker.h deleted file mode 100644 index 60efe4b312d..00000000000 --- a/StRoot/StXTrakMaker/StXTrakTestMaker.h +++ /dev/null @@ -1,35 +0,0 @@ -//StXTrakTestMaker.h - -#ifndef StXTrakTestMaker_HH -#define StXTrakTestMaker_HH - -#include "StMaker.h" -#include "StEvent/StEnumerations.h" -#include - -class TH1; -class TH2; -class StXTrakTestMaker : public StMaker -{ - public: - - StXTrakTestMaker(const char* name = "StXTrakTest"); - virtual ~StXTrakTestMaker(); - virtual void Clear(const char* opt=""); - virtual Int_t Init(); - virtual Int_t Make(); - virtual Int_t Finish(); - TH2 *GetTH2(const char *name); - virtual const char* GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StXTrakTestMaker.h,v 1.1 2017/05/04 01:22:15 perev Exp $ built " __DATE__ " " __TIME__; return cvs;} - - protected: - std::map mMap; - - private: - ClassDef(StXTrakTestMaker,0) -}; - -//inlines - -#endif diff --git a/StRoot/StXTrakMaker/TGeoSwim.cxx b/StRoot/StXTrakMaker/TGeoSwim.cxx deleted file mode 100644 index b586b0068b6..00000000000 --- a/StRoot/StXTrakMaker/TGeoSwim.cxx +++ /dev/null @@ -1,313 +0,0 @@ - -// $Id: TGeoSwim.cxx,v 1.8 2017/11/06 20:49:19 perev Exp $ -// -// -// Class StTGeoHelper -// ------------------ - - - -#include -#include -#include -#include -#include -#include -#include "TString.h" -#include "TMath.h" -#include "TGeoManager.h" -#include "TGeoNavigator.h" -#include "TGeoNode.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoBBox.h" -#include "TGeoNode.h" -#include "TGeoMedium.h" -#include "TGeoMaterial.h" -#include "TGeoSwim.h" -#include "THelixTrack.h" -ClassImp(TGeoSwim) -//! TGeoSwim Constructor. -/*! - \param Name of instance -*/ -//_____________________________________________________________________________ -TGeoSwim::TGeoSwim(const char *name):TNamed(name,"TGeoSwim") -{ - fSmax = 5; - fRmax = 1000; - fZmin =-1000; - fZmax = 1000; - fHelx[0] = new THelixTrack(); - fHelx[1] = new THelixTrack(); - fNode[0] = 0; - fNode[1] = 0; - fMag = 0; - fLoss= 0; - fEnd = 0; - fInOutLen[0] = 0; - fInOutLen[1] = 0; - fC = 0; - fP = 0; //momentum loss(GeV) - fPt = 0; //momentum loss(GeV) - fPLoss = 0; //momentum loss(GeV) - fTimeFly = 0; //time in seconds - memset(fB,0,sizeof(fB)); -} - -/// Setting of tracking region. -/*! - \param Rmax - maxiimal xy Radius - \param Zmin - min Z - \param Zmax - max Z - \param sMax - max step -*/ -//_____________________________________________________________________________ -void TGeoSwim::Set(double Rmax,double Zmin,double zMax,double sMax) -{ - fRmax = Rmax; - fZmin = Zmin; - fZmax = zMax; - fSmax = sMax; -} - -/// Setting of tracking starting point. -/*! - \param pos - 3d track start point position - \param dir - 3d track direction - \param curv - curvatore(signed) -*/ -//_____________________________________________________________________________ -int TGeoSwim::Set(const double* pos,const double* dir, double curv) -{ -THelixTrack **helx = fHelx; -double *B = fB; -double *inOut = fInOutLen; - if (fEnd) fEnd->Reset(); - fPt=0;fP=0;fPLoss=0;fTimeFly=0; memset(fB,0,sizeof(fB)); - fC = curv; - fHelx[0]->Set(pos,dir,curv); - if (fMag) { - (*fMag)(pos,fB); - fPti = (fabs(fB[2])>1e-6) ? fC/fB[2]:1e-3; - fPt = fabs(1./fPti); - fP = fabs(fPt/fHelx[0]->GetCos()); - } - fStartSign = dir[0]*pos[0]+dir[1]*pos[1]; - - gGeoManager->SetCurrentPoint (fHelx[0]->Pos()); - gGeoManager->SetCurrentDirection(fHelx[0]->Dir()); - fNode[0] = gGeoManager->FindNode(); - if (!fNode[0]) return 13; - return 0; -} -//_____________________________________________________________________________ -const double *TGeoSwim::GetPos (int idx) const {return fHelx[idx]->Pos();} -//_____________________________________________________________________________ -const double *TGeoSwim::GetDir (int idx) const {return fHelx[idx]->Dir();} -//_____________________________________________________________________________ -const char *TGeoSwim::GetPath () const {return gGeoManager->GetPath();} -//_____________________________________________________________________________ -double TGeoSwim::GetTime () const -{ - return fTimeFly/TMath::C(); -} -//_____________________________________________________________________________ -int TGeoSwim::OutScene(const double *x) const -{ - if (x[2] fZmax) return 1; - if (x[0]*x[0]+x[1]*x[1] > fRmax*fRmax)return 2; - return 0; -} -//_____________________________________________________________________________ -const TGeoMaterial *TGeoSwim::GetMate () const -{ - if (!fNode[0]) return 0; - return fNode[0]->GetMedium()->GetMaterial(); -} -//_____________________________________________________________________________ -/// Start tracking.. -/*! - \param maxLenP - Max allowed tracking length - returns flag, see enum SwimExit -*/ -//_____________________________________________________________________________ -int TGeoSwim::Swim(double maxLenP) -{ -static const double kMaxLoss = 0.1;// Max momentum loss - -enum {kMaxIter=100}; -enum {kInside = 1, kOutside = 0}; -THelixTrack **helx = fHelx; -double *B = fB; -double *inOut = fInOutLen; - - *fHelx[1] = *fHelx[0]; - double maxLen = maxLenP; - double cutLen = 1e11; - fInOutLen[2]=0; fTimeFly=0; - while(1) { - const double *poz = fHelx[0]->Pos(); - double range = fabs(poz[0])+fabs(poz[1])+fabs(poz[2]); - double myMicron = 1e-4+range*1e-4; - - double dP,dC,dPt,pos[3],dir[3],cosTh2,cosTh,lenxy2,lenxy; - - fNode[0] = gGeoManager->GetCurrentNode(); - double myRad =1./(fabs(fHelx[0]->GetRho())+1e-10)/fHelx[0]->GetCos(); - double maxStep = fSmax; - if (maxStep>cutLen) maxStep=cutLen; cutLen = 1e11; - if (maxStep>maxLen) maxStep=maxLen; - if (maxStep>myRad) maxStep = myRad; - fInOutLen[0]=0; fInOutLen[1]=maxStep; - double step=0,myLen=0; - const TGeoMaterial *gmate = GetMate(); - int kase = kInside; - for (int iter=0;iter0) { - fHelx[1]->Move(step); fInOutLen[0]+=step; - gGeoManager->SetCurrentPoint (fHelx[1]->Pos()); - gGeoManager->SetCurrentDirection(fHelx[1]->Dir()); - fNode[1] = gGeoManager->FindNode(); - } - if ( fInOutLen[0]+maxStep > maxLen) maxStep = maxLen-fInOutLen[0]; - if (maxStep<=0) break; - gGeoManager->FindNextBoundary(maxStep); - step = gGeoManager->GetStep()*0.99; - break;} - - case kOutside : { // outside & quality bad - if (fInOutLen[1]>fInOutLen[0]+step){ fInOutLen[1]=fInOutLen[0]+step;} - if (fInOutLen[1]>maxLen) fInOutLen[1]=maxLen; - if (fInOutLen[0]< fInOutLen[1]/2) { step = (fInOutLen[1]-fInOutLen[0])*0.9;} - else { step = (fInOutLen[1]-fInOutLen[0])*0.5;} - break;} - - default: assert(0 && "Wrong case"); - - } - range = fInOutLen[1]-fInOutLen[0]; - if (range range/2) step = range/2; - } - fHelx[1]->Eval(step,pos,dir); - kase = (gGeoManager->IsSameLocation(pos[0],pos[1],pos[2]))? kInside:kOutside; - } - - range = fInOutLen[1]-fInOutLen[0]; - if (range>myMicron) return kNoConv; //no convergency at all - fHelx[1]->Move(range); - - if (OutScene(fHelx[1]->Pos())) return kOutScene; - - - myLen = fInOutLen[1]; - fInOutLen[2]+=fInOutLen[1]; - if (fLoss) { // Account of energy loss - - dP = -(*fLoss)(gmate,fP,myLen,0); -// ================================ - - if (fabs(dP) > kMaxLoss*fP) { // Cut step, too big eloss - cutLen = fInOutLen[1]/2; - *fHelx[1]=*fHelx[0]; - gGeoManager->SetCurrentPoint (fHelx[1]->Pos()); - gGeoManager->SetCurrentDirection(fHelx[1]->Dir()); - fNode[1] = gGeoManager->FindNode(); - continue; - } - memcpy(pos,fHelx[1]->Pos(),sizeof(pos)); - memcpy(dir,fHelx[1]->Dir(),sizeof(dir)); - fCurrSign = dir[0]*pos[0]+dir[1]*pos[1]; - if (fCurrSign*fStartSign<=0) return kApogee; - - cosTh2 = (1.-dir[2])*(1.+dir[2]); - cosTh = sqrt(cosTh2); - for (int j=0;j<3;j++){ dir[j]/=cosTh;} - dPt = fPt/fP*dP; - double dPti = -fPti*(dPt/fPt); - fP += dP; fPt+= dPt; fPti+= dPti; - if (fabs(fPt)Set(pos,dir,fC); -// Time of flight calculation - double m = fLoss->GetMass(); - double p = fP-dP; - double betIn0 = sqrt((p*p+m*m)/(p*p)); - p = fP; - double betIn1 = sqrt((p*p+m*m)/(p*p)); - fTimeFly += 0.5*(betIn0+betIn1)*fInOutLen[1]; -// - } - gGeoManager->SetCurrentPoint ((double*)fHelx[1]->Pos()); - gGeoManager->SetCurrentDirection((double*)fHelx[1]->Dir()); - fNode[1] = gGeoManager->FindNode(); - if (!fNode[1]) return kOutScene; - if (!fEnd || (*fEnd)()) return kNormal; - fNode[0] = fNode[1]; - *fHelx[0] = *fHelx[1]; - maxLen -= fInOutLen[1]; - if (maxLen<=0) return kEndRange; - } - return kFailed; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -int TGeoSwimDefaultEnd::operator()() -{ - mTit = 0; - mEnd = mKase; - switch(mKase) { - - case kDefault: return kDefault; - - case kNewVolu: { - TString myPath(gGeoManager->GetPath()); - if (myPath == mPrevPath) {mEnd = kUndef;return kUndef;} - mPrevPath = myPath; return kNewVolu; - } - - case kNameVolu:{ - mEnd = kUndef; - TString myPath(gGeoManager->GetPath()); - if (myPath == mPrevPath) {return kUndef;}; - mPrevPath = myPath; - - for (int j=0;mTits[j];j++) { - if (myPath.Index(mTits[j])<0) continue; - if (j == mJit) break; - mJit = j; - mTit = mTits[j]; - mEnd = kNameVolu; break; - } - return mEnd; - } - - default: assert(0 && "Wrong TGeoSwimEnd kase"); - - } - return kUndef; -} diff --git a/StRoot/StXTrakMaker/TGeoSwim.h b/StRoot/StXTrakMaker/TGeoSwim.h deleted file mode 100644 index 96a80f8ffe1..00000000000 --- a/StRoot/StXTrakMaker/TGeoSwim.h +++ /dev/null @@ -1,148 +0,0 @@ -/// $Id: TGeoSwim.h,v 1.9 2017/11/06 20:49:19 perev Exp $ -/// -/// -/// Class StTGeoSwim -/// ------------------ -/// This class provides tracking thru TGeo structure of volumes and materisls -/// There are only ROOT dependencies and STAR class THelixTrack. -/// Communication with non ROOT entities, -/// like Mag field, Energy loss provide4d via functors inherited from -/// auxiliary TGeoSwimMag and TGeoSwimLoss classes. -/// Tracking accounts energy loss and magnetic field. It stops at the beginning -/// of the volume if functor inherited from cauxiliary class TGeoSwimEnd returns non zero -/// The current version is working only with mag field along Z. -/// -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ - - -#ifndef ST_TGESWIM_H -#define ST_TGESWIM_H -#include "TString.h" -#include "TNamed.h" -class THelixTrack; -class TGeoNode; -class TGeoMaterial; - -class TGeoSwimMag { -public: -TGeoSwimMag(){}; -virtual void operator()(const double X[3],double B[3])=0; -}; - -class TGeoSwimLoss { -public: -TGeoSwimLoss(double charge=1,double mass=0.13956995){mCharge = charge;mMass = mass;}; -// returns momentum loss -virtual double operator()(const TGeoMaterial* mate,double P,double len - ,double *theta2=0)=0; -double GetMass() const {return mMass;} -protected: -double mCharge; -double mMass; -}; - - -class TGeoSwimEnd { -public: -// Main output cases ( - enum EndKase { - kUndef = 0,//Undefined - kDefault = 1,//Immediate return after any step - kNewVolu = 2,//Return when new vollume started - kNameVolu = 4,//Return, if mother volume name from the given list - }; -TGeoSwimEnd(){;} -virtual void Reset()=0; -virtual int operator()()=0; -virtual const char* GetName() const {return 0;}; -virtual int GetExit() const {return mEnd;} -protected: -EndKase mEnd; - -}; - -class TGeoSwim: public TNamed -{ -public: -enum SwimExit {kEndRange=-1,kNormal=0 ,kManySteps=13,kNoConv=14 - ,kBadMom=15 ,kFailed=16,kApogee=17 ,kOutScene=99}; -#define kMinMom 0.05 // minimal allowed Pt - -TGeoSwim(const char *name=""); - -void Set(TGeoSwimMag *mag=0, TGeoSwimLoss *loss=0,TGeoSwimEnd* endd=0) - {fMag=mag;fLoss=loss;fEnd=endd;} - -TGeoSwimMag *GetMag() {return fMag; } -TGeoSwimLoss *GetLoss(){return fLoss;} -TGeoSwimEnd *GetEnd() {return fEnd; } - - -void Set(double Rmax,double Zmin,double Zmax,double sMax=10); - int Set(const double* pos,const double* dir, double curv); - int OutScene(const double *x) const ; - - int Swim(double maxLen); -double GetLen (int idx=2) const {return fInOutLen[idx];} -const TGeoNode *GetNode (int idx=1) const {return fNode[idx];} - THelixTrack *GetHelix(int idx=1) const {return fHelx[idx];} -const double *GetPos (int idx=1) const; -const double *GetDir (int idx=1) const; -const char *GetPath() const; -const TGeoMaterial*GetMate() const; - double GetTime() const; - double GetPti() const {return fPti ;} - double GetPt() const {return fPt ;} - double GetP() const {return fP ;} - double GetPLoss()const {return fPLoss ;} - double GetCurv() const {return fC ;} - -void Swap() { THelixTrack *h=fHelx[0];fHelx[0]=fHelx[1];fHelx[1]=h;} -protected: - -TGeoSwimMag *fMag; ///< Mag functor -TGeoSwimLoss *fLoss; ///< Energy loss functor -TGeoSwimEnd *fEnd; ///< Stop condition functor -double fSmax; ///< Max step size -double fRmax; ///< Max radius(xy) -double fZmin; ///< Min Z -double fZmax; ///< Max Z -double fInOutLen[3]; ///< Length 0=VoluEnd 1=voluStart 2=total length -double fC; ///< curvature 1/cm -double fP; ///< momentum loss(GeV) -double fPti; ///< signed invers pt -double fPt; ///< Pt(GeV) -double fPLoss; ///< momentum loss(GeV) -double fTimeFly; ///< time of flight in seconds -double fB[3]; ///< Current mag field -double fStartSign; ///< Start signature Dirxy*Posxy -double fCurrSign; ///< Current signature Dirxy*Posxy -THelixTrack *fHelx[2]; -const TGeoNode *fNode[2]; -ClassDef(TGeoSwim,0) - -}; - -class TGeoSwimDefaultEnd: public TGeoSwimEnd -{ -public: -TGeoSwimDefaultEnd(TGeoSwimEnd::EndKase kase - ,const char ** tits=0){mKase=kase;mTits=tits;mJit=-1;} -virtual void Reset(){mPrevPath="";mJit=-1; mTit=0;} -virtual int operator()(); -virtual const char* GetName() const {return mTit;}; -protected: -TGeoSwimEnd::EndKase mKase; -TString mPrevPath; -const char ** mTits; -const char * mTit; -int mJit; -}; - - - - - - - -#endif diff --git a/StRoot/StXTrakMaker/xtrak.C b/StRoot/StXTrakMaker/xtrak.C deleted file mode 100644 index a1869a8ceed..00000000000 --- a/StRoot/StXTrakMaker/xtrak.C +++ /dev/null @@ -1,75 +0,0 @@ -class StMaker; -void rmMaker(const StMaker *top, const char *key); -void xtrak(int flag=0) -{ -gROOT->LoadMacro("./bfc.C"); -TString opt,fil; -int fr=1,to=1; -int ierr = 0; -int KNN = 0; - - - - -#if 1 //Same but Sti -opt = "in,y2016,AgML,usexgeom,FieldOn,MakeEvent,Sti,NoSsdIt,NoSvtIt,"; -opt+= "Idst,BAna,l0,Tree,logger,genvtx,tpcDB,bbcSim,btofsim,mtdSim,tags,emcY2,EEfs,evout,"; -opt+= "-dstout,IdTruth,big,MiniMcMk"; -fil = "/star/simu/simu/perev/StvKutta/OutDirSti/hijing_18_fieldon_ideal_sdt20160517_10evts.event.root"; -#endif -////////////////////////////////////////////////////////////////////////////// -bfc(-1,opt,fil); -//chain->SetAttr("seedFinders","KN","Stv"); -// chain->SetAttr(".call","SetDebug(1)","St_db_Maker::"); -//chain->SetAttr("makePulls",1,"StiMaker::"); -// bfc(fr,to,opt,fil); - - -//int ixt = gSystem->Load("StvUtil"); -gSystem->Load("StXTrakMaker"); -chain->AddAfter("Sti", new StXTrakMaker ); -chain->AddAfter("StXTrak", new StXTrakTestMaker); - -StMaker::lsMakers(chain); - -int stv = opt.Contains("Stv"); -if (stv) { StvDebug::SetDebug(11);} -else { StiDebug::SetDebug(11);} - -#if 1 -int sim =0; -if (fil.Contains(".fz")) sim = 1; -if (!sim) { -rmMaker(chain,"geant"); -} else { -gSystem->Setenv("STARFPE","NO"); -} -#endif - -chain->Init(); -if (KNN) chain->SetAttr("seedFinders","kn","Stv"); - -chain->EventLoop(30); -chain->Finish(); -} - -void rmMaker(const StMaker *top, const char *key) -{ - TRegexp rex(key); - for (int del=1;del;) { - TDataSetIter iter((TDataSet*)top,20); - del=0; - for(const TDataSet *mk=top;mk;mk = iter.Next()) { - if(strncmp(".maker",mk->GetTitle(),6)!=0) continue; - TString ts(mk->ClassName()); ts+="::"; - ts+=mk->GetName(); - if (ts.Index(rex)<0) continue; - printf("*** Remove %s *** \n",ts.Data()); - delete mk; del = 1; break; - } - } - - printf("*** Maker %s Not Found ***\n",ts.Data()); - -} - diff --git a/StRoot/StarGenerator/BASE/AgStarReader.cxx b/StRoot/StarGenerator/BASE/AgStarReader.cxx index 940fe5ec8ef..c4b5b980920 100644 --- a/StRoot/StarGenerator/BASE/AgStarReader.cxx +++ b/StRoot/StarGenerator/BASE/AgStarReader.cxx @@ -5,13 +5,12 @@ ClassImp(AgStarReader); #include "TDatabasePDG.h" #include "TParticlePDG.h" -#include "St_geant_Maker/St_geant_Maker.h" #include "TLorentzVector.h" #include #include using namespace std; -#include "TGiant3.h" +#include #include "StarGenerator/UTIL/StarParticleData.h" #include "StarGenerator/BASE/StarParticleStack.h" @@ -21,18 +20,69 @@ AgStarReader *AgStarReader::mInstance = 0; // TODO: Refactor TDatabasePDG to StarParticleData // -// Setup the interface with starsim +// Setup the interface with starsim and direct to geant3 // #define ageventread F77_NAME(ageventread,AGEVENTREAD) #define agsvert F77_NAME(agsvert, AGSVERT) #define agskine F77_NAME(agskine, AGSKINE) +#define gskine F77_NAME(gskine, GSKINE) +#define gsvert F77_NAME(gsvert, GSVERT) + +// Comis routine for obtaining the address of common blocks +#define gcomad F77_NAME(gcomad,GCOMAD) extern "C" { void type_of_call ageventread() { AgStarReader::Instance().ReadEvent(); } void type_of_call agsvert( float *vertex, int *nb, int *nt, float *ubuf, int *nu, int *nv ); void type_of_call agskine( float *plab, int *ip, int *nv, float *ubuf, int *nb, int *nt ); + void type_of_call gsvert( float *, int &, int &, float *, int &, int &); + void type_of_call gskine( float *, int &, int &, float *, int &, int &); + void type_of_call gcomad(DEFCHARD, int*& DEFCHARL); }; +// +//----------GCTRAK ... normally I would rather poke my eye out rather than hardcode +// this... but this structure has existed w/in GEANT3 unchanged for 3 decades or so. +// Think we can get away with this here... +// +#define MAXMEC 30 +typedef struct { + float vect[7]; + float getot; + float gekin; + int vout[7]; + int nmec; + int lmec[MAXMEC]; + int namec[MAXMEC]; + int nstep; + int maxnst; + float destep; + float destel; + float safety; + float sleng; + float step; + float snext; + float sfield; + float tofg; + float gekrat; + float upwght; + int ignext; + int inwvol; + int istop; + int igauto; + int iekbin; + int ilosl; + int imull; + int ingoto; + int nldown; + int nlevin; + int nlsav; + int istory; +} Gctrak_t; + +Gctrak_t* fGctrak = 0; + + // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------- @@ -45,7 +95,10 @@ AgStarReader::AgStarReader() : TObject(), mStack(0), mParticleData(&StarParticle // ---------------------------------------------------------------------------------------------------- AgStarReader &AgStarReader::Instance() { - if ( !mInstance ) mInstance = new AgStarReader(); + if ( !mInstance ) { + mInstance = new AgStarReader(); + gcomad(PASSCHARD("GCTRAK"),(int*&) fGctrak PASSCHARL("GCTRAK")); + } return (*mInstance); } // ---------------------------------------------------------------------------------------------------- @@ -54,20 +107,20 @@ AgStarReader &AgStarReader::Instance() void AgStarReader::ReadEvent() { - TGiant3 *geant3 = St_geant_Maker::instance()->Geant3(); - TParticle *part = 0; // particle int itrk = -1; // track number - struct Vertex_t { - Double_t x, y, z, t; + double x, y, z, t; int idx; }; int idvtx = 0; map start_vtx; + float* ubuf = 0; + int nwbuf=0; + while( (part=mStack->PopNextTrack(itrk)) ) { @@ -75,8 +128,6 @@ void AgStarReader::ReadEvent() // continue on to the next particle. if ( part->GetStatusCode() != 1 ) continue; - // part->Print(); - // Get the parent particle and lookup the vertex id int parent = part->GetFirstMother(); int myvtx = start_vtx[parent]; @@ -91,11 +142,17 @@ void AgStarReader::ReadEvent() float(part->Vz()) }; - myvtx = geant3->Gsvert( v, 0, 0 ); - assert(myvtx==idvtx); + // Set the vertex of the track + { + int nt = 0; + int nb = 0; + gsvert(v, nt, nb, ubuf, nwbuf, myvtx); + assert(myvtx==idvtx); + } // Set time of flight - geant3->Gctrak()->tofg = part->T(); + assert(fGctrak); + fGctrak->tofg = part->T(); } @@ -117,8 +174,11 @@ void AgStarReader::ReadEvent() } } - - geant3->Gskine( plab, g3id, myvtx ); + // And add the particle + { + int nt = 0; + gskine( plab, g3id, myvtx, ubuf, nwbuf, nt ); + } } diff --git a/StRoot/StarGenerator/EVENT/StarGenPPEvent.cxx b/StRoot/StarGenerator/EVENT/StarGenPPEvent.cxx index 7cdd5c69f17..156a1b17263 100644 --- a/StRoot/StarGenerator/EVENT/StarGenPPEvent.cxx +++ b/StRoot/StarGenerator/EVENT/StarGenPPEvent.cxx @@ -20,6 +20,8 @@ StarGenPPEvent::StarGenPPEvent( const Char_t *name, const Char_t *title ) sHat(0.), tHat(0.), uHat(0.), + mstu72(0), + mstu73(0), ptHat(0.), thetaHat(0.), phiHat(0.), diff --git a/StRoot/StarGenerator/EVENT/StarGenPPEvent.h b/StRoot/StarGenerator/EVENT/StarGenPPEvent.h index 221aea9f599..c82e49e13ec 100644 --- a/StRoot/StarGenerator/EVENT/StarGenPPEvent.h +++ b/StRoot/StarGenerator/EVENT/StarGenPPEvent.h @@ -37,14 +37,17 @@ class StarGenPPEvent : public StarGenEvent Bool_t valence2; ///< True if yellow beam parton is in valence Double_t sHat,tHat,uHat; ///< Mandelstam variables - + + Int_t mstu72; ///< Line number of an event record, ("======") + Int_t mstu73; ///< Line number of an event record, ("======") + Double_t ptHat; ///< pT of the recoiling particles Double_t thetaHat; ///< theta of the recoiling particles Double_t phiHat; ///< phi of the recoiling particles Double_t weight; ///< Weight of the event - ClassDef(StarGenPPEvent,1); + ClassDef(StarGenPPEvent,2); }; diff --git a/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.cxx b/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.cxx index 54a688beab5..f65e1007d8d 100644 --- a/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.cxx +++ b/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.cxx @@ -31,8 +31,6 @@ #include "StDetectorDbMaker/St_tpcPressureBC.h" #include "StDetectorDbMaker/St_TpcDriftDistOxygenC.h" #include "StDetectorDbMaker/St_TpcMultiplicityC.h" -#include "StDetectorDbMaker/St_GatingGridC.h" -#include "StDetectorDbMaker/St_GatingGridBC.h" #include "StDetectorDbMaker/St_TpcZCorrectionBC.h" #include "StDetectorDbMaker/St_TpcZCorrectionCC.h" #include "StDetectorDbMaker/St_tpcMethaneInC.h" @@ -138,7 +136,6 @@ void StTpcdEdxCorrection::ReSetCorrections() { assert(tpcGas); } SettpcGas(tpcGas); - memset (m_Corrections, 0, sizeof(m_Corrections)); mTimeBinWidth = 1./StTpcDb::instance()->Electronics()->samplingFrequency(); mInnerSectorzOffset = StTpcDb::instance()->Dimensions()->zInnerOffset(); mOuterSectorzOffset = StTpcDb::instance()->Dimensions()->zOuterOffset(); @@ -157,28 +154,37 @@ void StTpcdEdxCorrection::ReSetCorrections() { m_Corrections[kAdcCorrectionC ] = dEdxCorrection_t("TpcAdcCorrectionC" ,"alternative ADC/Clustering nonlinearity correction" ,St_TpcAdcCorrectionCC::instance()); m_Corrections[kEdge ] = dEdxCorrection_t("TpcEdge" ,"Gain on distance from Chamber edge" ,St_TpcEdgeC::instance()); m_Corrections[kAdcCorrectionMDF ] = dEdxCorrection_t("TpcAdcCorrectionMDF" ,"ADC/Clustering nonlinearity correction MDF" ,St_TpcAdcCorrectionMDF::instance()); + /* used only for tests m_Corrections[kAdcCorrection3MDF ] = dEdxCorrection_t("TpcAdcCorrection3MDF","ADC/Clustering nonlinearity correction MDF 3D" ,St_TpcAdcCorrection3MDF::instance()); m_Corrections[kAdcCorrection4MDF ] = dEdxCorrection_t("TpcAdcCorrection4MDF","ADC/Clustering nonlinearity correction MDF 4D" ,St_TpcAdcCorrection4MDF::instance()); m_Corrections[kAdcCorrection5MDF ] = dEdxCorrection_t("TpcAdcCorrection5MDF","ADC/Clustering nonlinearity correction MDF+4D" ,St_TpcAdcCorrection5MDF::instance()); + */ m_Corrections[kAdcCorrection6MDF ] = dEdxCorrection_t("TpcAdcCorrection6MDF","alternative ADC/Clustering nonlinearity correction MDF+4D" ,St_TpcAdcCorrection6MDF::instance()); m_Corrections[kTpcdCharge ] = dEdxCorrection_t("TpcdCharge" ,"ADC/Clustering undershoot correction" ,St_TpcdChargeC::instance()); + /* m_Corrections[kTpcrCharge ] = dEdxCorrection_t("TpcrCharge" ,"ADC/Clustering rounding correction" ,St_TpcrChargeC::instance()); + */ m_Corrections[kTpcCurrentCorrection ] = dEdxCorrection_t("TpcCurrentCorrection","Correction due to sagg of Voltage due to anode current" ,St_TpcCurrentCorrectionC::instance()); m_Corrections[kTpcRowQ ] = dEdxCorrection_t("TpcRowQ" ,"Gas gain correction for row versus accumulated charge," ,St_TpcRowQC::instance()); m_Corrections[kTpcAccumulatedQ ] = dEdxCorrection_t("TpcAccumulatedQ" ,"Gas gain correction for HV channel versus accumulated charge," ,St_TpcAccumulatedQC::instance()); m_Corrections[kTpcSecRowB ] = dEdxCorrection_t("TpcSecRowB" ,"Gas gain correction for sector/row" ,St_TpcSecRowBC::instance()); + /* m_Corrections[kTpcSecRowC ] = dEdxCorrection_t("TpcSecRowC" ,"Additional Gas gain correction for sector/row" ,St_TpcSecRowCC::instance()); + */ m_Corrections[ktpcPressure ] = dEdxCorrection_t("tpcPressureB" ,"Gain on Gas Density due to Pressure" ,St_tpcPressureBC::instance()); m_Corrections[ktpcTime ] = dEdxCorrection_t("tpcTime" ,"Unregognized time dependce" ,St_tpcTimeDependenceC::instance()); m_Corrections[kDrift ] = dEdxCorrection_t("TpcDriftDistOxygen" ,"Correction for Electron Attachment due to O2" ,St_TpcDriftDistOxygenC::instance()); m_Corrections[kMultiplicity ] = dEdxCorrection_t("TpcMultiplicity" ,"Global track multiplicity dependence" ,St_TpcMultiplicityC::instance()); - m_Corrections[kGatingGrid ] = dEdxCorrection_t("GatingGrid" ,"Variation due to Gating Grid transperancy" ,St_GatingGridBC::instance()); m_Corrections[kzCorrectionC ] = dEdxCorrection_t("TpcZCorrectionC" ,"Variation on drift distance with Gating Grid one" ,St_TpcZCorrectionCC::instance()); m_Corrections[kzCorrection ] = dEdxCorrection_t("TpcZCorrectionB" ,"Variation on drift distance without Gating Gird one" ,St_TpcZCorrectionBC::instance()); + /* Deactivated m_Corrections[ktpcMethaneIn ] = dEdxCorrection_t("tpcMethaneIn" ,"Gain on Methane content" ,St_tpcMethaneInC::instance()); - m_Corrections[ktpcGasTemperature ] = dEdxCorrection_t("tpcGasTemperature" ,"Gain on Gas Dens. due to Temperature" ,St_tpcGasTemperatureC::instance()); + */ + m_Corrections[ktpcGasTemperature ] = dEdxCorrection_t("tpcGasTemperature" ,"Gain on Gas Dens. due to Output (T5) Temperature" ,St_tpcGasTemperatureC::instance()); + /* Deactivated m_Corrections[ktpcWaterOut ] = dEdxCorrection_t("tpcWaterOut" ,"Gain on Water content" ,St_tpcWaterOutC::instance()); m_Corrections[kSpaceCharge ] = dEdxCorrection_t("TpcSpaceCharge" ,"Gain on space charge near the wire" ,St_TpcSpaceChargeC::instance()); + */ m_Corrections[kPhiDirection ] = dEdxCorrection_t("TpcPhiDirection" ,"Gain on interception angle" ,St_TpcPhiDirectionC::instance()); m_Corrections[kTanL ] = dEdxCorrection_t("TpcTanL" ,"Gain on Tan(lambda)" ,St_TpcTanLC::instance()); m_Corrections[kdXCorrection ] = dEdxCorrection_t("TpcdXCorrectionB" ,"dX correction" ,St_TpcdXCorrectionBC::instance()); @@ -189,11 +195,15 @@ void StTpcdEdxCorrection::ReSetCorrections() { m_Corrections[kTpcZDC ] = dEdxCorrection_t("TpcZDC" ,"Gain on Zdc CoincidenceRate" ,St_TpcZDCC::instance()); m_Corrections[kTpcPadMDF ] = dEdxCorrection_t("TpcPadCorrectionMDF" ,"Gain Variation along the anode wire" ,St_TpcPadCorrectionMDF::instance()); m_Corrections[kTpcPadMDC ] = dEdxCorrection_t("TpcPadCorrectionMDC" ,"Gain Variation along the anode wire with track curvature" ,St_TpcPadCorrectionMDC::instance()); + /* m_Corrections[kAdcI ] = dEdxCorrection_t("TpcAdcI" ,"Gain on Accumulated Adc on a socket)" ,St_TpcAdcIC::instance()); + */ m_Corrections[knPad ] = dEdxCorrection_t("TpcnPad" ,"Gain on cluster length in pads" ,St_TpcnPadC::instance()); - m_Corrections[knTbk ] = dEdxCorrection_t("TpcnTbk" ,"Gain on cluster length i time buckets" ,St_TpcnTbkC::instance()); + m_Corrections[knTbk ] = dEdxCorrection_t("TpcnTbk" ,"Gain on cluster length in time buckets" ,St_TpcnTbkC::instance()); + /* m_Corrections[kdZdY ] = dEdxCorrection_t("TpcdZdY" ,"Gain on track dZ/dY" ,St_TpcdZdYC::instance()); m_Corrections[kdXdY ] = dEdxCorrection_t("TpcdXdY" ,"Gain on track dX/dY" ,St_TpcdXdYC::instance()); + */ m_Corrections[kTpcLast ] = dEdxCorrection_t("Final" ,"" ,0); m_Corrections[kTpcLengthCorrection ] = dEdxCorrection_t("TpcLengthCorrectionB" ,"Variation vs Track length and relative error in Ionization" ,St_TpcLengthCorrectionBC::instance()); m_Corrections[kTpcLengthCorrectionMDF] = dEdxCorrection_t("TpcLengthCorrectionMDF","Variation vs Track length and and rel. error in dE/dx" ,St_TpcLengthCorrectionMDF::instance()); @@ -262,7 +272,7 @@ void StTpcdEdxCorrection::ReSetCorrections() { } // Check consistency of active chairs if ( m_Corrections[kzCorrectionC].Chair) { // if kzCorrectionC is already active - vector kvect = {kzCorrection, kGatingGrid}; + vector kvect = {kzCorrection}; // , kGatingGrid}; for (auto k : kvect) { if (m_Corrections[k].Chair) { LOG_WARN << m_Corrections[kzCorrectionC].Name << " is already active => disable " << m_Corrections[k].Name << endm; @@ -388,19 +398,16 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { #endif #endif Double_t ZdriftDistance = CdEdx.ZdriftDistance; - Double_t driftDistance2GG = ZdriftDistance; ESector kTpcOutIn = kTpcOuter; Float_t gasGain = 1; Float_t gainNominal = 0; St_tss_tssparC *tsspar = St_tss_tssparC::instance(); if (row <= St_tpcPadConfigC::instance()->innerPadRows(sector)) { kTpcOutIn = kTpcInner; - driftDistance2GG += mInnerSectorzOffset; gainNominal = tsspar->gain_in()*tsspar->wire_coupling_in(); gasGain = tsspar->gain_in(sector,row) *tsspar->wire_coupling_in(); } else { kTpcOutIn = kTpcOuter; - driftDistance2GG += mOuterSectorzOffset; gainNominal = tsspar->gain_out()*tsspar->wire_coupling_out(); gasGain = tsspar->gain_out(sector,row)*tsspar->wire_coupling_out(); } @@ -409,7 +416,7 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { iok = 1; return iok; } - CdEdx.driftTime = driftDistance2GG/gStTpcDb->DriftVelocity(sector)*1e6 - m_TrigT0;// musec + CdEdx.driftTime = ZdriftDistance/gStTpcDb->DriftVelocity(sector)*1e6 - m_TrigT0;// musec // Double_t gainAVcorr = gasGain/gainNominal; mAdc2GeV = tsspar->ave_ion_pot() * tsspar->scale()/gainNominal; Double_t Adc2GeVReal = tsspar->ave_ion_pot() * tsspar->scale()/gasGain; @@ -469,7 +476,7 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { if (! table) goto ENDL; const TpcSecRowCor_st *gain = table->GetTable() + sector - 1; gc = gain->GainScale[row-1]; - // gcRMS = gain->GainRms[row-1]; + // gcRMS = gain->GainRms[row-1];1 // if (gc <= 0.0 || gcRMS <= 0.0) { if (gc <= 0.0) { return k; @@ -542,18 +549,6 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { } else if (k == kAdcCorrection6MDF) { goto ENDL; // kAdcCorrection6MDF is in kAdcCorrectionC } -#if 0 - if (k == kGatingGrid) { - // Take care about prompt hits and Gating Grid region in Simulation - if (ZdriftDistance <= 0.0) goto ENDL; // prompt hits - Double_t dEcor = ((St_GatingGridC *)m_Corrections[k].Chair)->CalcCorrection(l,VarXs[kGatingGrid]); - if (dEcor < -9.9) { - return k; - } - dE *= TMath::Exp(-dEcor); - goto ENDL; - } -#endif cor = ((St_tpcCorrection *) m_Corrections[k].Chair->Table())->GetTable(); if (! cor) goto ENDL; NLoops = cor->type/100000 + 1; @@ -636,8 +631,11 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { return k; } } - if (VarXs[k] < 0) {// prompt hits + if (ZdriftDistance < -0.6) {// prompt hits after cathode wire plane dE *= TMath::Exp(1.2); + goto ENDL; + } else if (VarXs[k] < 0.0) {// hits after Gating Grid and before cathode wire plane + return k; } if (k == kzCorrectionC && corl->type == 20) { Int_t np = TMath::Abs(corl->npar)%100; @@ -671,27 +669,10 @@ Int_t StTpcdEdxCorrection::dEdxCorrection(dEdxY2_t &CdEdx, Bool_t doIT) { return k; } } - } - if (corl->npar%100) { - Double_t dECor = 0; - if (k == kGatingGrid) { - dECor = TMath::Exp(-((St_GatingGridBC *)m_Corrections[k].Chair)->CalcCorrection(l,VarXs[k])); - } else { - dECor = TMath::Exp(-chairC->CalcCorrection(l,VarXs[k])); - } -#if 0 - if (TMath::IsNaN(dECor)) { - static Int_t iBreak = 0; - iBreak++; + if (corl->npar%100) { + Double_t dECor = TMath::Exp(-chairC->CalcCorrection(l,VarXs[k])); + dE *= dECor; } -#endif - dE *= dECor; -#if 0 - if (TMath::IsNaN(dE)) { - static Int_t iBreak = 0; - iBreak++; - } -#endif } else { // repeatable for (m = 0; m < NLoops; m++, l += nrows) { corl = cor + l; @@ -752,6 +733,7 @@ Int_t StTpcdEdxCorrection::dEdxTrackCorrection(EOptions opt, Int_t type, dst_ded if (! m_Corrections[k].Chair) return 0; Int_t l = 2*type; Int_t nrows = 0; + Double_t dEdxError = 0; const St_tpcCorrectionC *chairC = dynamic_cast(m_Corrections[k].Chair); switch (k) { case kTpcLengthCorrection: @@ -762,7 +744,8 @@ Int_t StTpcdEdxCorrection::dEdxTrackCorrection(EOptions opt, Int_t type, dst_ded case 2: // fit if (nrows > l+1) { dedx.dedx[0] *= TMath::Exp(-chairC->CalcCorrection( l,LogTrackLength)); - dedx.dedx[1] = chairC->CalcCorrection(l+1,LogTrackLength); + dEdxError = chairC->CalcCorrection(l+1,LogTrackLength); + if (dEdxError > 0) dedx.dedx[1] = dEdxError; } if (nrows > l+6) { dedx.dedx[0] *= TMath::Exp(-chairC->CalcCorrection(l+6,LogTrackLength)); @@ -783,7 +766,8 @@ Int_t StTpcdEdxCorrection::dEdxTrackCorrection(EOptions opt, Int_t type, dst_ded case 2: // fit if (nrows > l+1) { dedx.dedx[0] *= TMath::Exp(-((St_MDFCorrectionC *)m_Corrections[k].Chair)->Eval( l,xx)); - dedx.dedx[1] = ((St_MDFCorrectionC *)m_Corrections[k].Chair)->Eval(l+1,xx); + dEdxError = ((St_MDFCorrectionC *)m_Corrections[k].Chair)->Eval(l+1,xx); + if (dEdxError > 0) dedx.dedx[1] = dEdxError; } break; default: diff --git a/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.h b/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.h index 66048c4cf59..c2009ba0fa3 100644 --- a/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.h +++ b/StRoot/StdEdxY2Maker/StTpcdEdxCorrection.h @@ -25,7 +25,7 @@ struct dE_t { }; //________________________________________________________________________________ struct dEdxCorrection_t { - dEdxCorrection_t(const Char_t *name = "",const Char_t *title = "", TChair *chair=0, Int_t n=0) : + dEdxCorrection_t(const Char_t *name = "",const Char_t *title = "", TChair *chair=0) : Name(name), Title(title), Chair(chair) {} const Char_t *Name; const Char_t *Title; @@ -62,7 +62,7 @@ class StTpcdEdxCorrection : public TObject { kzCorrection = 22,//Z ktpcMethaneIn = 23,//m ktpcGasTemperature = 24,//T - ktpcWaterOut = 25,//W 7 + ktpcWaterOut = 25,//W kSpaceCharge = 26,//C space charge near the wire kPhiDirection = 27,//p correction wrt local interception angle kTanL = 28,//p correction wrt local tan(lambda) diff --git a/StRoot/StdEdxY2Maker/StdEdxY2Maker.cxx b/StRoot/StdEdxY2Maker/StdEdxY2Maker.cxx index 0960594081a..7adeb8f1167 100644 --- a/StRoot/StdEdxY2Maker/StdEdxY2Maker.cxx +++ b/StRoot/StdEdxY2Maker/StdEdxY2Maker.cxx @@ -230,6 +230,8 @@ Int_t StdEdxY2Maker::InitRun(Int_t RunNumber){ } LOG_WARN << " dx2L in dE/dx predictions "<< endm; } + St_tpcPadGainT0C::instance(); // activate extra gain corrections for tpx + St_itpcPadGainT0C::instance(); // activate extra gain corrections for iTPC return kStOK; } //_______________________________________________________________________________ @@ -907,7 +909,9 @@ Int_t StdEdxY2Maker::Make(){ for(Int_t pad = 1; pad<=noOfPadsAtRow; pad++) { Int_t iRdo = StDetectorDbTpcRDOMasks::instance()->rdoForPadrow(sector,row,pad); if ( ! StDetectorDbTpcRDOMasks::instance()->isOn(sector,iRdo)) continue; - AlivePads->Fill(sector, row, pad, St_tpcPadGainT0BC::instance()->Gain(sector,row,pad)); + Double_t gain = St_tpcPadGainT0BC::instance()->Gain(sector,row,pad); + if (gain <= 0.0) continue; + AlivePads->Fill(sector, row, pad, gain); } } } @@ -941,8 +945,10 @@ Int_t StdEdxY2Maker::Make(){ } #ifdef __CHECK_RDOMAP_AND_VOLTAGE__ Int_t pad = tpcHit->pad(); +#if 0 Int_t iRdo = StDetectorDbTpcRDOMasks::instance()->rdoForPadrow(sector,row,pad); if ( ! StDetectorDbTpcRDOMasks::instance()->isOn(sector,iRdo)) continue; +#endif ActivePads->Fill(sector, row, pad, adc); #endif /* __CHECK_RDOMAP_AND_VOLTAGE__ */ } diff --git a/StRoot/StiCA/StiCATpcSeedFinder.cxx b/StRoot/Sti/StiCATpcSeedFinder.cxx similarity index 97% rename from StRoot/StiCA/StiCATpcSeedFinder.cxx rename to StRoot/Sti/StiCATpcSeedFinder.cxx index 575a487efb8..eeefe44b25c 100644 --- a/StRoot/StiCA/StiCATpcSeedFinder.cxx +++ b/StRoot/Sti/StiCATpcSeedFinder.cxx @@ -192,5 +192,3 @@ StiDebug::Count("Reused_Pct",reUsed, pct); } mEnded = 3; return 0; } -//________________________________________________________________________________ -StiCATpcSeedFinder* StiCALoader::New() { return new StiCATpcSeedFinder;} diff --git a/StRoot/StiCA/StiCATpcSeedFinder.h b/StRoot/Sti/StiCATpcSeedFinder.h similarity index 91% rename from StRoot/StiCA/StiCATpcSeedFinder.h rename to StRoot/Sti/StiCATpcSeedFinder.h index daf0a0bda8f..e300cbfcf18 100644 --- a/StRoot/StiCA/StiCATpcSeedFinder.h +++ b/StRoot/Sti/StiCATpcSeedFinder.h @@ -42,12 +42,4 @@ class StiCATpcSeedFinder: public StiTrackFinder std::vector *mSeeds; }; -class StiCALoader { -public: -static StiCATpcSeedFinder* New(); -#if 0 -ClassDef(StiCALoader,0) -#endif -}; - #endif diff --git a/StRoot/StiCA/StiCATpcTrackerInterface.cxx b/StRoot/Sti/StiCATpcTrackerInterface.cxx similarity index 100% rename from StRoot/StiCA/StiCATpcTrackerInterface.cxx rename to StRoot/Sti/StiCATpcTrackerInterface.cxx diff --git a/StRoot/StiCA/StiCATpcTrackerInterface.h b/StRoot/Sti/StiCATpcTrackerInterface.h similarity index 100% rename from StRoot/StiCA/StiCATpcTrackerInterface.h rename to StRoot/Sti/StiCATpcTrackerInterface.h diff --git a/StRoot/Sti/StiDefaultToolkit.cxx b/StRoot/Sti/StiDefaultToolkit.cxx index 7851fea4aac..8e203daceb3 100644 --- a/StRoot/Sti/StiDefaultToolkit.cxx +++ b/StRoot/Sti/StiDefaultToolkit.cxx @@ -390,6 +390,7 @@ #include "Sti/StiDefaultTrackFilter.h" #include "Sti/StiDetectorGroup.h" #include "Sti/StiDetectorGroups.h" +#include "Sti/StiCATpcSeedFinder.h" #include "StDetectorDbMaker/StiHitErrorCalculator.h" #include "StiTpc/StiTpcHitLoader.h" #include "StiSvt/StiSvtHitLoader.h" @@ -639,11 +640,7 @@ StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderKNN() //______________________________________________________________________________ StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderCA() { - gSystem->Load("TPCCATracker"); - gSystem->Load("StiCA"); - auto *mySeed = (StiTrackFinder*)gROOT->ProcessLineFast("StiCALoader::New()"); - assert(mySeed); - return mySeed; + return new StiCATpcSeedFinder(); } //______________________________________________________________________________ diff --git a/StRoot/Sti/StiMasterDetectorBuilder.cxx b/StRoot/Sti/StiMasterDetectorBuilder.cxx index 8f146366e14..0c8aca51886 100644 --- a/StRoot/Sti/StiMasterDetectorBuilder.cxx +++ b/StRoot/Sti/StiMasterDetectorBuilder.cxx @@ -25,7 +25,6 @@ void StiMasterDetectorBuilder::build(StMaker&source) { if (! gGeoManager) StiVMCToolKit::GetVMC(); - TGeoManager *gGeoManagerSV = gGeoManager; gGeoManager = 0; StMaker *chain=StMaker::GetChain(); LOG_INFO << "We are StiMasterDetectorBuilder::build() and will clone the geometry if exists" << endm; @@ -35,12 +34,6 @@ void StiMasterDetectorBuilder::build(StMaker&source) } #if 1 - if ( gGeoManagerSV ){ - LOG_INFO << "Create a clone of VmcGeometry for reconstruction" << endm; - gGeoManagerSV->Clone("CloneGeom"); - } else { - LOG_INFO << "Could not get a pointer to gGeoManager " << endm; - } #else if ( chain ) { LOG_INFO << "StiMasterDetectorBuilder::build() : Create clone of VmcGeometry by reinitialization for reconstruction" < - -/*! - Abstract base class defining a factory mechanism -

- This class defines the concept of factory, an agent responsible for the - creation or instantiation of a given type of class. The class is templated. - The template represents the base class to be intanstiated and served by the - factory. Implementation (derived class) may serve objects from class derived - based on the "Abstract" template class. -*/ -class FactoryB : public TNamed -{ -protected: - - FactoryB(const char *name); - - virtual ~FactoryB() - {;} - -public: - ///Clear/delete all objects owned by this factory - virtual void clear()=0; - - ///Reset this factory - virtual void reset()=0; - - ///Free an object for reuse - virtual void free(void *obj)=0; - - ///Free an object for reuse - static void Free(void *obj); - static int Alive(void *obj); - - void setFastDelete() {fFastDel=1;} - void setMaxIncrementCount(unsigned int maxCount) {fMaxCount=maxCount;} - unsigned int getMaxIncrementCount() const {return fMaxCount; } - unsigned int getCurrentSize() const {return fCurCount; } - unsigned int getCurrentCount() const {return fCurCount; } -protected: - unsigned int fMaxCount; - unsigned int fCurCount; - unsigned int fUseCount; - unsigned int fFastDel; - unsigned int fInstCount; - unsigned int fFreeCount; -static double fgTotal; -}; - -template -class FactoryT : public FactoryB -{ -public: - - FactoryT(const char *name): FactoryB(name) - {;} - - virtual ~FactoryT() - {;} - - ///Free an object for reuse - virtual void free(Abstract *obj)=0; - virtual void free(void *obj)=0; - - ///Get a pointer to instance of objects served by this factory. - virtual Abstract *getInstance()=0; - -}; - -inline void FactoryB::Free(void *obj) -{ - void **v = ((void**)obj) - 1; - if (!*v) v--; - assert((*v)!=(void*)0xFF); - assert(((*(int*)v)&3)==0); - FactoryB *f = (FactoryB*)((*v)); - f->free(obj); -} -inline int FactoryB::Alive(void *obj) -{ - void **v = ((void**)obj) - 1; - if (!*v) v--; - return ((*v)!=(void*)0xFF); -} - -#endif diff --git a/StRoot/Stv/Factory/StvFactory.h b/StRoot/Stv/Factory/StvFactory.h deleted file mode 100644 index b8dc71b7679..00000000000 --- a/StRoot/Stv/Factory/StvFactory.h +++ /dev/null @@ -1,207 +0,0 @@ -#ifndef StvFactory_H -#define StvFactory_H -#include -#include -#include -#include "FactoryT.h" -/*! - Abstract base class defining a factory mechanism -

- This class defines the concept of factory, an agent responsible for the - creation or instantiation of a given type of class. The class is templated. - The template represents the base class to be intanstiated and served by the - factory. Implementation (derived class) may serve objects from class derived - based on the "Factorized" template class. -*/ - - -//______________________________________________________________________________ -template -class StvHolder { -public: - StvHolder(); -public: - StvHolder *fNext; - FactoryB *fFact; - Object fObj; -}; - -//______________________________________________________________________________ -template -class StvBlock { -public: -enum {kSize=100}; - StvBlock(StvBlock **bTop,StvHolder **hTop,char *buf); -void reset(StvBlock **bTop,StvHolder **hTop); -unsigned int getSize() const {return kSize;} - -StvBlock *fNext; -char *fBuff; -StvHolder fArr[kSize]; -}; - - -//______________________________________________________________________________ -template -class StvFactory : public FactoryT -{ -public: -void free(Abstract *obj); -void free(void *obj) { free((Abstract*)obj);} - ///Clear/delete all objects owned by this factory -void clear(); -void print(); - - ///Reset this factory -void reset(); - - ///Get a pointer to instance of objects served by this factory. -Abstract* getInstance(); -static StvFactory* myInstance(); - -protected: - StvFactory(); - ~StvFactory(){this->clear();} - -StvBlock *fBTop; -StvHolder *fHTop; - -}; -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -template -StvBlock::StvBlock(StvBlock **bTop,StvHolder **hTop,char *buf) -{ - fBuff=buf; - this->reset(bTop,hTop); -} -template -void StvBlock::reset(StvBlock **bTop,StvHolder **hTop) -{ - fNext=*bTop; *bTop=this; - for (int i=0;i -StvHolder::StvHolder() -{ - char *b = (char*)&fNext; - memset(b,0,((char*)&fObj)-b); -} -//______________________________________________________________________________ -//______________________________________________________________________________ -template -StvFactory::StvFactory():FactoryT("") -{ - fHTop=0;fBTop=0; - this->SetName(typeid(*this).name()); - printf("*** FactoryT created *** %s\n",this->GetName()); -} -template -StvFactory* StvFactory::myInstance() -{ - static StvFactory* my=0; - if (!my) my = new StvFactory; - return my; -} -//______________________________________________________________________________ -template -Abstract *StvFactory::getInstance() -{ - enum {FENCE = sizeof(double)+2*sizeof(long)+1}; - if (!fHTop) { - assert ("StvFactory::getInstance() - Too many instances" && - this->fCurCount < this->fMaxCount); - - if (this->fFastDel) { - unsigned int nBuf = sizeof(StvBlock) + FENCE; - char *cBuf = new char[nBuf]; - cBuf[nBuf-1]=46; - new((StvBlock*)cBuf) StvBlock(&fBTop,&fHTop,cBuf); - assert(cBuf[nBuf-1]==46); - } else { - new StvBlock(&fBTop,&fHTop, 0); - } - this->fCurCount += fBTop->getSize(); - this->fgTotal += sizeof(StvBlock)*1e-6; - } - this->fInstCount++; - StvHolder *h = fHTop; - fHTop = h->fNext; - h->fNext=0; - h->fObj.reset(); - this->fUseCount++; - assert(!h->fFact || (unsigned long)h->fFact == 0xFF); - h->fFact = this; //set factory addres - return &h->fObj; -} -//______________________________________________________________________________ -template -void StvFactory::free(Abstract *obj) -{ - static const unsigned int shift = (char*)(&(((StvHolder*)1)->fObj))-(char*)1; - obj->unset(); - StvHolder* h = (StvHolder*)((char*)obj-shift); - assert(h->fFact == this); - h->fNext = fHTop; h->fFact = (FactoryB*)0xFF; - fHTop=h; - this->fUseCount--; this->fFreeCount++; -} - -//______________________________________________________________________________ -template -void StvFactory::clear() -{ - double sz=0; - StvBlock* b = fBTop; - while (b) { - StvBlock* d = b; - b=b->fNext; - if (this->fFastDel) {delete [] d->fBuff;} else { delete d;} - sz += sizeof(StvBlock); - this->fgTotal -= sizeof(StvBlock)*1e-6; - } - fBTop=0; fHTop=0; this->fCurCount=0; this->fUseCount=0; - printf("*** %s::clear() %g MegaBytes Total %g Inst/Free=%d %d\n" - ,this->GetName(),sz*1e-6 - ,this->fgTotal*1e-6,this->fInstCount,this->fFreeCount); - this->fInstCount=0; this->fFreeCount=0; -} -//______________________________________________________________________________ -template -void StvFactory::print() -{ - double sz=0; - StvBlock* b = fBTop; - while (b) { - b=b->fNext; - sz += sizeof(StvBlock); - this->fgTotal -= sizeof(StvBlock)*1e-6; - } - this->fCurCount=0; this->fUseCount=0; - printf("*** %s::print() %g MegaBytes Total %g Inst/Free=%d %d \n" - ,this->GetName(),sz*1e-6 - ,this->fgTotal ,this->fInstCount,this->fFreeCount); -} -//______________________________________________________________________________ -template -void StvFactory::reset() -{ - if (!this->fUseCount) return; - - typedef StvBlock B_t; - B_t* b = fBTop; - fBTop=0;fHTop=0; - while (b) { - B_t* n = b->fNext; - b->reset(&fBTop,&fHTop); - b=n; - } - this->fUseCount=0; -} -#endif diff --git a/StRoot/Stv/StvConst.cxx b/StRoot/Stv/StvConst.cxx deleted file mode 100644 index 46fa178fa32..00000000000 --- a/StRoot/Stv/StvConst.cxx +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include "StMaker.h" -#include "StvConst.h" - -const StvConst *StvConst::mgConst=0; - -//______________________________________________________________________________ -StvConst::StvConst() -{ - mFw = 0; - assert(!mgConst); - mgConst = this; - StMaker *mk = StMaker::GetChain(); - St_StvKonst *tb = (St_StvKonst*)mk->GetDataBase("Calibrations/tracker/StvKonst"); - assert(tb); - int nCols = tb->GetNumberOfColumns(); - assert(nCols); - tb->Print(); - -// check table for zeros. All the fields either float or int - int *row = (int*)tb->GetTable(); - for (int i=0;iGetTable()); -} -//______________________________________________________________________________ -const StvKonst_st *StvConst::At(int idx) const -{ - if (!mFw) { - mFw = new StvKonst_st; - *mFw = *this; - memcpy(&mFw->mMinSeedHits,&mFw->mMinSeedHitsFw, - (char*)&mMinSeedHitsFw-(char*)&mMinSeedHits); - assert(mFw->mZMax==mFw->mZMaxFw); - } - switch(idx) { - case 0: return this; - case 1: return mFw; - default: assert(0 && "Wring index in StvConst::At(indedx)"); - } -} - diff --git a/StRoot/Stv/StvConst.h b/StRoot/Stv/StvConst.h deleted file mode 100644 index 1cdd101ee20..00000000000 --- a/StRoot/Stv/StvConst.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __StvConst_h_ -#define __StvConst_h_ -#include "TNamed.h" -#include "tables/St_StvKonst_Table.h" - -class StvConst : protected StvKonst_st -{ -public: -StvConst(); -virtual ~StvConst(){mFw=0;} -static const StvConst *Inst(){ return mgConst;} -const StvKonst_st *At(int idx) const; -private: - -mutable StvKonst_st *mFw; -static const StvConst *mgConst; -ClassDef(StvConst,0)// -}; -#endif //__StvConst_h_ - - diff --git a/StRoot/Stv/StvDiver.cxx b/StRoot/Stv/StvDiver.cxx deleted file mode 100644 index 38d61b0990b..00000000000 --- a/StRoot/Stv/StvDiver.cxx +++ /dev/null @@ -1,650 +0,0 @@ -#include "StvDiver.h" -#include "TSystem.h" -#include "TGeoManager.h" -#include "TGeoVolume.h" -#include "TVirtualMCStack.h" -#include "TGeant3TGeo.h" -#include "StarVMC/GeoTestMaker/StVMCApplication.h" -#include "StarVMC/GeoTestMaker/StMCStack.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StvUtil/StvDebug.h" -#include "StvUtil/StvNodePars.h" -#include "StarMagField.h" -#include "StvUtil/StvELossTrak.h" -#include "THelixTrack.h" -#include "TRandom.h" -#include "StvToolkit.h" - -enum DiverCons { kNearBeam=1 }; - - - -class MyRandom : public TRandom -{ -public: -virtual Double_t Rndm(Int_t i = 0) {return 0.5;} -virtual Double_t Gaus(Double_t mean = 0, Double_t sigma = 1) {return 0.0;} -}; -static MyRandom* gMyRandom=0; -static const double gMyPiMass=0.1396; -static const int gMyPiPdg =9999; - -enum {kNMany = 10}; -StvDiver* StvDiver::mgInst = 0; - -ClassImp(StvDiver) - - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StvDiver::StvDiver(const char *name):TNamed(name,"") -{ - assert(!mgInst); - memset(mBeg,0,mEnd-mBeg+1); -} -//_____________________________________________________________________________ -StvDiver* StvDiver::Inst() -{ - if (mgInst) return mgInst; - mgInst = new StvDiver("Diver"); - mgInst->Init(); - return mgInst; -} -//_____________________________________________________________________________ -int StvDiver::Init() -{ - gMyRandom = new MyRandom; - mHelix = new THelixTrack; - mELoss = 0; - StVMCApplication *app = (StVMCApplication*)TVirtualMCApplication::Instance(); - assert(app); - mSteps = ( StvMCStepping*)app->GetStepping(); - assert(mSteps); - mSteps->Set(mHelix); - mGen = (StvMCPrimaryGenerator*)app->GetPrimaryGenerator(); - mFld = (StvMCField* )app->GetField(); - mSteps->Set(mFld); - - TVirtualMC::GetMC()->DefineParticle( gMyPiPdg,"MyPi+",kPTHadron,gMyPiMass, 1,1e+10 - ,"pType", 0., 0, 1, 0, 1, 1, 1, 0, 1, 1); - TVirtualMC::GetMC()->DefineParticle(-gMyPiPdg,"MyPi-",kPTHadron,gMyPiMass,-1,1e+10 - ,"pType", 0., 0, 1, 0, 1, 1, 1, 0, 1, 1); - return 0; -} -//_____________________________________________________________________________ -StvELossTrak *StvDiver::TakeELoss() -{ - StvELossTrak *el=mELoss; mELoss=0;mSteps->Set(mELoss); return el; -} -//_____________________________________________________________________________ -void StvDiver::SetRZmax(double rMax,double zMax) -{ - StVMCApplication *app = (StVMCApplication*)TVirtualMCApplication::Instance(); - app->SetRZmax(rMax,zMax); -} - -//_____________________________________________________________________________ -void StvDiver::Reset() -{ - mSteps->Reset(); -} -//_____________________________________________________________________________ -void StvDiver::SetOpt(int opt) -{ - mSteps->SetOpt(opt); -} -//_____________________________________________________________________________ -void StvDiver::SetTarget(const double target[3],int nTarget) -{ - mSteps->SetTarget(target,nTarget); -} -//_____________________________________________________________________________ -int StvDiver::Dive() -{ -static StvToolkit* kit = StvToolkit::Inst(); - mGen->Set(mInpPars,mDir); - - -// ****************** Replacing ROOT random by empty one. Dangerous -// ****************** At the end of method it is returned back - assert(gRandom != gMyRandom); - TRandom *myRandom = gRandom; - gRandom = gMyRandom; - - assert(fabs(mInpPars->_hz)<0.01); - mELoss = kit->GetELossTrak(); mSteps->Set(mELoss); - mELoss->Reset(mDir); - int myExit = 0; - mInpPars->get(mHelix); - mInpErrs->Get(mHelix); - mHlxDeri[0][0]=0; //Mark this matrix is not filled - if (!mDir) mHelix->Backward(); - StvNodePars tmpPars; - for (int iMany=0; iMany ProcessEvent(); - myExit = mSteps->GetExit(); - if (myExit & StvDiver::kDiveBreak) break; - double pos[4]; - mSteps->CurrentPosition().GetXYZT(pos); - auto &mom = mSteps->CurrentMomentum(); - mOutPars->_x = pos[0]; - mOutPars->_y = pos[1]; - mOutPars->_z = pos[2]; - mOutPars->_psi = mom.Phi(); - mOutPars->_ptin = -mSteps->Charge()/mom.Pt(); - mOutPars->_tanl = mom[2]*fabs(mOutPars->_ptin); - mOutPars->_hz = mFld->GetHz(pos); - mOutPars->ready(); - mOutErrs->Set(mHelix,mOutPars->_hz); - assert(mOutErrs->mPP>0); - mOutPars->convert(*mOutDeri,mHlxDeri); - if (!mDir) { - mOutPars->reverse(); - mOutDeri->Reverse(); - mOutErrs->Backward(); - assert(mOutErrs->mPP>0); - } - if (!(myExit&StvDiver::kDiveMany)) break; - if ( (myExit&StvDiver::kDiveHits)) break; - if ( (myExit&StvDiver::kDiveDca )) break; -// Too many attempts. Move blindly forward and continue. - double bigStep = mOutPars->getRxy(); - bigStep = 0.1 + bigStep/200; //Estimate bigstep - double dcaStep = mHelix->Path(0.,0.); - if (dcaStep>0 && dcaStepMove(bigStep); - tmpPars.set(mHelix,mOutPars->_hz); - if (!mDir) tmpPars.reverse(); //account direction - mGen->Set(&tmpPars,mDir); - } - assert (myExit >1 || mInpPars->_ptin * mOutPars->_ptin >=0); - gRandom = myRandom; - - return mSteps->GetExit(); -} -//_____________________________________________________________________________ -void StvDiver::Set(const StvNodePars *inpar,const StvFitErrs *inerr,int idir) -{ - mInpPars= inpar; - mInpErrs= inerr; - mDir = idir; - mSteps->SetDir(mDir); - mGen->Set(inpar,idir); -} -//_____________________________________________________________________________ -void StvDiver::Set(StvNodePars *otpar,StvFitErrs *oterr,StvFitDers *deriv) -{ - mOutPars = otpar; - mOutErrs = oterr; - mOutDeri = deriv; - mSteps->Set(&mHlxDeri); - -} -//_____________________________________________________________________________ -double StvDiver::GetLength() const -{ - return TVirtualMC::GetMC()->TrackLength(); -} - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -ClassImp(StvMCInitApp) - -//_____________________________________________________________________________ -StvMCInitApp::StvMCInitApp() -{} -//_____________________________________________________________________________ -int StvMCInitApp::Fun() -{ - StVMCApplication *app = (StVMCApplication*)TVirtualMCApplication::Instance(); - TVirtualMC *myMC = new TGeant3TGeo("C++ Interface to Geant3"); - Info("Init","TGeant3TGeo has been created."); - StvMCConstructGeometry *geo = new StvMCConstructGeometry(app->GetName()); - app->SetConstructGeometry(geo); - app->SetPrimaryGenerator(new StvMCPrimaryGenerator()); - app->SetField(new StvMCField); - StvMCStepping *steps = new StvMCStepping(""); - app->SetStepping(steps); - - app->SetDebug(0); - myMC->SetStack(new StMCStack(1)); - myMC->Init(); - myMC->BuildPhysics(); - ((TGeant3*)myMC)->SetDEBU(0,0,0); - ((TGeant3*)myMC)->SetMaxNStep(-1000); - - Gcphys_t* gcphys = ((TGeant3*)myMC)->Gcphys(); if (gcphys){} - - Info("Init","switch off physics"); - myMC->SetProcess("DCAY", 0); - myMC->SetProcess("ANNI", 0); - myMC->SetProcess("BREM", 0); - myMC->SetProcess("COMP", 0); - myMC->SetProcess("HADR", 0); - myMC->SetProcess("MUNU", 0); - myMC->SetProcess("PAIR", 0); - myMC->SetProcess("PFIS", 0); - myMC->SetProcess("PHOT", 0); - myMC->SetProcess("RAYL", 0); - myMC->SetProcess("LOSS", 4); // no fluctuations - // myMC->SetProcess("LOSS 1"); // with delta electron above dcute - myMC->SetProcess("DRAY", 0); - myMC->SetProcess("MULS", 0); - myMC->SetProcess("STRA", 0); - myMC->SetCut("CUTGAM", 1e-3 ); - myMC->SetCut("CUTELE", 1e-3 ); - myMC->SetCut("CUTHAD", .001 ); - myMC->SetCut("CUTNEU", .001 ); - myMC->SetCut("CUTMUO", .001 ); - myMC->SetCut("BCUTE", .001 ); - myMC->SetCut("BCUTM", .001 ); - myMC->SetCut("DCUTE", 1e-3 ); - myMC->SetCut("DCUTM", .001 ); - myMC->SetCut("PPCUTM", .001 ); - myMC->SetCut("TOFMAX", 50.e-6); - - return 0; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -ClassImp(StvMCStepping) - -//_____________________________________________________________________________ -StvMCStepping::StvMCStepping(const char *name,const char *tit) - : StMCStepping(name,tit) -{ - memset(fFist,0,fLast-fFist); - fNTarget = 2; - fNearBeam = kNearBeam; - fHALLVolu = gGeoManager->FindVolumeFast("HALL"); -} -//_____________________________________________________________________________ -StvMCStepping::~StvMCStepping() -{ -} -//_____________________________________________________________________________ -void StvMCStepping::Reset() -{ - memset(fFist,0,fMidl-fFist); - fNTarget = 2; -} -//_____________________________________________________________________________ -void StvMCStepping::SetTarget(const double *target,int nTarget) -{ - memcpy(fTarget,target,sizeof(double)*nTarget); - fNTarget = nTarget; -} -//_____________________________________________________________________________ -void StvMCStepping::SetOpt(int opt) -{ - fOpt = opt; - fNTarget = (fOpt&StvDiver::kTarg3D)? 3:2; -} -//_____________________________________________________________________________ -void StvMCStepping::Print(const Option_t* opt) const -{ -StMCStepping::Print(opt); -} -//_____________________________________________________________________________ -int StvMCStepping::Fun() -{ -static StTGeoProxy *tgh = StTGeoProxy::Instance(); -//static const StTGeoHitShape *hitShape = tgh->GetHitShape(); -static TVirtualMC *virtualMC = TVirtualMC::GetMC(); -static const TVirtualMCApplication *virtApp = TVirtualMCApplication::Instance(); -const double Rmax = virtApp->TrackingRmax(); -const double Zmax = virtApp->TrackingZmax(); - - - TString ts,modName; - fKount++; - -double prevLen = fPrevLength; - Case(); - -static const char *myDebug = gSystem->Getenv("StvDEBUG"); -if (myDebug) { - double pos[4],b[3]; - fCurrentPosition.GetXYZT(pos); - fField->FunDD(pos,b); - StvDebug::Count("BZvsZ",pos[2],b[2]); - double Br = sqrt(b[0]*b[0]+b[1]*b[1]); - double Ba = sqrt(b[2]*b[2]+Br*Br); - StvDebug::Count("BRvsZ",pos[2],Br); - StvDebug::Count("BAvsZ",pos[2],Ba); - StvDebug::Count("TanVsZ",pos[2],Br/b[2]); - printf("Fun(%d): Z=%g Hz=%g Hr=%g path = %s\n" - ,fKount,pos[2],b[2],Br,gGeoManager->GetPath()); -} - - - -int meAgain = (fNode==fPrevNode); -if (meAgain) meAgain = (fPrevPath == tgh->GetPath()); -if (!meAgain) {fPrevNode = fNode; fPrevPath == tgh->GetPath();} - - if (fabs(fCurrentPosition.Z()) >Zmax) fKaze = kOUTtrack; - if (fCurrentPosition.Pt() >Rmax) fKaze = kOUTtrack; - - assert(fCurrentLength< 10000); - assert(fEnterLength < 10000); - -// StTGeoProxy::Instance()->Print(KazeAsString(fKaze)); -// printf("fEnterLength=%g fCurrentLength=%g Rxy=%g Z=%g\n\n" -// , fEnterLength, fCurrentLength,fCurrentPosition.Perp(),fCurrentPosition.Z()); - -SWITCH: int myKaze = fKaze; -//========================= - -// printf("KASE=%d Pos(%g %g %g) In %s\n",fKaze -// ,fCurrentPosition.X(),fCurrentPosition.Y(),fCurrentPosition.Z() -// ,gGeoManager->GetPath()); - - - - switch (fKaze) { - case kNEWtrack:; - - case kENTERtrack:;{ - double *X = &fCurrentPosition[0]; - fHitted = ((!meAgain) && tgh->IsHitted(X)); - if (fVolume==fHALLVolu) {fKaze=kENDEDtrack; break;} -// int outSide = hitShape->Outside(fCurrentPosition.Z(),fCurrentPosition.Perp()); -// if (outSide && ((fOpt&(StvDiver::kTarg2D|StvDiver::kTarg3D))==0)) {fKaze=kENDEDtrack; break;} - if ((fExit = BegVolume())) fKaze=kENDEDtrack;} - break; - - - case kOUTtrack: - case kENDEDtrack: - fExit=StvDiver::kDiveBreak; - virtualMC->StopTrack(); - break; - - case kCONTINUEtrack: - case kIgnore: - break; - - case kEXITtrack: - { - fExit = EndVolume(); - if (!fExit) break; - fPrevPath =""; - if (fExit & StvDiver::kDiveHits) fPrevPath = tgh->GetPath(); - virtualMC->StopTrack(); - } - break; - - default: - Error("Case","Unexpected case %x == %s",fCase,fCasName.Data()); - assert(0); - } - if (fKaze!=myKaze) goto SWITCH; - if (fExit) return 0; - if (fKaze!=fLastKaze) {fLastNumb=0; fLastKaze=fKaze; return 0;} - fLastNumb++; if (fLastNumb<100) return 0; - fLastNumb=0; - fExit =StvDiver::kDiveMany; - fExit |= TooMany(); - virtualMC->StopTrack(); - return 0; -} -//_____________________________________________________________________________ -int StvMCStepping::BegVolume() -{ - - fPrevMat = fMaterial; - fELossTrak->Set(fMaterial,fEnterMomentum.Vect().Mag()); - fTooManyLength = fCurrentLength; - return (IsDca00(0)); -} -//_____________________________________________________________________________ -int StvMCStepping::EndVolume() -{ - double pos[4]={0},mom[4]={0}; - - int isDca = (IsDca00(1)); - if (isDca&StvDiver::kDiveBreak) return isDca; - fTooManyLength = fCurrentLength; - double dL = fCurrentLength-fEnterLength; - if (dL<1e-6) return isDca; - fCurrentPosition.GetXYZT(pos); - fCurrentMomentum.GetXYZT(mom); - double pt = fCurrentMomentum.Pt(); - double nowRho = -fField->GetHz(pos)/pt*fCharge; - double wasRho = fHelix->GetRho(); - -assert(nowRho*wasRho> -1./(200*200)); - fELossTrak->Add(dL); - -#if 0 -{//????????????????? - double E0 = fStartMomentum.E(); - double E1 = fCurrentMomentum.E(); - double dE = fabs(E1-E0); -assert(dEELoss())<0.3*dE+kStMCSMinEabs); -}//????????????????? -#endif - - if ((fOpt&StvDiver::kDoErrs)) { //Errors and derivatives requested - fHelix->Set((2*wasRho+nowRho)/3); - if (!(*fDeriv)[0][0]) { //first time - fHelix->Move(dL,*fDeriv); - } else { - StvHlxDers T,R; - fHelix->Move(dL,T); - Multiply(R,T,*fDeriv); - *fDeriv=R; - } - } - - fHelix->Set(pos,mom,nowRho); - return isDca; -} -//_____________________________________________________________________________ -int StvMCStepping::IsDca00(int begEnd) -{ - fCurrentSign = 0; - for (int itg = 0; itgGetHz(pos)/pt*fCharge; - fHelix->Set(pos,mom,rho); - return 0; - } - - case 1:; // EndVolume -// case 2: // Continue volume - { // end volume - double dL = fCurrentLength-fEnterLength; - if (dL<1e-6) return 0; //Too small step, ignore it - - int ans = 0; - if (IsOverstep()>0) {//Over step DCA00 point? - ans |= StvDiver::kDiveDca; - if ((fOpt&StvDiver::kTarg2D)==0) return ans;} - else { fStartSign = fCurrentSign; } - - - if ((fOpt & StvDiver::kTargHit) && fHitted ) {//We are in hitted volume - ans |= StvDiver::kDiveHits; - } - if (!ans) {return 0;} //Nothing interesting(ni figa), get out -// -// Now there are Hit or Dca cases - THelixTrack th(*fHelix); - double dcaL = (ans & StvDiver::kDiveDca)? th.Path(fTarget[0],fTarget[1]) : dL/2; - if (dcaL< 0) return StvDiver::kDiveBreak; //Crazy case - - double nowP = fCurrentMomentum.P(); - double wasP = fEnterMomentum.P(); - double medP = (wasP*(dL-dcaL)+nowP*dcaL)/dL; - // Update end position - th.Move(dcaL); - fCurrentLength=fEnterLength+dcaL; - fCurrentPosition.SetVect(TVector3(th.Pos())); - fCurrentMomentum.SetVectM(TVector3(th.Dir())*medP,fMass); - return ans; - } - } - return StvDiver::kDiveBreak; -} -//_____________________________________________________________________________ -int StvMCStepping::TooMany() -{ - double dL = fCurrentLength-fTooManyLength; - if (dL<1e-6) return 0; - fEnterLength = fTooManyLength; - return EndVolume(); -} -//_____________________________________________________________________________ -int StvMCStepping::IsOverstep() const -{ -/// return 0=no overstep -/// 1=overstep of nearest to (0,0) point -/// -1=overstep of far to (0,0) point - - if ((fStartSign<0) == (fCurrentSign<0)) return 0; - const double *p = fHelix->Pos(); - const double *d = fHelix->Dir(); - double rho = fHelix->GetRho(); - double cosl= fHelix->GetCos(); - double dis = fabs((d[0]*p[1]-d[1]*p[0])*rho/cosl); - return (dis<1)? 1:-1; -} - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -void StvMCStepping::Finish(const char *opt) -{ -} -ClassImp(StvMCConstructGeometry) - -//_____________________________________________________________________________ -StvMCConstructGeometry::StvMCConstructGeometry(const char *gy) - : GCall(gy,"StvMCConstructGeometry") -{ -} -//_____________________________________________________________________________ -int StvMCConstructGeometry::Fun() -{ - TVirtualMC *myMC = TVirtualMC::GetMC(); - myMC->SetRootGeometry(); - Info("Init","switch off physics"); - myMC->SetProcess("DCAY", 0); - myMC->SetProcess("ANNI", 0); - myMC->SetProcess("BREM", 0); - myMC->SetProcess("COMP", 0); - myMC->SetProcess("HADR", 0); - myMC->SetProcess("MUNU", 0); - myMC->SetProcess("PAIR", 0); - myMC->SetProcess("PFIS", 0); - myMC->SetProcess("PHOT", 0); - myMC->SetProcess("RAYL", 0); - myMC->SetProcess("LOSS", 4); // no fluctuations - // myMC->SetProcess("LOSS 1"); // with delta electron above dcute - myMC->SetProcess("DRAY", 0); - myMC->SetProcess("MULS", 0); - myMC->SetProcess("STRA", 0); - myMC->SetCut("CUTGAM", 1e-3 ); - myMC->SetCut("CUTELE", 1e-3 ); - myMC->SetCut("CUTHAD", .001 ); - myMC->SetCut("CUTNEU", .001 ); - myMC->SetCut("CUTMUO", .001 ); - myMC->SetCut("BCUTE", .001 ); - myMC->SetCut("BCUTM", .001 ); - myMC->SetCut("DCUTE", 1e-3 ); - myMC->SetCut("DCUTM", .001 ); - myMC->SetCut("PPCUTM", .001 ); - myMC->SetCut("TOFMAX", 50.e-6); - - - - return 0; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -ClassImp(StvMCPrimaryGenerator); -//_____________________________________________________________________________ -StvMCPrimaryGenerator::StvMCPrimaryGenerator() -{ - mPars=0; - mDir=0; // direction of moving 1=along track; 0=opposite -} - -//_____________________________________________________________________________ -int StvMCPrimaryGenerator::Fun() -{ - - // Add one primary particle to the user stack (derived from TVirtualMCStack). - // Track ID (filled by stack) - // Option: to be tracked - - int toBeDone = 1; - - // Particle type - int pdg = (mPars->getCharge()>0)? gMyPiPdg:-gMyPiPdg; - // Particle momentum - double p[3]={0}; - mPars->getMom(p); - - if (!mDir) { pdg = -pdg; p[0]=-p[0]; p[1]=-p[1];p[2]=-p[2];} - - // Polarization -static const double polx = 0.,poly = 0.,polz = 0.; - - // Position -static const double tof = 0.; - - double e = sqrt(gMyPiMass*gMyPiMass + mPars->getP2()); - // Add particle to stack - assert(e>1e-6); - int ntr=1; - TVirtualMC::GetMC()->GetStack()->Clear(); - TVirtualMC::GetMC()->GetStack()->PushTrack( - toBeDone,-1,pdg,p[0], p[1], p[2],e - ,mPars->_x, mPars->_y, mPars->_z,tof - ,polx,poly,polz, kPPrimary, ntr, 1.,0); - return 0; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -ClassImp(StvMCField) -//_____________________________________________________________________________ -StvMCField::StvMCField() -{ - mX[2] = 3e33; - mH[2] = 3e33; - mFild = StarMagField::Instance(); -} -//_____________________________________________________________________________ -int StvMCField::FunDD(const double *x,double *b) -{ - do { - if (fabs(x[2]-mX[2])>0.01) break; - if (fabs(x[1]-mX[1])>0.01) break; - if (fabs(x[0]-mX[0])>0.01) break; - if (b) memcpy(b,mH,sizeof(mH)); - return 0; - } while(0); - memcpy(mX,x,sizeof(mX)); - mFild->BField(mX,mH); - if (fabs(mH[2]) < 1e-5) mH[2]=1e-5; - if (b) memcpy(b,mH,sizeof(mH)); - return 0; -} -//_____________________________________________________________________________ -double StvMCField::GetHz(const double *x) -{ -static const Double_t EC = 2.99792458e-4; - FunDD(x,0); - return mH[2]*EC; -} diff --git a/StRoot/Stv/StvDiver.h b/StRoot/Stv/StvDiver.h deleted file mode 100644 index abbbc8d4491..00000000000 --- a/StRoot/Stv/StvDiver.h +++ /dev/null @@ -1,183 +0,0 @@ -/// \File StvDiver.h -/// \author Victor Perev 01/2010 -#ifndef StvDiver_HH -#define StvDiver_HH -#include "TNamed.h" -#include "StvUtil/StvNodePars.h" -#include "StarVMC/GeoTestMaker/GCall.h" -#include "StarVMC/GeoTestMaker/StMCStepping.h" -#include "StvUtil/StvNodePars.h" - -class StvMCStepping; -class StvMCPrimaryGenerator; -class StvELossTrak; -class StarMagField; -class StvMCField; -class TGeoMaterial; -class THelixTrack; -class StvFitErrs; -class StvNodePars; -/// \class StvDiver -class StvDiver : public TNamed -{ -protected: - StvDiver(const char *name=""); - virtual ~StvDiver(){;} -int Init(); -public: -static StvDiver* Inst(); - -enum StvDiverFlags {kDiveOk =0,kDiveHits=1,kDiveDca=2,kDiveBreak=4,kDiveMany=8}; -enum StvDiverOpt {kTargHit=1,kTarg2D =2,kTarg3D =4,kDoErrs =8}; -public: -void Reset(); -int Dive(); -void Set(const StvNodePars *inpar,const StvFitErrs *inerr,int idir); -void Set( StvNodePars *otpar, StvFitErrs *oterr,StvFitDers *deriv); -void SetTarget(const double *target,int nTarget=3); -void SetOpt(int opt); -double GetLength() const; - StvELossTrak *TakeELoss(); -void SetRZmax(double rMax,double zMax); - -protected: -static StvDiver *mgInst; - -char mBeg[1]; -int mDir; -const StvNodePars *mInpPars; -const StvFitErrs *mInpErrs; - StvNodePars *mOutPars; - StvFitErrs *mOutErrs; - StvFitDers *mOutDeri; //Out derivatives in StvFitPars notation - THelixTrack *mHelix; - StvELossTrak *mELoss; - StvHlxDers mHlxDeri; //Internal derivatives in StHelixTrack notation - StvMCStepping *mSteps; - StvMCField *mFld; -StvMCPrimaryGenerator *mGen; - -char mEnd[1]; -ClassDef(StvDiver,0); -}; -// Class StMCInitApp -// ------------------ - -class StvMCInitApp : public GCall -{ -public: - StvMCInitApp(); - ~StvMCInitApp(){} - // methods - int Fun(); -protected: - ClassDef(StvMCInitApp,0) // -}; - -// Class StvMCStepping -// ------------------ - - -class StvMCStepping : public StMCStepping -{ -public: - StvMCStepping(const char *name="",const char *tit=""); -virtual ~StvMCStepping(); - // methods - -virtual int Fun(); -void Reset (); -int GetExit() const {return fExit;} -void Set(StvELossTrak *eLoss) {fELossTrak = eLoss;} -void Set(THelixTrack *helx ) {fHelix = helx ;} -void Set(StvHlxDers *deriv) {fDeriv = deriv ;} -void Set(StvMCField *field) {fField = field ;} -void SetOpt(int opt); -void SetTarget(const double *target,int nTarget=3); - - - int BegVolume(); - int EndVolume(); - int IsDca00(int begEnd); - int IsOverstep() const; - int TooMany(); - -void FillHelix(); -void Print (const Option_t* opt=0) const; -void Finish(const Option_t* opt=0); - - -protected: -char fFist[1]; -int fOpt; -int fKount; -int fExit; -int fLastKaze; -int fLastNumb; -int fHitted; -int fNTarget; -float fNearBeam; -float fStartSign; -float fCurrentSign; -float fTooManyLength; -double fTarget[3]; -char fMidl[1]; -THelixTrack *fHelix; -StvHlxDers *fDeriv; //Derivative matrix in THelixTrack notation -StvELossTrak *fELossTrak; //Energy loss calculator -StvMCField *fField; //Mag field calculator -const TGeoMaterial *fPrevMat; -TGeoVolume *fHALLVolu; -TGeoNode *fPrevNode; -char fLast[1]; -TString fCurrPath; //Path in current Dive() -TString fPrevPath; //Path in previous Dive() -private: - -ClassDef(StvMCStepping,0) // -}; - -class StvMCConstructGeometry : public GCall -{ - public: - StvMCConstructGeometry(const char *gy); - virtual ~StvMCConstructGeometry(){} - // methods - int Fun(); - private: - - protected: - // data members - - ClassDef(StvMCConstructGeometry,0) // -}; - - -class StvMCPrimaryGenerator : public GCall { - public: - StvMCPrimaryGenerator(); - ~StvMCPrimaryGenerator() {} - - void Set(const StvNodePars *pars,int idir) {mPars=pars; mDir =idir;} - virtual int Fun(); - protected: - const StvNodePars *mPars; - int mDir; // direction of moving 1=along track; 0=opposite - ClassDef(StvMCPrimaryGenerator,0) //StvMCPrimaryGenerator -}; - - -class StvMCField : public GCall { - public: - StvMCField(); - ~StvMCField() {} - virtual int FunDD(const double *x,double *b); - double GetHz(const double X[3]); - protected: - double mH[3],mX[3]; - StarMagField *mFild; // - - ClassDef(StvMCField,0) // -}; - -#endif diff --git a/StRoot/Stv/StvDraw.cxx b/StRoot/Stv/StvDraw.cxx deleted file mode 100644 index 24ff538a6ac..00000000000 --- a/StRoot/Stv/StvDraw.cxx +++ /dev/null @@ -1,311 +0,0 @@ -#include -#include "TSystem.h" -#include "TBrowser.h" -#include "TCernLib.h" -#include "TVector3.h" -#include "StvDraw.h" -#include "Stv/StvTrack.h" -#include "Stv/StvNode.h" -#include "Stv/StvHit.h" -#include "StvUtil/StvNodePars.h" -#include "Stv/StvStl.h" -#include "THelixTrack.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - -#include "Stv/StvToolkit.h" -static Color_t gMyColors[] = {kRed,kBlue,kMagenta,kCyan}; - -StvDraw *StvDraw::fgStvDraw=0; -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StvDraw::StvDraw(const char *name):StDraw3D(name) -{ - fgStvDraw = this; mNDoIt=0;mNPow2=1;mIColor=0; - SetBkColor(kWhite); -} -//_____________________________________________________________________________ -TObject *StvDraw::Hits(const std::vector &hits, EDraw3DStyle sty) -{ -if (!hits.size()) return 0; -const std::vector&vc = (std::vector&)hits; -return Hits(vc,sty); -} - - -//_____________________________________________________________________________ -TObject *StvDraw::Hits(const std::vector &hits, EDraw3DStyle sty) -{ - int n = hits.size(); if (!n) return 0; - std::vector vec(n*3); - const float *f;float *v=&vec[0]; - for (int i=0;ix();v[0]=f[0];v[1]=f[1];v[2]=f[2];v+=3; - } - vec.resize(v-&vec[0]); - TObject *to = Points(vec,sty); - DoIt(); -// ProcessEvents(); - return to; -} -//_____________________________________________________________________________ -TObject *StvDraw::Hits(const std::vector &hits, EDraw3DStyle sty) -{ - int n = hits.size(); if (!n) return 0; - std::vector vec(n*3); - const float *f;float *v=&vec[0]; - for (int i=0;i vec(nHits*3); - int n =0; - for (int i=0;i &hits, EDraw3DStyle sty) -{ -const std::vector&vc = (std::vector&)hits; -return Trak(helx,vc,sty); -} -//_____________________________________________________________________________ -void StvDraw::Road(const THelixTrack &helx,const std::vector &hits - , EDraw3DStyle sty, double wide) -{ - int n = hits.size(); - if (!n) return; - - TVector3 A(hits.front()->x()); - TVector3 B(hits.back ()->x()); - StvConstHits unHits; - Near((StvConstHits&)hits,unHits,wide); - Hits(unHits,kUnusedHit); - Trak(helx,hits,sty); -} -//_____________________________________________________________________________ -TObject *StvDraw::Trak(const THelixTrack &helx - ,const std::vector &hits - ,EDraw3DStyle sty) -{ - int n = hits.size(); if (n<=1) return 0; - Hits(hits ,kUsedHit); - if (helx.GetCos()<=0) {DoIt(); return 0;} - - const float *f = 0; - f = hits.front()->x(); - double fst[3]={f[0],f[1],f[2]}; - f = hits.back()->x(); - double lst[3]={f[0],f[1],f[2]}; - - std::vector myTrak; - THelixTrack th(helx); - - double l = th.Path(fst); th.Move(l); - l = th.Path(lst); - double dl = l/100; - for (int i=0;i<=100;i++) { - const double *x = th.Pos(); - for (int j=0;j<3;j++) {myTrak.push_back(x[j]);} th.Move(dl); - } - Hits(hits ,kUsedHit); - TObject *to = Line(myTrak,sty); - DoIt(); - return to; -} -//_____________________________________________________________________________ -TObject *StvDraw::Trak(const std::vector &pnts, EDraw3DStyle sty,Color_t color) -{ - int n = pnts.size(); if (!n) return 0; - StDraw3DStyle myStyle = Style(sty); - if (!color) { - myStyle.Col() = gMyColors[mIColor]; - mIColor = (mIColor+1)%(sizeof(gMyColors)/sizeof(gMyColors[0])); - } - return Line(pnts, myStyle.Col(),myStyle.Sty(),myStyle.Siz() ); -} -//_____________________________________________________________________________ -void StvDraw::Trak(const StvTrack *tk, int dir, EDraw3DStyle sty) -{ - StvConstHits myHits,ihHits; - StvPoints myPoits; - const StvNode *lNode=0,*rNode; - StvNodeConstIter itBeg,itEnd,it; - - if (dir) { //fit in ==> out - itBeg = tk->begin(); itEnd = tk->end(); - } else {//fit out ==> in - itBeg = tk->end(); --itBeg; itEnd = tk->begin();--itEnd; - } - -// StvNodeConstIter itBeg =(dir==0)? tk->rbegin():tk->begin(); -// StvNodeConstIter itEnd =(dir==0)? tk->rend() :tk->end(); - - for (it=itBeg; it!=itEnd; (dir)? ++it:--it) {//Main loop - rNode = *it; - if (rNode->mFE[dir].mHH<0) continue; //this node is not filled - if (fabs(rNode->mFP[dir]._cosCA)<=0) continue; //this node is not filled - - const StvHit *hit = rNode->GetHit(); - if (hit) { - if (rNode->GetXi2(dir)<1000) {myHits+=hit;} else {ihHits+=hit;}} - - if (!lNode) { myPoits+=rNode->GetFP(dir).P;} - else { Join(lNode,rNode,myPoits,dir);} - - const double *P = rNode->GetFP(dir).P; - if (hit) {// make connection to hit - const float *H = hit->x(); - float con[6] = {(float)H[0],(float)H[1],(float)H[2],(float)P[0],(float)P[1],(float)P[2]}; - Line (2,con); - } - {// only short line to mark node - const double *D = &rNode->GetFP(dir)._cosCA; - float con[6] = {(float)P[0] ,(float)P[1] ,(float)P[2] - ,float(P[0]-D[1]*0.1),float(P[1]+D[0]*0.1),(float)P[2]}; - Line (2,con); - } - lNode = rNode; - } - Hits(myHits,kUsedHit); - Hits(ihHits,kUnusedHit); - Trak(myPoits,sty,0); - -} -//_____________________________________________________________________________ -void StvDraw::Zhow(const StvTrack *tk){Inst()->Road(tk,10); Wait();} -//_____________________________________________________________________________ -void StvDraw::Road(const StvTrack *tk, double wide, EDraw3DStyle sty) -{ - Trak(tk, sty); - StvConstHits unHits; - Near(tk,unHits,wide); - if (!unHits.size()) return; - Hits(unHits,kUnusedHit); -} -//_____________________________________________________________________________ -void StvDraw::Near(const StvConstHits &inHits,StvConstHits &unHits,double wide) -{ - THelixFitter hf; - int nh = inHits.size(); - for (int ih = 0;ihx(); hf.Add(f[0],f[1],f[2]); - } - hf.Fit(); - THelixTrack th(hf); - - StVoidArr *vHits = StTGeoProxy::Inst()->GetAllHits(); - int nHits = vHits->size(); - unHits.resize(0); - for (int ih=0;ihx());; - double d[3] = {Hit[0],Hit[1],Hit[2]}; - double s = th.Path(d); th.Move(s); - double dis2 = (Hit - TVector3(th.Pos())).Mag2(); - if (dis2 > wide*wide) continue; - unHits.push_back(hit); - } //End hit loop -} -//_____________________________________________________________________________ -void StvDraw::Near(const StvTrack *tk,StvConstHits &unHits,double wide) -{ - StvConstHits inHits; - for (StvNodeConstIter it=tk->begin(); it!=tk->end(); ++it) { - const StvNode *node = *it; - const StvHit *hit = node->GetHit(); - if (!hit) continue; - inHits.push_back(hit); - } - Near(inHits,unHits,wide); -} - -//_____________________________________________________________________________ -void StvDraw::Join(const StvNode *left,const StvNode *rite,StvPoints &poits,int dir) -{ -static const double maxStep=0.1; - const StvNodePars &lFP = left->GetFP(dir); - const StvNodePars &rFP = rite->GetFP(dir); - THelixTrack hLeft; - lFP.get(&hLeft); - double lenL = hLeft.Path(rFP.P); - - int nStep = fabs(lenL)/maxStep; if (nStep <3) nStep = 3; - double step = lenL/nStep; - for (int is=0;is<=nStep;is++) { - poits +=hLeft.Pos(); - hLeft.Move(step); - } -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -void StvDraw::Show(const StvTrack *tk,int dir){Inst()->Trak(tk,dir); Wait();} -//_____________________________________________________________________________ -void StvDraw::Klear(){Inst()->Clear();} -//_____________________________________________________________________________ -void StvDraw::DoIt() -{ - mNDoIt++; if (mNDoIt<=mNPow2) return; - mNPow2<<=1; - UpdateModified(); ProcessEvents(); -} -//_____________________________________________________________________________ -void StvDraw::Clear(const char *) -{ - mNDoIt=0; mNPow2=1; - StDraw3D::Clear(); -} -//_____________________________________________________________________________ -int StvDraw::ProcessEvents() -{ - int ans = gSystem->ProcessEvents(); - return ans; -} -//_____________________________________________________________________________ -void StvDraw::Wait() -{ - if (Jnst()) Jnst()->UpdateModified(); - fprintf(stderr,"StvDraw::Waiting...\n"); - while(!ProcessEvents()){gSystem->Sleep(200);}; -} -//_____________________________________________________________________________ -void StvDraw::KBrowse(const TObject *to) -{ - new TBrowser("StvDraw",(TObject*)to); -} -//_____________________________________________________________________________ -void StvDraw::All(const char *opt) -{ - if (!opt || !*opt) opt = "THh"; - - if (strstr(opt,"T")) { - StvTracks &tks = StvToolkit::Inst()->GetTracks(); - int nTk = 0; - for (StvTrackConstIter it=tks.begin(); it!=tks.end(); ++it) { - const StvTrack *tk = *it; - nTk++; - Trak(tk); - } } - - if (strstr(opt,"h")) { - StVoidArr *vHits = StTGeoProxy::Inst()->GetAllHits(); - std::vector sHits; - for (int ihit=0;ihit<(int)vHits->size();ihit++) { - const StvHit *stvHit = (StvHit*)(*vHits)[ihit]; - if (stvHit->isUsed()) continue; - sHits.push_back(stvHit); - } - Hits(sHits,kUnusedHit); - } -} - diff --git a/StRoot/Stv/StvDraw.h b/StRoot/Stv/StvDraw.h deleted file mode 100644 index 2c3ad4d8ec4..00000000000 --- a/StRoot/Stv/StvDraw.h +++ /dev/null @@ -1,63 +0,0 @@ - -#ifndef StvDraw_HH -#define StvDraw_HH -#include "StDraw3D.h" - -class StvHit; -class StvHits; -class StvConstHits; -class StvNode; -class StvTrack; -class THelixTrack; -class StvPoints; -class TVector3; -class StvDraw : public StDraw3D -{ -public: - - ///Default constructor. - StvDraw(const char *opt="TIFC,TPCFEE,TPCM"); - ~StvDraw(){;} - void Clear(const char *opt=""); -TObject *Hits(const std::vector< StvHit*> &hits, EDraw3DStyle sty=kUsedHit); -TObject *Hits(const std::vector &hits, EDraw3DStyle sty=kUsedHit); -TObject *Hits(const StvHits &hits, EDraw3DStyle sty=kUsedHit); -TObject *Hits(const std::vector &hits, EDraw3DStyle sty=kUsedHit); -TObject *Hits(int nHits, const TVector3 *hits, EDraw3DStyle sty=kUsedHit); - -TObject *Trak(const THelixTrack &helx,const std::vector &hits, EDraw3DStyle sty=kGlobalTrack); -TObject *Trak(const THelixTrack &helx,const std::vector< StvHit*> &hits, EDraw3DStyle sty=kGlobalTrack); - void Road(const THelixTrack &helx,const std::vector &hits, EDraw3DStyle sty=kGlobalTrack,double wide=10); -TObject *Trak(const std::vector &pnts, EDraw3DStyle sty=kGlobalTrack,Color_t col=kRed); - void Trak(const StvTrack *tk, int dir = 2, EDraw3DStyle sty=kGlobalTrack); - - void Road(const StvTrack *tk, double wide=5,EDraw3DStyle sty=kGlobalTrack); - void All(const char *opt); - - void DoIt(); - void Near(const StvConstHits &inhits,StvConstHits &unhits, double wide=10); - void Near(const StvTrack *tk,StvConstHits &unhits, double wide=10); - - -static int ProcessEvents(); -static StvDraw *Inst() {if (!fgStvDraw) fgStvDraw=new StvDraw(); return fgStvDraw;} -static StvDraw *Jnst() {return fgStvDraw;} -static void Wait(); -static void Show(const StvTrack *tk, int dir=0); -static void Zhow(const StvTrack *tk); -static void Klear(); -static void KBrowse(const TObject *to); -private: - void Join(const StvNode *left,const StvNode *rite,StvPoints &poits,int dir=2); -private: -int mNDoIt; -int mNPow2; -int mIColor; //Current color index when it is changing in cycle -static StvDraw *fgStvDraw; - -}; - -inline TObject *StvDraw::Hits( const StvHits &hits, EDraw3DStyle sty) - { return Hits((const std::vector&)hits,sty);} - -#endif diff --git a/StRoot/Stv/StvEnum.h b/StRoot/Stv/StvEnum.h deleted file mode 100644 index cf10bdd4bc6..00000000000 --- a/StRoot/Stv/StvEnum.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __StvEnum_h_ -#define __StvEnum_h_ -///Permanent constants only -enum StvEnum { kKalmanErrFact=9, kBigMom=3, kBigMom2=kBigMom*kBigMom}; - -#endif //__StvEnum_h_ - - diff --git a/StRoot/Stv/StvFitter.cxx b/StRoot/Stv/StvFitter.cxx deleted file mode 100644 index d8d47b354b2..00000000000 --- a/StRoot/Stv/StvFitter.cxx +++ /dev/null @@ -1,899 +0,0 @@ -#include -#include -#include -#include "TMath.h" -#include "TMatrixD.h" -#include "TVectorD.h" -#include "TCernLib.h" -#include "StvFitter.h" -#include "StvUtil/StvNodePars.h" -#include "StvHit.h" -#include "StvUtil/StvDebug.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - -StvFitter *StvFitter::mgFitter=0; -#define VDOT(a,b) ( a[0]*b[0]+a[1]*b[1]+a[2]*b[2]) -#define DIST(a,b) ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2])) -#define DDOT(a,b,c) ((a[0]-b[0])*c[0]+(a[1]-b[1])*c[1]+(a[2]-b[2])*c[2]) -#define VADD(a,b) { a[0]+=b[0];a[1]+=b[1];a[2]+=b[2];} - -enum {kDeltaFactor = 21,kTooBigErrFactor = 100*100}; - -static const double kXtraBigXi2 = 9e9; - -static inline double MyXi2(const double G[3],double dA,double dB) -{ - double Gdet = G[0]*G[2]-G[1]*G[1]; - if (Gdet < 1e-11) return kXtraBigXi2; - double Xi2 = (G[2]*dA*dA-2*G[1]*dA*dB+G[0]*dB*dB)/Gdet; - if (Xi2 > kXtraBigXi2) Xi2 = kXtraBigXi2; - return Xi2; -} - -class TCLx -{ -public: -static int trsinv2x2(const double *pM,double *pMi); -static int trsinv3x3(const double *pM,double *pMi); -static int trsinv4x4(const double *pM,double *pMi); -static int trsinv5x5(const double *pM,double *pMi); -static void Test(); -}; - -#include -#include - -//______________________________________________________________________________ -int TCLx::trsinv2x2(const double *pM,double *pMi) -{ - double F[3]={pM[0],0,pM[2]}; - if (F[0]<1e-20) F[0]=1e-20;if (F[2]>1e+20) F[2]=1e+20; - F[0] =1./F[0]; F[2] =1./F[2]; - F[1] = sqrt(F[0]*F[2]); - for (int i=0;i<3;i++) {pMi[i] = pM[i]*F[i];} - - const double det = pMi[0] * pMi[2] - pMi[1] * pMi[1]; - - if (det<=3e-33) return 1; - const double s = 1./det; - - const double tmp = s*pMi[2]; - pMi[1] = -pMi[1]*s; - pMi[2] = s*pMi[0]; - pMi[0] = tmp; - for (int i=0;i<3;i++) {pMi[i] = pMi[i]*F[i];} - return 0; -} -//______________________________________________________________________________ -int TCLx::trsinv3x3(const double *pM,double *pMi) -{ -// 0 -// 1 2 -// 3 4 5 -// -// 0 1 2 -// 3 4 5 -// 6 7 8 -// -// 2=>3 -// 3=>1 -// 4=>2 -// 5=>4 -// 6=>3 -// 7=>4 -// 8=>5 - - const double c00 = pM[2] * pM[5] - pM[4] * pM[4]; - const double c10 = pM[4] * pM[3] - pM[1] * pM[5]; - const double c20 = pM[1] * pM[4] - pM[2] * pM[3]; - const double c11 = pM[5] * pM[0] - pM[3] * pM[3]; - const double c21 = pM[3] * pM[1] - pM[4] * pM[0]; - const double c22 = pM[0] * pM[2] - pM[1] * pM[1]; - - const double t0 = fabs(pM[0]); - const double t1 = fabs(pM[1]); - const double t2 = fabs(pM[3]); - double det; - double tmp; - if (t0 >= t1) { - if (t2 >= t0) { - tmp = pM[3]; - det = c21*c10-c11*c20; - } else { - tmp = pM[0]; - det = c11*c22-c21*c21; - } - } else if (t2 >= t1) { - tmp = pM[3]; - det = c21*c10-c11*c20; - } else { - tmp = pM[1]; - det = c20*c21-c10*c22; - } - - if (det<=0) return -1; - if (det<=3e-33) return 1; - - const double s = tmp/det; - - pMi[0] = s*c00; - pMi[1] = s*c10; - pMi[2] = s*c11; - pMi[3] = s*c20; - pMi[4] = s*c21; - pMi[5] = s*c22; - return 0; -} -//______________________________________________________________________________ -// GFij are indices for a 4x4 matrix. - -// 0 -// 1 2 -// 3 4 5 -// 6 7 8 9 -#define GF00 0 - -#define GF10 1 -#define GF11 2 - -#define GF20 3 -#define GF21 4 -#define GF22 5 - -#define GF30 6 -#define GF31 7 -#define GF32 8 -#define GF33 9 - -//______________________________________________________________________________ -int TCLx::trsinv4x4(const double *pM,double *pMi) -{ - // Find all NECESSARY 2x2 dets: (18 of them) - - const Double_t det2_12_01 = pM[GF10]*pM[GF21] - pM[GF11]*pM[GF20]; - const Double_t det2_12_02 = pM[GF10]*pM[GF22] - pM[GF21]*pM[GF20]; - const Double_t det2_12_03 = pM[GF10]*pM[GF32] - pM[GF31]*pM[GF20]; - const Double_t det2_12_13 = pM[GF11]*pM[GF32] - pM[GF31]*pM[GF21]; - const Double_t det2_12_23 = pM[GF21]*pM[GF32] - pM[GF31]*pM[GF22]; - const Double_t det2_12_12 = pM[GF11]*pM[GF22] - pM[GF21]*pM[GF21]; - const Double_t det2_13_01 = pM[GF10]*pM[GF31] - pM[GF11]*pM[GF30]; - const Double_t det2_13_02 = pM[GF10]*pM[GF32] - pM[GF21]*pM[GF30]; - const Double_t det2_13_03 = pM[GF10]*pM[GF33] - pM[GF31]*pM[GF30]; - const Double_t det2_13_12 = pM[GF11]*pM[GF32] - pM[GF21]*pM[GF31]; - const Double_t det2_13_13 = pM[GF11]*pM[GF33] - pM[GF31]*pM[GF31]; - const Double_t det2_13_23 = pM[GF21]*pM[GF33] - pM[GF31]*pM[GF32]; - const Double_t det2_23_01 = pM[GF20]*pM[GF31] - pM[GF21]*pM[GF30]; - const Double_t det2_23_02 = pM[GF20]*pM[GF32] - pM[GF22]*pM[GF30]; - const Double_t det2_23_03 = pM[GF20]*pM[GF33] - pM[GF32]*pM[GF30]; - const Double_t det2_23_12 = pM[GF21]*pM[GF32] - pM[GF22]*pM[GF31]; - const Double_t det2_23_13 = pM[GF21]*pM[GF33] - pM[GF32]*pM[GF31]; - const Double_t det2_23_23 = pM[GF22]*pM[GF33] - pM[GF32]*pM[GF32]; - - // Find all NECESSARY 3x3 dets: (16 of them) - - const Double_t det3_012_012 = pM[GF00]*det2_12_12 - pM[GF10]*det2_12_02 - + pM[GF20]*det2_12_01; - const Double_t det3_012_013 = pM[GF00]*det2_12_13 - pM[GF10]*det2_12_03 - + pM[GF30]*det2_12_01; - const Double_t det3_012_023 = pM[GF00]*det2_12_23 - pM[GF20]*det2_12_03 - + pM[GF30]*det2_12_02; - const Double_t det3_012_123 = pM[GF10]*det2_12_23 - pM[GF20]*det2_12_13 - + pM[GF30]*det2_12_12; - const Double_t det3_013_013 = pM[GF00]*det2_13_13 - pM[GF10]*det2_13_03 - + pM[GF30]*det2_13_01; - const Double_t det3_013_023 = pM[GF00]*det2_13_23 - pM[GF20]*det2_13_03 - + pM[GF30]*det2_13_02; - const Double_t det3_013_123 = pM[GF10]*det2_13_23 - pM[GF20]*det2_13_13 - + pM[GF30]*det2_13_12; - const Double_t det3_023_023 = pM[GF00]*det2_23_23 - pM[GF20]*det2_23_03 - + pM[GF30]*det2_23_02; - const Double_t det3_023_123 = pM[GF10]*det2_23_23 - pM[GF20]*det2_23_13 - + pM[GF30]*det2_23_12; - const Double_t det3_123_012 = pM[GF10]*det2_23_12 - pM[GF11]*det2_23_02 - + pM[GF21]*det2_23_01; - const Double_t det3_123_013 = pM[GF10]*det2_23_13 - pM[GF11]*det2_23_03 - + pM[GF31]*det2_23_01; - const Double_t det3_123_023 = pM[GF10]*det2_23_23 - pM[GF21]*det2_23_03 - + pM[GF31]*det2_23_02; - const Double_t det3_123_123 = pM[GF11]*det2_23_23 - pM[GF21]*det2_23_13 - + pM[GF31]*det2_23_12; - - // Find the 4x4 det: - - const Double_t det = pM[GF00]*det3_123_123 - pM[GF10]*det3_123_023 - + pM[GF20]*det3_123_013 - pM[GF30]*det3_123_012; - - if (det<=3e-33) return 1; - - const Double_t oneOverDet = 1.0/det; - const Double_t mn1OverDet = - oneOverDet; - - pMi[GF00] = det3_123_123 * oneOverDet; - pMi[GF10] = det3_023_123 * mn1OverDet; - pMi[GF20] = det3_013_123 * oneOverDet; - pMi[GF30] = det3_012_123 * mn1OverDet; - - pMi[GF11] = det3_023_023 * oneOverDet; - pMi[GF21] = det3_013_023 * mn1OverDet; - pMi[GF31] = det3_012_023 * oneOverDet; - - pMi[GF22] = det3_013_013 * oneOverDet; - pMi[GF32] = det3_012_013 * mn1OverDet; - - pMi[GF33] = det3_012_012 * oneOverDet; - return 0; - -} -// GMij are indices for a 5x5 matrix. - -// 0 -// 1 2 -// 3 4 5 -// 6 7 8 9 -// 10 11 12 13 14 -#define GM00 0 - -#define GM10 1 -#define GM11 2 - -#define GM20 3 -#define GM21 4 -#define GM22 5 - -#define GM30 6 -#define GM31 7 -#define GM32 8 -#define GM33 9 - -#define GM40 10 -#define GM41 11 -#define GM42 12 -#define GM43 13 -#define GM44 14 - -//______________________________________________________________________________ -int TCLx::trsinv5x5(const double *pMp,double *pMi) -{ - double F[5],pM[15]; - for (int i=0,li=0;i< 5;li+=++i) { - F[i] = sqrt(pMp[li+i]); - if (F[i]<1e-10) F[i]=1e-10; - if (F[i]>1e+10) F[i]=1e+10; - } - - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++) { - pM[li+j] = pMp[li+j]/F[i]/F[j]; - } } - // Find all NECESSARY 2x2 dets: (30 of them) - - const Double_t det2_23_01 = pM[GM20]*pM[GM31] - pM[GM21]*pM[GM30]; - const Double_t det2_23_02 = pM[GM20]*pM[GM32] - pM[GM22]*pM[GM30]; - const Double_t det2_23_03 = pM[GM20]*pM[GM33] - pM[GM32]*pM[GM30]; - const Double_t det2_23_04 = pM[GM20]*pM[GM43] - pM[GM42]*pM[GM30]; - const Double_t det2_23_12 = pM[GM21]*pM[GM32] - pM[GM22]*pM[GM31]; - const Double_t det2_23_13 = pM[GM21]*pM[GM33] - pM[GM32]*pM[GM31]; - const Double_t det2_23_14 = pM[GM21]*pM[GM43] - pM[GM42]*pM[GM31]; - const Double_t det2_23_23 = pM[GM22]*pM[GM33] - pM[GM32]*pM[GM32]; - const Double_t det2_23_24 = pM[GM22]*pM[GM43] - pM[GM42]*pM[GM32]; - const Double_t det2_23_34 = pM[GM32]*pM[GM43] - pM[GM42]*pM[GM33]; - const Double_t det2_24_01 = pM[GM20]*pM[GM41] - pM[GM21]*pM[GM40]; - const Double_t det2_24_02 = pM[GM20]*pM[GM42] - pM[GM22]*pM[GM40]; - const Double_t det2_24_03 = pM[GM20]*pM[GM43] - pM[GM32]*pM[GM40]; - const Double_t det2_24_04 = pM[GM20]*pM[GM44] - pM[GM42]*pM[GM40]; - const Double_t det2_24_12 = pM[GM21]*pM[GM42] - pM[GM22]*pM[GM41]; - const Double_t det2_24_13 = pM[GM21]*pM[GM43] - pM[GM32]*pM[GM41]; - const Double_t det2_24_14 = pM[GM21]*pM[GM44] - pM[GM42]*pM[GM41]; - const Double_t det2_24_23 = det2_23_24; - const Double_t det2_24_24 = pM[GM22]*pM[GM44] - pM[GM42]*pM[GM42]; - const Double_t det2_24_34 = pM[GM32]*pM[GM44] - pM[GM42]*pM[GM43]; - const Double_t det2_34_01 = pM[GM30]*pM[GM41] - pM[GM31]*pM[GM40]; - const Double_t det2_34_02 = pM[GM30]*pM[GM42] - pM[GM32]*pM[GM40]; - const Double_t det2_34_03 = pM[GM30]*pM[GM43] - pM[GM33]*pM[GM40]; - const Double_t det2_34_04 = pM[GM30]*pM[GM44] - pM[GM43]*pM[GM40]; - const Double_t det2_34_12 = pM[GM31]*pM[GM42] - pM[GM32]*pM[GM41]; - const Double_t det2_34_13 = pM[GM31]*pM[GM43] - pM[GM33]*pM[GM41]; - const Double_t det2_34_14 = pM[GM31]*pM[GM44] - pM[GM43]*pM[GM41]; - const Double_t det2_34_23 = det2_23_34; - - const Double_t det2_34_24 = pM[GM32]*pM[GM44] - pM[GM43]*pM[GM42]; - const Double_t det2_34_34 = pM[GM33]*pM[GM44] - pM[GM43]*pM[GM43]; - - // Find all NECESSARY 3x3 dets: (40 of them) - - const Double_t det3_123_012 = pM[GM10]*det2_23_12 - pM[GM11]*det2_23_02 + pM[GM21]*det2_23_01; - const Double_t det3_123_013 = pM[GM10]*det2_23_13 - pM[GM11]*det2_23_03 + pM[GM31]*det2_23_01; - const Double_t det3_123_014 = pM[GM10]*det2_23_14 - pM[GM11]*det2_23_04 + pM[GM41]*det2_23_01; - const Double_t det3_123_023 = pM[GM10]*det2_23_23 - pM[GM21]*det2_23_03 + pM[GM31]*det2_23_02; - const Double_t det3_123_024 = pM[GM10]*det2_23_24 - pM[GM21]*det2_23_04 + pM[GM41]*det2_23_02; - const Double_t det3_123_034 = pM[GM10]*det2_23_34 - pM[GM31]*det2_23_04 + pM[GM41]*det2_23_03; - const Double_t det3_123_123 = pM[GM11]*det2_23_23 - pM[GM21]*det2_23_13 + pM[GM31]*det2_23_12; - const Double_t det3_123_124 = pM[GM11]*det2_23_24 - pM[GM21]*det2_23_14 + pM[GM41]*det2_23_12; - const Double_t det3_123_134 = pM[GM11]*det2_23_34 - pM[GM31]*det2_23_14 + pM[GM41]*det2_23_13; - const Double_t det3_123_234 = pM[GM21]*det2_23_34 - pM[GM31]*det2_23_24 + pM[GM41]*det2_23_23; - const Double_t det3_124_012 = pM[GM10]*det2_24_12 - pM[GM11]*det2_24_02 + pM[GM21]*det2_24_01; - const Double_t det3_124_013 = pM[GM10]*det2_24_13 - pM[GM11]*det2_24_03 + pM[GM31]*det2_24_01; - const Double_t det3_124_014 = pM[GM10]*det2_24_14 - pM[GM11]*det2_24_04 + pM[GM41]*det2_24_01; - const Double_t det3_124_023 = pM[GM10]*det2_24_23 - pM[GM21]*det2_24_03 + pM[GM31]*det2_24_02; - const Double_t det3_124_024 = pM[GM10]*det2_24_24 - pM[GM21]*det2_24_04 + pM[GM41]*det2_24_02; - const Double_t det3_124_034 = pM[GM10]*det2_24_34 - pM[GM31]*det2_24_04 + pM[GM41]*det2_24_03; - const Double_t det3_124_123 = pM[GM11]*det2_24_23 - pM[GM21]*det2_24_13 + pM[GM31]*det2_24_12; - const Double_t det3_124_124 = pM[GM11]*det2_24_24 - pM[GM21]*det2_24_14 + pM[GM41]*det2_24_12; - const Double_t det3_124_134 = pM[GM11]*det2_24_34 - pM[GM31]*det2_24_14 + pM[GM41]*det2_24_13; - const Double_t det3_124_234 = pM[GM21]*det2_24_34 - pM[GM31]*det2_24_24 + pM[GM41]*det2_24_23; - const Double_t det3_134_013 = pM[GM10]*det2_34_13 - pM[GM11]*det2_34_03 + pM[GM31]*det2_34_01; - const Double_t det3_134_014 = pM[GM10]*det2_34_14 - pM[GM11]*det2_34_04 + pM[GM41]*det2_34_01; - const Double_t det3_134_023 = pM[GM10]*det2_34_23 - pM[GM21]*det2_34_03 + pM[GM31]*det2_34_02; - const Double_t det3_134_024 = pM[GM10]*det2_34_24 - pM[GM21]*det2_34_04 + pM[GM41]*det2_34_02; - const Double_t det3_134_034 = pM[GM10]*det2_34_34 - pM[GM31]*det2_34_04 + pM[GM41]*det2_34_03; - const Double_t det3_134_123 = pM[GM11]*det2_34_23 - pM[GM21]*det2_34_13 + pM[GM31]*det2_34_12; - const Double_t det3_134_124 = pM[GM11]*det2_34_24 - pM[GM21]*det2_34_14 + pM[GM41]*det2_34_12; - const Double_t det3_134_134 = pM[GM11]*det2_34_34 - pM[GM31]*det2_34_14 + pM[GM41]*det2_34_13; - const Double_t det3_134_234 = pM[GM21]*det2_34_34 - pM[GM31]*det2_34_24 + pM[GM41]*det2_34_23; - const Double_t det3_234_012 = pM[GM20]*det2_34_12 - pM[GM21]*det2_34_02 + pM[GM22]*det2_34_01; - const Double_t det3_234_013 = pM[GM20]*det2_34_13 - pM[GM21]*det2_34_03 + pM[GM32]*det2_34_01; - const Double_t det3_234_014 = pM[GM20]*det2_34_14 - pM[GM21]*det2_34_04 + pM[GM42]*det2_34_01; - const Double_t det3_234_023 = pM[GM20]*det2_34_23 - pM[GM22]*det2_34_03 + pM[GM32]*det2_34_02; - const Double_t det3_234_024 = pM[GM20]*det2_34_24 - pM[GM22]*det2_34_04 + pM[GM42]*det2_34_02; - const Double_t det3_234_034 = pM[GM20]*det2_34_34 - pM[GM32]*det2_34_04 + pM[GM42]*det2_34_03; - const Double_t det3_234_123 = pM[GM21]*det2_34_23 - pM[GM22]*det2_34_13 + pM[GM32]*det2_34_12; - const Double_t det3_234_124 = pM[GM21]*det2_34_24 - pM[GM22]*det2_34_14 + pM[GM42]*det2_34_12; - const Double_t det3_234_134 = pM[GM21]*det2_34_34 - pM[GM32]*det2_34_14 + pM[GM42]*det2_34_13; - const Double_t det3_234_234 = pM[GM22]*det2_34_34 - pM[GM32]*det2_34_24 + pM[GM42]*det2_34_23; - - // Find all NECESSARY 4x4 dets: (25 of them) - - const Double_t det4_0123_0123 = pM[GM00]*det3_123_123 - pM[GM10]*det3_123_023 - + pM[GM20]*det3_123_013 - pM[GM30]*det3_123_012; - const Double_t det4_0123_0124 = pM[GM00]*det3_123_124 - pM[GM10]*det3_123_024 - + pM[GM20]*det3_123_014 - pM[GM40]*det3_123_012; - const Double_t det4_0123_0134 = pM[GM00]*det3_123_134 - pM[GM10]*det3_123_034 - + pM[GM30]*det3_123_014 - pM[GM40]*det3_123_013; - const Double_t det4_0123_0234 = pM[GM00]*det3_123_234 - pM[GM20]*det3_123_034 - + pM[GM30]*det3_123_024 - pM[GM40]*det3_123_023; - const Double_t det4_0123_1234 = pM[GM10]*det3_123_234 - pM[GM20]*det3_123_134 - + pM[GM30]*det3_123_124 - pM[GM40]*det3_123_123; - const Double_t det4_0124_0124 = pM[GM00]*det3_124_124 - pM[GM10]*det3_124_024 - + pM[GM20]*det3_124_014 - pM[GM40]*det3_124_012; - const Double_t det4_0124_0134 = pM[GM00]*det3_124_134 - pM[GM10]*det3_124_034 - + pM[GM30]*det3_124_014 - pM[GM40]*det3_124_013; - const Double_t det4_0124_0234 = pM[GM00]*det3_124_234 - pM[GM20]*det3_124_034 - + pM[GM30]*det3_124_024 - pM[GM40]*det3_124_023; - const Double_t det4_0124_1234 = pM[GM10]*det3_124_234 - pM[GM20]*det3_124_134 - + pM[GM30]*det3_124_124 - pM[GM40]*det3_124_123; - const Double_t det4_0134_0134 = pM[GM00]*det3_134_134 - pM[GM10]*det3_134_034 - + pM[GM30]*det3_134_014 - pM[GM40]*det3_134_013; - const Double_t det4_0134_0234 = pM[GM00]*det3_134_234 - pM[GM20]*det3_134_034 - + pM[GM30]*det3_134_024 - pM[GM40]*det3_134_023; - const Double_t det4_0134_1234 = pM[GM10]*det3_134_234 - pM[GM20]*det3_134_134 - + pM[GM30]*det3_134_124 - pM[GM40]*det3_134_123; - const Double_t det4_0234_0234 = pM[GM00]*det3_234_234 - pM[GM20]*det3_234_034 - + pM[GM30]*det3_234_024 - pM[GM40]*det3_234_023; - const Double_t det4_0234_1234 = pM[GM10]*det3_234_234 - pM[GM20]*det3_234_134 - + pM[GM30]*det3_234_124 - pM[GM40]*det3_234_123; - const Double_t det4_1234_0123 = pM[GM10]*det3_234_123 - pM[GM11]*det3_234_023 - + pM[GM21]*det3_234_013 - pM[GM31]*det3_234_012; - const Double_t det4_1234_0124 = pM[GM10]*det3_234_124 - pM[GM11]*det3_234_024 - + pM[GM21]*det3_234_014 - pM[GM41]*det3_234_012; - const Double_t det4_1234_0134 = pM[GM10]*det3_234_134 - pM[GM11]*det3_234_034 - + pM[GM31]*det3_234_014 - pM[GM41]*det3_234_013; - const Double_t det4_1234_0234 = pM[GM10]*det3_234_234 - pM[GM21]*det3_234_034 - + pM[GM31]*det3_234_024 - pM[GM41]*det3_234_023; - const Double_t det4_1234_1234 = pM[GM11]*det3_234_234 - pM[GM21]*det3_234_134 - + pM[GM31]*det3_234_124 - pM[GM41]*det3_234_123; - - // Find the 5x5 det: - - const Double_t det = pM[GM00]*det4_1234_1234 - pM[GM10]*det4_1234_0234 + pM[GM20]*det4_1234_0134 - - pM[GM30]*det4_1234_0124 + pM[GM40]*det4_1234_0123; - - if (det<= 0) return -1; - if (det<=3e-33) return 1; - - const Double_t oneOverDet = 1.0/det; - const Double_t mn1OverDet = - oneOverDet; - - pMi[GM00] = det4_1234_1234 * oneOverDet; - pMi[GM10] = det4_0234_1234 * mn1OverDet; - pMi[GM20] = det4_0134_1234 * oneOverDet; - pMi[GM30] = det4_0124_1234 * mn1OverDet; - pMi[GM40] = det4_0123_1234 * oneOverDet; - - pMi[GM11] = det4_0234_0234 * oneOverDet; - pMi[GM21] = det4_0134_0234 * mn1OverDet; - pMi[GM31] = det4_0124_0234 * oneOverDet; - pMi[GM41] = det4_0123_0234 * mn1OverDet; - - pMi[GM22] = det4_0134_0134 * oneOverDet; - pMi[GM32] = det4_0124_0134 * mn1OverDet; - pMi[GM42] = det4_0123_0134 * oneOverDet; - - pMi[GM33] = det4_0124_0124 * oneOverDet; - pMi[GM43] = det4_0123_0124 * mn1OverDet; - - pMi[GM44] = det4_0123_0123 * oneOverDet; - - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++) { - pMi[li+j] = pMi[li+j]/F[i]/F[j]; - } } - return 0; -} -#include "TCernLib.h" -#include "TRandom.h" - -//______________________________________________________________________________ -void TCLx::Test() -{ - int nErr = 0; - double e[15],e1inv[15],e2inv[15]; - for (int i=0,li=0;i< 5;li+=++i) { - e[li+i] = gRandom->Rndm()*10+10; - for (int j=0;jRndm(); - } } - - for (int N=2;N<=5;N++) { - TCL::trsinv(e,e1inv,N); - switch (N) { - case 2:TCLx::trsinv2x2(e,e2inv); break; - case 3:TCLx::trsinv3x3(e,e2inv); break; - case 4:TCLx::trsinv4x4(e,e2inv); break; - case 5:TCLx::trsinv5x5(e,e2inv); break; - default: assert(0); - } - int l = (N*N+N)/2; - for (int i=0;i ard(nE2+nP2*2+1); - double *a = &ard[0]; - double *P1sP2 = a; a+=nP2; //=P1-P2 - double *Ptmp = a; a+=nP2; //=tmp vector - double *E1aE2i = a; a+=nE2; //=(E1+E2)**(-1) - *a = 1946; - - if (P2) { TCL::vsub (P1,P2,P1sP2,nP1);} - else { TCL::ucopy(P1, P1sP2,nP1);} - TCL::vadd (E1,E2,E1aE2i,nE1); - if (nP1delta(); mDelta *= kDeltaFactor; - -} -//______________________________________________________________________________ -void StvFitter::Prep() -{ - mDelta = mInPars->delta(); mDelta *= kDeltaFactor; - mHit = 0; mHitPlane = 0; - double myTan = mInPars->_tanl; - mCos2L = 1./(1+myTan*myTan); - mCosL = sqrt(mCos2L); - mSinL = myTan*mCosL; - mCosP = mInPars->_cosCA; - mSinP = mInPars->_sinCA; - - mTkPars = *mInPars; -// Track Frame - mDcaFrame[0][0] = mCosL*mCosP; - mDcaFrame[0][1] = mCosL*mSinP; - mDcaFrame[0][2] = mSinL; - - mDcaFrame[1][0] = -mSinP; - mDcaFrame[1][1] = mCosP; - mDcaFrame[1][2] = 0; - - mDcaFrame[2][0] = -mSinL*mCosP; - mDcaFrame[2][1] = -mSinL*mSinP; - mDcaFrame[2][2] = mCosL; - -} -//______________________________________________________________________________ -double StvFitter::Xi2(const StvHit *hit) -{ - if (mHit == hit) return mXi2; - mFailed = 0; - mHit = hit; - const float *errMtx=mHit->errMtx(); - if (!mHit->IsHit()) mKase=2; //Hit is a vertex - - mHitPlane = mHit->detector(); - -// restore old parameters for nhits>1 - mTkPars._x = mInPars->_x; mTkPars._y = mInPars->_y; mTkPars._z = mInPars->_z; - -// Hit position - const float *hP = mHit->x(); - -// Track direction - double *tD = mDcaFrame[0]; -// Start track position - double *tP = &mTkPars._x; - - -// Distance to DCA along track in xy -//mDeltaL = DDOT(hP,tP,tD); -// DCA track position - switch (mKase) { - case 0: { - mHitErrCalc = (StvHitErrCalculator*)mHitPlane->GetHitErrCalc(); - assert(mHitErrCalc); - mHitErrCalc->SetTrack(tD); -// const StHitPlane *hp = hit->detector(); -// const Mtx33F_t &hD = hp->GetDir(hit->x()); -// int ans = mHitErrCalc->CalcDcaErrs(hit->x(),hD,mHitErrs); - int ans = mHitErrCalc->CalcDcaErrs(hit,mHitErrs); - if (ans) {mXi2 = 1e11; return mXi2;} - assert(mHitErrs[0]>=1e-8); - assert(mHitErrs[1]*mHitErrs[1]<=mHitErrs[0]*mHitErrs[2]); - assert(mHitErrs[2]>=1e-8); - }; break; - - case 1: assert(0 && "Wrong case 1"); - - case 2: { - double d[6]={errMtx[0],errMtx[1],errMtx[2] - ,errMtx[3],errMtx[4],errMtx[5]}; - TCL::trasat(mDcaFrame[1],d,mHitErrs,2,3); } - } - assert(mHitErrs[0]>0); - assert(mHitErrs[2]>0); - assert(mHitErrs[2]*mHitErrs[0]>mHitErrs[1]*mHitErrs[1]); - -// Hit position wrt track - double dca[3] = {hP[0]-tP[0],hP[1]-tP[1],hP[2]-tP[2]}; - - mDcaT=VDOT(mDcaFrame[0],dca); - mDcaP=VDOT(mDcaFrame[1],dca); - mDcaL=VDOT(mDcaFrame[2],dca); -// small account non zero distance to hit along track - double dS = mDcaT*mCosL; - mDcaP-= 0.5*mTkPars._curv*dS*dS; - - double G[3] = {mInErrs->mHH,mInErrs->mHZ,mInErrs->mZZ}; - if (mKase==0) {// Include Hit Errs -//VP?? if (G[0]+G[2]>(mHitErrs[0]+mHitErrs[2])*kTooBigErrFactor) mFailed = kBigErrs; - for (int j=0;j<3;j++) {G[j]+=mHitErrs[j];} - }// end Include Hit Errs - -// (BB*dX*dX-2*BA*dX*dY+AAdY*dY)/det - mXi2 = MyXi2(G,mDcaP,mDcaL); - return mXi2 ; -} -//______________________________________________________________________________ -double StvFitter::Xi2() -{ - mFailed = 0; - double inErr = mInErrs->mHH+mInErrs->mZZ; - double jnErr = mJnErrs->mHH+mJnErrs->mZZ; - if (jnErr>inErr) {//Not good order - const StvNodePars *swp = mInPars; mInPars=mJnPars; mJnPars=swp; - const StvFitErrs *swe = mInErrs; mInErrs=mJnErrs; mJnErrs=swe; - } - - StvFitPars F = (*mInPars-*mJnPars); - double Zero[5]= {0}; - mXi2 = JoinTwo(5,F.Arr() ,mInErrs->Arr() - ,5,Zero ,mJnErrs->Arr() - ,mQQPars.Arr(),mQQErrs.Arr()); - mFailed = (mXi2>kXtraBigXi2); - return mXi2; -} -//______________________________________________________________________________ -int StvFitter::Update() -{ -static int nCall=0; nCall++; -StvDebug::Break(nCall); - if(mFailed>0) return mFailed; - mFailed = 0; - switch (mKase) { - case 0: mFailed = Hpdate(); break; //Hit+Track - case 1: mFailed = Jpdate(); break; //Track join - case 2: mFailed = Vpdate(); break; //Vertex+track - } - - double fak = 1.; - for (int i=0;i<5;i++) { - double f = fabs(mQQPars[i])/mDelta[i]; - if (fak1.) { mFailed = kBigVari; TCL::vscale(mQQPars,1./fak,mQQPars,5);} - - *mOtPars+= mQQPars; - mOtErrs->SetHz(mOtPars->_hz); - return mFailed; -} -//______________________________________________________________________________ -int StvFitter::Hpdate() -{ -/// this is Update for track+hit fit - - mTkErrs = *mInErrs; - - -// New Z ortogonal to X (track direction) - StvFitPars myHitPars(mDcaP, mDcaL ); - StvFitErrs myHitErrs(mHitErrs[0],mHitErrs[1],mHitErrs[2]); - StvFitPars myTrkPars; - - double myXi2 = JoinTwo(2,myHitPars.Arr(),myHitErrs.Arr() - ,5,myTrkPars.Arr(),mTkErrs.Arr() - , mQQPars.Arr(),mOtErrs->Arr()); - mFailed = (myXi2>kXtraBigXi2); - *mOtPars = mTkPars; - - return mFailed; -} -//______________________________________________________________________________ -int StvFitter::Vpdate() -{ -/// this is Update for track+vertex fit -static int nCall=0; nCall++; - mTkErrs = *mInErrs; - -// New Z ortogonal to X (track direction) - StvFitPars myHitPars(mDcaP, mDcaL ); - StvFitPars myTrkPars; - - double myXi2 = JoinVtx(2,myHitPars.Arr(),mHitErrs - ,5,myTrkPars.Arr(),mTkErrs.Arr() - , mQQPars.Arr(),mOtErrs->Arr()); - if (myXi2){} - *mOtPars = mTkPars; - for (int i=0;i<3;i++) {mOtErrs->Arr()[i]+=mHitErrs[i];} - return 0; -} -//______________________________________________________________________________ -int StvFitter::Jpdate() -{ -/// this is Update for sub track+sub track fit (join) - *mOtPars = *mJnPars; - *mOtErrs = mQQErrs; - return mFailed; -} -//______________________________________________________________________________ -double StvFitter::TooBig(StvFitPars &fp, int *mask) const -{ - double fakt = 0; - int msk=0; - for (int i=0;i<5;i++) { - double f = fabs(fp[i])/mDelta[i]; - if (fakt>f) continue; - fakt=f; msk|= 1< -#include -#include -#include -#include "TNamed.h" -#include "StvUtil/StvNodePars.h" - -class StvHit; -class StvNodePars; -class StvHitErrs; -class StHitPlane; -class StvHitErrCalculator; - - -class StvFitter : public TNamed { -public: -enum E_Failed {kBigVari=-1,kBigErrs=-99}; - -public: -StvFitter(const char *name="DefaultFitter"); - void Set(const StvNodePars *inPars, const StvFitErrs *inErrs - , StvNodePars *otPars=0, StvFitErrs *otErrs=0); - void Set(const StvNodePars *inPars, const StvFitErrs *inErrs - ,const StvNodePars *jnPars, const StvFitErrs *jnErrs - , StvNodePars *otPars, StvFitErrs *otErrs); - int IsFailed() const {return mFailed;} -const double *GetHitErrs() const {return mHitErrs;} - void Prep(); - -double Xi2(const StvHit *hit); //Xi2 for hit or vertex -double Xi2(); //Xi2 for 2 subtracks joining -double GetXi2() {return mXi2;} //evaluated Xi2 -int Update(); -static StvFitter *Inst() {return mgFitter;} - -private: -double TooBig(StvFitPars &fp, int *mask) const; -private: -int Hpdate(); //Update Hit fit -int Jpdate(); //Updatejoin fit -int Vpdate(); //Update vertex fit -// static double JoinTwo(int nP1,const double *P1,const double *E1 -// ,int nP2,const double *P2,const double *E2 -// , double *PJ, double *EJ -// ,int mode=0); -static void Test(); -protected: - char mBeg[1]; - char mFailed; //Fail flag. Something completely wrong - char mKase; //0=fit to hit,1=refit,2=fit to vertex -const StvNodePars *mInPars; //1st input params -const StvFitErrs *mInErrs; //1st input params errors -const StvNodePars *mJnPars; //2nd input params -const StvFitErrs *mJnErrs; //2nd input params errors - StvNodePars *mOtPars; //Output params - StvFitErrs *mOtErrs; //Output errors -const StvHit *mHit; -const StHitPlane *mHitPlane; - StvHitErrCalculator *mHitErrCalc; - StvNodePars mTkPars; - StvFitErrs mTkErrs; - StvFitPars mQQPars; - StvFitErrs mQQErrs; - StvFitPars mDelta; //typical deltas for parameters in current env - double mHitErrs[3]; - double mCos2L,mCosL,mSinL,mCosP,mSinP,mXi2,mDeltaL; - double mDcaT,mDcaP,mDcaL; - double mDcaFrame[3][3]; - char mEnd[1]; -static StvFitter *mgFitter; -}; -#endif //__StvFitter_h_ - - diff --git a/StRoot/Stv/StvHit.cxx b/StRoot/Stv/StvHit.cxx deleted file mode 100644 index 04767792917..00000000000 --- a/StRoot/Stv/StvHit.cxx +++ /dev/null @@ -1,101 +0,0 @@ -//StvHit.cxx -//M.L. Miller (Yale Software) -//04/01 -//Rewritten V.Perev 01/2010 -#include -#include -#include "TError.h" -#include "TCernLib.h" -#include "Stiostream.h" -#include "StvHit.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - - -//_____________________________________________________________________________ -StvHit::StvHit() -{ - reset(); -} - -// //_____________________________________________________________________________ -// StvHit::StvHit(const StvHit &h) -// { -// memcpy(mBeg,h.mBeg,mEnd-mBeg+1); -// } -// -// //_____________________________________________________________________________ -// const StvHit& StvHit::operator=(const StvHit & h) -// { -// memcpy(mBeg,h.mBeg,mEnd-mBeg+1); -// return *this; -// } -// -//_____________________________________________________________________________ -StvHit::~StvHit() -{} -//_____________________________________________________________________________ -void StvHit::reset() -{ - memset(mBeg,0,mEnd-mBeg+1); - mMaxTimes = 1; -static unsigned int myCount=0; - mCount = ++myCount; -} -//_____________________________________________________________________________ -void StvHit::set(const void *stHit,const float *gx) -{ - memcpy(mGlo,gx,sizeof(mGlo)); - msthit = stHit; - return; -} -//_____________________________________________________________________________ -double StvHit::err2() const -{ - return ((StvHitErrCalculator*)(mDetector->GetHitErrCalc()))->Trace(mGlo); -} -//_____________________________________________________________________________ -int StvHit::detectorId() const -{ return (int)detector()->GetDetId(); } -//_____________________________________________________________________________ -void StvVertex::set(const float *x,const float matrix[6]) -{ - memcpy(mGlo,x ,sizeof(mGlo)); - memcpy(mErr,matrix,sizeof(mErr)); -} -//_____________________________________________________________________________ -void StvVertex::reset() -{ - memset(mErr,0,sizeof(mErr)); mKount=0; - StvHit::reset(); -} -//_____________________________________________________________________________ - void StvHit::setTimesUsed(int n) -{ - if (!mDetector) return; - mTimesUsed=n; -} -//_____________________________________________________________________________ - void StvHit::addTimesUsed() -{ - if (!mDetector) return; - mTimesUsed++; - assert(mTimesUsed<=mMaxTimes); -} -//_____________________________________________________________________________ - void StvHit::subTimesUsed() -{ - if (!mDetector) return; - mTimesUsed--; - assert(mTimesUsed>=0); -} - - - - - - - - - - diff --git a/StRoot/Stv/StvHit.h b/StRoot/Stv/StvHit.h deleted file mode 100644 index c70e46037d0..00000000000 --- a/StRoot/Stv/StvHit.h +++ /dev/null @@ -1,173 +0,0 @@ -/*! \class StvHit - StvHit is a simple class that encapsulates a three dimensional position - measurement. The measurement is represented in a frame - that is 'local' to the detector plane from which it arose. -

- It is assumed - that all hits come from a detector that can be composed of discrete planes. - Each plane is characterized by two values: position and refAngle. In the - mid-rapidity region of STAR (SVT, TPC, EMC, etc) the position corresponds to - the magnitude of a vector pointing from the origin to the center of the plane. - The refAngle is the azimuthal defined by the aforemention vector and the - STAR global x-axis. All hits store the position and refAngle of the detector - plane from which they came. -

- Within each detector plane, the hit is characterized by two more numbers: - y and z. The y value corresponds to the distance along the plane (e.g., - padrow) w.r.t. the center of the plane. The z value corresponds to the STAR - global coordinate. -

- While it only takes two values (y and z) two specify the hit location within - a plane (once the location of the plane is known) StvHit stores one more - value: x. This value of x corresponds to the magnitude of a vector pointing - from the origin to the detector plane perpendicular to the plane. So, - for planes with no tilt w.r.t. the origin (e.g., TPC pad-planes), x will be - identical to position. Actually, this is not even quite true for tpc hits, as - distortion corrections can make x slightly different than position. However, - by storing both x and position, we allow for the separation of information - that depends only on material location (track fitting) from that which - depends only on hit location (track finding). -

- StvHit stores information that represents a full error matrix. For efficiency - purposes this is stored as a collection of discreet floats instead of a - matrix. Because the error matrix is always symmetric, we must store only six - values. These are denoted by s_ij, where s_ij corresponds to the (i,j) - component of the matrix. -

- StvHit also stores a pointer to an StHit that it corresponds to. - Additionally, StvHit stores a pointer to the StDetector object from which its - measurement arose. - - \author M.L. Miller (Yale Software) - */ - -#ifndef StvHit_HH -#define StvHit_HH -#include "assert.h" -#include "math.h" -class StHitPlane; -class StvHit -{ -public: - - ///Default constructor. - StvHit(); -// StvHit(const StvHit&); -// const StvHit& operator=(const StvHit& ); - ///Default destructor. - ~StvHit(); - - ///Return the global x, y, z values. - const float *x() const {return mGlo;} - float getRxy() const {return sqrt(mGlo[0]*mGlo[0]+mGlo[1]*mGlo[1]);} - ///Return the type of class - virtual int IsHit() const {return 1;} - int IsCombo() const {return mCombo;} - void SetCombo(int combo) {mCombo = combo;} - - ///Return components of the error matrix. - virtual const float *errMtx() const {return 0;} - virtual float *errMtx() {return 0;} - virtual double err2() const; - ///Return a const pointer to the StHitPlane object from which the hit - ///arose. - const StHitPlane* detector() const {return mDetector;} - int detectorId() const; - int idTru() const {return mIdTru;}; - ///Return a const pointer to the StHit object corresponding to this StvHit - ///instance - //const StHit* stHit() const - const void *stHit() const {return msthit;} - void setStHit(const void *stHit) { msthit=stHit;} - void setIdTru(int idTru) { mIdTru=idTru;} - - ///Set the global position one function call - void set(const StHitPlane* detector) {mDetector = detector;} - void set(const void *stHit,const float x[3]); - ///Set the global position and error - virtual void set(const float *x,const float *err){assert(0);} - virtual void addCount() {assert(0);} - virtual void setCount(int kount) {assert(0);} - virtual int getCount() const {assert(0);} - - ///Set the position error matrix for the measurement from an float array - ///object. - virtual void setError(const float errMx[6]){ assert(0);} - - ///Set the number of times used - ///Return the number of times this hit was assigned to a track - void setMaxTimes(int set) {mMaxTimes = set;} - void setTimesUsed(int set=0); - void addTimesUsed(); - void subTimesUsed(); - ///Return a boolean that marks whether or not this hit is assigned to a - ///track >= than max times. - virtual int timesUsed() const { return mTimesUsed;} - int isUsed() const {return mTimesUsed>=mMaxTimes;} - virtual void reset(); - void unset(){;} -protected: - char mBeg[1]; - unsigned char mMaxTimes; - unsigned char mTimesUsed; - unsigned char mCombo; - float mGlo[3]; //global position - const void *msthit; - const StHitPlane *mDetector; - int mIdTru; - // drift velocities cm/mksec( 0 for non driting ) - char mEnd[1]; -public: - int mCount; -}; - -class StvHitRr : public StvHit -{ -public: - - ///Default constructor. - StvHitRr(){mErr[0] = -999;} - ///Default destructor. - ~StvHitRr(){;} - ///Set the position error matrix for the measurement from an float array - ///object. - - const float *errMtx() const {return mErr;} - float *errMtx() {return mErr;} - virtual double err2() const {return mErr[0]+mErr[2];} - -protected: - float mErr[6]; //error matrix -}; - - -class StvVertex : public StvHit -{ -public: - - ///Default constructor. - StvVertex(){;} - ///Default destructor. - ~StvVertex(){;} - ///Set the position error matrix for the measurement from an float array - ///object. - virtual int IsHit() const {return 0;} - void reset(); - void set(const float *x,const float *err); - virtual int timesUsed() const { return 0;} - virtual void addTimesUsed(int){;} - virtual void setTimesUsed(int){;} - - virtual void addCount() {mKount++ ;} - virtual void setCount(int kount) {mKount=kount ;} - virtual int getCount() const {return mKount;} - - const float *errMtx() const {return mErr;} - float *errMtx() {return mErr;} - - -protected: - float mErr[6]; //error matrix - int mKount; -}; -#endif diff --git a/StRoot/Stv/StvHitCounter.cxx b/StRoot/Stv/StvHitCounter.cxx deleted file mode 100644 index 4238dd4938a..00000000000 --- a/StRoot/Stv/StvHitCounter.cxx +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include -#include "StvConst.h" - -#include "Stv/StvHitCounter.h" - -//_____________________________________________________________________________ -StvHitCounter::StvHitCounter() -{ - Clear(); -// mMinTotHits =6; //Min number hits for track -// mMinGoodHits=3; //Min number good hits for track -// mMinContHits=2; //Min length of good hit sequence -// mMaxContNits=13; //Max length of acceptable non hit sequence -// mMaxTotNits =15; //Max number of acceptable non hits -} -//_____________________________________________________________________________ -void StvHitCounter::SetCons(const StvKonst_st* kons) -{ - mKons = kons; - mMinTotHits = mKons->mMinTotHits; - mMinGoodHits = mKons->mMinGoodHits; - mMinContHits = mKons->mMinContHits; - mMaxContNits = mKons->mMaxContNits; - mMaxTotNits = mKons->mMaxTotNits; -} -//_____________________________________________________________________________ -int StvHitCounter::MaxNitSeq() const -{ - if (nContNits>mContNits) return nContNits; - else return mContNits; -} -//_____________________________________________________________________________ -int StvHitCounter::MaxHitSeq() const -{ - if (nContHits>mContHits) return nContHits; - else return mContHits; -} -//_____________________________________________________________________________ -void StvHitCounter::AddHit() -{ - nPossHits++; nTotHits++;nContHits++; - if (!nContNits) return; - if (nContHitsmMaxContNits) nSeqLong++; - if (mContNits=mMinContHits)? nGoodHits+nContHits : nGoodHits; - if (nG mMaxTotNits) rej+=4; - - return rej; -} -//_____________________________________________________________________________ -int StvHitCounter::Skip() const -{ - int rej = 0; - if (nContNits>mMaxContNits) rej+= 1; - if (nTotNits > mMaxTotNits) rej+= 2; - return rej ; -} -//_____________________________________________________________________________ -double StvHitCounter::Eff() const -{ - double p = nTotHits/(nPossHits+1e-6); - double q = 1-p; - return p +1*sqrt(p*q/(nPossHits+1e-6)); -} diff --git a/StRoot/Stv/StvHitCounter.h b/StRoot/Stv/StvHitCounter.h deleted file mode 100644 index f3fe2e94fe2..00000000000 --- a/StRoot/Stv/StvHitCounter.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * \file StvHitCounter.h - * \brief Definition StvHitCounter - * - */ -#include -#ifndef StvHitCounter_H -#define StvHitCounter_H 1 -class StvKonst_st; - -/// Hit counting -class StvHitCounter -{ -public: -StvHitCounter(); -void Clear() {memset(mBeg,0,mMed-mBeg+1);} -void SetCons(const StvKonst_st*); - -void AddHit(); -void AddNit(); -int Reject() const; -int Skip() const; -double Eff() const; -int MaxNitSeq() const; //Length of longesr Nits sequence -int MaxHitSeq() const; //Length of longesr Hits sequence -public: -char mBeg[1] ; -const StvKonst_st *mKons; -int nPossHits; // Number of possible hits; -int nTotHits ; // Total number of hits -int nGoodHits; // Number of good hits (hits in sequences > kContHits -int nSeqHits ; // Number of hit sequences -int nSeqShort; // Number of too short hit sequences -int nTotNits ; // Total number of Non Hits(Nits) -int nSeqNits ; // Number of Non Hit(Nit) sequences -int nSeqLong ; // Number of too long Non Hit(Nit) sequences -int nContHits; // Number of hits in current Hit sequence -int nContNits; // Number of nits in current nonHit sequence -int mContHits; // Number of hits in maximal Hit sequence -int mContNits; // Number of nits in maximal nonHit sequence -char mMed[1] ; -int mMinTotHits; //Min number hits for track -int mMinGoodHits; //Min number good hits for track -int mMinContHits; //Min length of good hit sequence -int mMaxContNits; //Max length of acceptable non hit sequence -int mMaxTotNits; //Max number of acceptable non hits -char mEnd[1] ; -}; - -#endif - diff --git a/StRoot/Stv/StvHitter.cxx b/StRoot/Stv/StvHitter.cxx deleted file mode 100644 index cd1168b61e7..00000000000 --- a/StRoot/Stv/StvHitter.cxx +++ /dev/null @@ -1,95 +0,0 @@ -#include "StvHitter.h" -#include "Stv/StvHit.h" -#include "TGeoManager.h" -#include "TGeoVolume.h" -#include "StvHitter.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StvUtil/StvNodePars.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StarRoot/StMultiKeyMap.h" - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StvHitter::StvHitter() -{ - fMultiIter = new StMultiKeyMapIter(0); -} -//_____________________________________________________________________________ -StvHitter::~StvHitter() -{ - delete fMultiIter; -} -//_____________________________________________________________________________ -void StvHitter::Reset() -{ - mHitPlane=0; -} -//_____________________________________________________________________________ -const StvHits *StvHitter::GetHits(const StvNodePars *pars - ,const StvFitErrs *errs, const float gate[4]) -{ -enum {kLittleBit = 5}; - -static int nCall=0; nCall++; -static StTGeoProxy * const myProxy = StTGeoProxy::Inst(); - mHits.clear(); - const StHitPlane *myHitPlane = myProxy->GetCurrentHitPlane(); - if (!myHitPlane) return 0; //no sensitive volume there - - if (mHitPlane == myHitPlane) return 0; //hit plane was already used - int nHits = myHitPlane->GetNHits(); - if (!nHits) return &mHits; //it is sensitive but no hits - - mHitPlane = myHitPlane; - - mHitMap = mHitPlane->GetHitMap(); - float xNode[3]={(float)pars->_x,(float)pars->_y,(float)pars->_z}; - mOrg = mHitPlane->GetOrg(xNode); - mDir = &mHitPlane->GetDir(xNode); - - - float tau =0,den=0; - float const *ort =(*mDir)[0]; - float mom[3]={(float)pars->_cosCA,(float)pars->_sinCA,(float)pars->_tanl}; - - for (int j=0;j<3;j++) {tau+=(mOrg[j]-xNode[j])*ort[j]; - den+= mom[j] *ort[j];} - if (fabs(den)<1e-2) return 0; // track is parallel to hit plane - tau/=den; - for (int j=0;j<3;j++) {xNode[j]+=mom[j]*tau;} - - double myGate[2]; -// Obtain track errs - double cos2 = den*den/(1.+mom[2]*mom[2]); - - double totRr = (errs->mHH+errs->mZZ)/cos2; - totRr = sqrt(totRr); - for (int j=0;j<2;j++) { - myGate[j] = gate[j]*totRr; - if (myGate[j]>gate[j+2]) myGate[j]=gate[j+2];} - - float lNode[3],lim[2][2]; - mHitPlane->ToLocal(xNode,lNode); - for (int j=0;j<2;j++) {lim[0][j]=lNode[1+j]-myGate[j]; - lim[1][j]=lNode[1+j]+myGate[j];} - - fMultiIter->Set(mHitMap->GetTop(),lim[0],lim[1]); - for (StMultiKeyNode *node=0;(node = *(*fMultiIter)) ;++(*fMultiIter)) - { - StvHit *nexHit = (StvHit*)node->GetObj(); - if (nexHit->isUsed()) continue; - mHits.push_back(nexHit); - } - return &mHits; -} -//_____________________________________________________________________________ -const StHitPlane* StvHitter::GetHitPlane() const {return mHitPlane;} - -//_____________________________________________________________________________ -StDetectorId StvHitter::GetDetId() const -{ - if (!mHitPlane) return (StDetectorId)0; - return mHitPlane->GetDetId(); -} - - diff --git a/StRoot/Stv/StvHitter.h b/StRoot/Stv/StvHitter.h deleted file mode 100644 index 386350d23aa..00000000000 --- a/StRoot/Stv/StvHitter.h +++ /dev/null @@ -1,43 +0,0 @@ -/// \File StvHitter.h -/// \author Victor Perev 04/2010 -#ifndef StvHitter_HH -#define StvHitter_HH -#include "TNamed.h" -#include "StEvent/StEnumerations.h" -#include "StvStl.h" - - -class StvSeedFinder; -class StvHit; -class StHitPlane; -class StvNodePars; -class StMultiKeyMap; -class StMultiKeyMapIter; -class StvNodePars; -class StvFitErrs; -typedef float Mtx33F_t[3][3]; - -/// \class StvHitter, local hit provider -class StvHitter -{ -public: - StvHitter(); - ~StvHitter(); -void Reset(); -const StvHits *GetHits(const StvNodePars *np, const StvFitErrs *ne,const float gate[2]); -const StHitPlane* GetHitPlane() const; - StDetectorId GetDetId() const; -private: -private: -const StHitPlane *mHitPlane; -const StMultiKeyMap *mHitMap; -const float *mOrg; //xyz of origine of hit plane -const Mtx33F_t *mDir; //orts of hit plane, local x,y,x orts -StMultiKeyMapIter *fMultiIter; - -StvHits mHits; -public: -StvSeedFinder *mSF; -}; - -#endif diff --git a/StRoot/Stv/StvKalmanTrackFinder.cxx b/StRoot/Stv/StvKalmanTrackFinder.cxx deleted file mode 100644 index 599f5d513da..00000000000 --- a/StRoot/Stv/StvKalmanTrackFinder.cxx +++ /dev/null @@ -1,485 +0,0 @@ -#include -#include -#include - -#include "TMath.h" -#include "TCernLib.h" - -#include "StvSeedFinder.h" -#include "StvKalmanTrackFinder.h" - -#include "StvToolkit.h" -#include "StMultiKeyMap.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "Stv/StvHit.h" -#include "StvUtil/StvNodePars.h" -#include "StvUtil/StvELossTrak.h" -#include "StvUtil/StvDebug.h" -#include "StvTester.h" -#include "Stv/StvEnum.h" -#include "Stv/StvConst.h" -#include "Stv/StvDiver.h" -#include "Stv/StvHitter.h" -#include "Stv/StvFitter.h" -#include "Stv/StvTrackFitter.h" -#include "Stv/StvDraw.h" -#include "Stv/StvStl.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "Stv/StvHitCounter.h" -ClassImp(StvKalmanTrackFinder) - -int ThruFgt(const StvNodePars &par); ///??????????????????????????????? - -typedef std::vector StvNodeVec; -typedef std::map StvNodeMap; -typedef StvNodeMap::iterator StvNodeMapIter ; - -//_____________________________________________________________________________ -StvKalmanTrackFinder::StvKalmanTrackFinder(const char *name):StvTrackFinder(name) -{ - memset(mBeg,0,mEnd-mBeg+1); - mDive = StvDiver::Inst(); - mHitter = new StvHitter(); - mHitCounter = new StvHitCounter(); - } -//_____________________________________________________________________________ -void StvKalmanTrackFinder::Clear(const char*) -{ - StvTrackFinder::Clear(""); -} -//_____________________________________________________________________________ -void StvKalmanTrackFinder::Reset() -{ -} -//_____________________________________________________________________________ -void StvKalmanTrackFinder::SetCons(const StvKonst_st* k) -{ - mKons = k; - double rMax,zMin,zMax; - StTGeoProxy::Inst()->GetHitShape()->Get(zMin,zMax,rMax); - if (zMax < -zMin) zMax = -zMin; - mDive->SetRZmax(rMax,zMax); - mHitCounter->SetCons(mKons); - mDive->SetRZmax(mKons->mRxyMax,mKons->mZMax); -} -//_____________________________________________________________________________ -int StvKalmanTrackFinder::FindTracks() -{ -static int nCall = 0; nCall++; -static int nTally = 0; -static StvToolkit *kit = StvToolkit::Inst(); -enum {kRepeatSeedFinder = 2}; - - int nTrk = 0,nTrkTot=0,nAdded=0,nHits=0,nSeed=0,nSeedTot=0; - StvSeedFinders *seedFinders = kit->SeedFinders(); - double aveRes=0,aveXi2=0,aveHits=0; - mCurrTrak = 0; - - for (int seedFinder=0;seedFinder<(int)seedFinders->size();seedFinder++) { //Loop over seed finders - mSeedFinder = (*seedFinders)[seedFinder]; - for (int repeat =0;repeatAgain(repeat); - while ((mSeedHelx = mSeedFinder->NextSeed())) - { - nSeed++; nTally++; - if (!mCurrTrak) mCurrTrak = kit->GetTrack(); - mCurrTrak->CutTail(); //Clean track from previous failure - -//============================= - nAdded = FindTrack(0); -//============================= - - if (!nAdded) {mSeedFinder->FeedBack(0); continue;} - mCurrTrak->CutEnds(); //remove ends without hits - int ans = 0,fail=13; -// Refit track - int nFitHits = mCurrTrak->GetNHits(); - do { - if (!mRefit) continue; - if(nFitHits<3) break; -//============================= - if(nFitHits>3)ans = Refit(1); -//============================= - if (ans) break; - StvTrack refiTrak(*mCurrTrak); - nHits = mCurrTrak->GetNHits(); - if (nHits<3) break; -//============================= - nAdded = FindTrack(1); -//============================= - if (nAdded<=0) continue;; - nHits = mCurrTrak->GetNHits(); - if (nHits<3) break; -// few hits added. Refit track to beam again -//============================= - ans = Refit(0); -//============================= - if (ans) { - *mCurrTrak = refiTrak; - } - - } while((fail=0)); - - nHits = mCurrTrak->GetNHits(); - if (nHits < mKons->mMinHits) fail+=100; ; - if (fail) nHits=0; - if (fail) {//Track is failed, release hits & continue - mSeedFinder->FeedBack(0); - mCurrTrak->CutTail(); continue; - } - StvNode *node = MakeDcaNode(mCurrTrak); if(node){}; - - mSeedFinder->FeedBack(mCurrTrak); - - mCurrTrak->AddId(10*seedFinder+repeat); - mCurrTrak->SetUsed(); - kit->GetTracks().push_back(mCurrTrak); - nTrk++;nTrkTot++; - aveHits+= nHits; - aveRes += mCurrTrak->GetRes(); - aveXi2 += mCurrTrak->GetXi2(); - mCurrTrak=0; - } - nSeedTot+=nSeed; - Info("FindTracks:","SeedFinder(%s) Seeds=%d Tracks=%d ratio=%d\n" - ,mSeedFinder->GetName(),nSeed,nTrk,(100*nTrk)/(nSeed+1)); - - if (!nTrk ) break; - }//End of repeat - }//End of seed finders - - if (nTrkTot) {aveHits/=nTrkTot;aveRes/=nTrkTot; aveXi2/=nTrkTot;} - Info("FindTracks","tracks=%d aveHits = %g aveRes = %g aveXi2=%g",nTrkTot,aveHits,aveRes,aveXi2); - return nTrkTot; -} -//_____________________________________________________________________________ -int StvKalmanTrackFinder::FindTrack(int idir) -{ - -static int nCall=0; nCall++; -static int nTally=0; -static StvToolkit *kit = StvToolkit::Inst(); -static StvFitter *fitt = StvFitter::Inst(); -StvNodePars par[2]; -StvFitErrs err[2]; -int mySkip=0,idive = 0,nNode=0,nHits=0,nTotHits=0; -double totLen=0; -StvNode *curNode=0,*preNode=0,*innNode=0,*outNode=0; -const StHitPlane *prevHitPlane=0; -mHitCounter->Clear(); - - if (mCurrTrak->empty()) {//Track empty, Backward tracking, to beam - assert(!idir); - double Hz = kit->GetHz(mSeedHelx->Pos()); - par[0].set(mSeedHelx,Hz); //Set seed pars into par[0] and err[0] - err[0].Set(mSeedHelx,Hz); err[0]*= kKalmanErrFact; - par[0].reverse(); //Seed direction OutIn but track direction is allways InOut - err[0].Backward(); - - } else {//Forward or backward tracking - - curNode =(idir)? mCurrTrak->back(): mCurrTrak->front(); - par[0] = curNode->GetFP(); err[0] = curNode->GetFE(); //Set outer node pars into par[0] - nTotHits = mCurrTrak->GetNFits(idir); - } - -// Skip too big curvature or pti - if (fabs(par[0]._curv)>mKons->mMaxCurv) return 0; - if (fabs(par[0]._ptin)>mKons->mMaxPti) return 0; - -// skip P too small - { double t = par[0]._tanl, pti = par[0]._ptin; - if ((t*t+1.)< mKons->mMinP2*pti*pti) return 0; - } - fitt->Set(par, err, par+1,err+1); - mHitter->Reset(); - StvFitDers derivFit; - mDive->Reset(); -// We need here to find a hit and calulate errs. No Dca yet - mDive->SetOpt(StvDiver::kTargHit | StvDiver::kDoErrs); - mDive->Set(par+0,err+0,idir); - mDive->Set(par+1,err+1,&derivFit); //Output of diving in par[1] - - - while((idive & StvDiver::kDiveHits) || idive==0) { - - do {//Stop tracking? - idive = 99; - if (!nNode) continue; //No nodes yet, OK - mySkip = mHitCounter->Skip(); - if (mySkip) break; //Skip stop tracking, - } while ((idive=0)); - if (idive) break; - -//+++++++++++++++++++++++++++++++++++++ - nTally++; - idive = mDive->Dive(); -//+++++++++++++++++++++++++++++++++++++ - if (idive & StvDiver::kDiveBreak) break; - if (idive & StvDiver::kDiveDca ) break; - - double deltaL = mDive->GetLength(); - totLen+=deltaL; - par[0]=par[1]; err[0]=err[1]; //pars again in par[0] - // Stop tracking when too big Z or Rxy - if (fabs(par[0]._z) > mKons->mZMax ) break; - if (par[0].getRxy() > mKons->mRxyMax) break; - if (fabs(par[0]._curv)>mKons->mMaxCurv) break; - if (fabs(par[0]._ptin)>mKons->mMaxPti) break; - - - const StvHits *localHits = 0; - if (idive & StvDiver::kDiveHits) { - float gate[4]={mKons->mCoeWindow,mKons->mCoeWindow - ,mKons->mMaxWindow,mKons->mMaxWindow}; - localHits = mHitter->GetHits(par,err,gate); - } - - -// Create and add node to myTrak - preNode = curNode; - curNode = kit->GetNode(); - assert(preNode != curNode); - assert(curNode != mCurrTrak->front()); - assert(curNode != mCurrTrak->back ()); - - if (!idir) {mCurrTrak->push_front(curNode);innNode=curNode;outNode=preNode;} - else {mCurrTrak->push_back(curNode);innNode=preNode;outNode=curNode;} - if (outNode){} - nNode++; - if (nNode>256) { //Something very wrong - Error("FindTrack","Too many nodes =200 Skip track"); - return 0; - } - - curNode->mLen = (!idir)? totLen:-totLen; - // Set prediction - - StvELossTrak *eld = mDive->TakeELoss(); - if (par[0].getP2() < kBigMom2) { - innNode->SetELoss(eld,idir); - err[0].Add(eld,par[0],0); - err[0].Recov(); - } else { - kit->FreeELossTrak(eld); - } - - - curNode->SetXDive(par[0]); - curNode->SetPre(par[0],err[0],0); - innNode->SetDer(derivFit,idir); - - if (!localHits) continue; //Never hits in curNode - curNode->SetHitPlane(mHitter->GetHitPlane()); - - if (!localHits->size()) {//No hits in curNode - mHitCounter->AddNit(); continue; - } - if (prevHitPlane == mHitter->GetHitPlane()) continue; - prevHitPlane = mHitter->GetHitPlane(); - - fitt->Prep(); - double minXi2[2]={1e11,1e11},myXi2; - StvHit *minHit[2]={0}; - minXi2[0] = mKons->mXi2Hit,myXi2=3e33; - int minIdx = -1; - for (int ihit=0;ihit<(int)localHits->size();ihit++) { - StvHit *hit = (*localHits)[ihit]; - myXi2 = fitt->Xi2(hit); - if (nTotHits > 5 && fitt->IsFailed() == -99) { // Too big track errs - mySkip = 4; break; //Track Errors too big, stop tracking - } - if (myXi2 > minXi2[0]) continue; - minXi2[1]=minXi2[0]; minXi2[0] = myXi2; - minHit[1]=minHit[0]; minHit[0] = hit; minIdx = ihit; - } - if (minIdx){}; - - if (mySkip) break; //Track Errors too big - - - curNode->SetMem(minHit ,minXi2); - if (minHit[0] ) { // Fit succesful - - myXi2 = fitt->Xi2(minHit[0]); - int iuerr = fitt->Update(); - if (iuerr<=0 || (nHits<3)) { //Hit accepted - mHitCounter->AddHit(); - nHits++;nTotHits++;assert(nHits<256); - curNode->SetHE(fitt->GetHitErrs()); - curNode->SetFit(par[1],err[1],0); - par[0]=par[1]; - err[0]=err[1]; - } else { minHit[0]=0;} - } else {//No Hit or ignored - myXi2 = 1e11; - mHitCounter->AddNit(); - } - curNode->SetHit(minHit[0]); - curNode->SetXi2(myXi2,0); - - } // End Dive&Fitter loop - - mCurrTrak->SetTypeEnd(mySkip); - if (!idir) { - double eff = mHitCounter->Eff(); if (eff){} - int myReject = mHitCounter->Reject(); - if (myReject) { - - mCurrTrak->CutTail(); return 0; } - } - if (nHits>3) { - double tlen = mCurrTrak->GetLength(); - assert(tlen >0.0 && tlen<1500); - } - - - return nHits; - -} -//_____________________________________________________________________________ -int StvKalmanTrackFinder::Swim(int idir, int opt, const double target[3] - ,const StvNodePars *inpPar,const StvFitErrs *inpErr - , StvNodePars *outPar, StvFitErrs *outErr - , StvFitDers *derivFit) -{ - -static int nCall=0; nCall++; - - mDive->Reset(); - mDive->Set(inpPar,inpErr,idir); - mDive->Set(outPar,outErr,derivFit); //Output of diving in par[1] - mDive->SetOpt(opt); - int nTg = (opt & StvDiver::kTarg3D)? 3:2; - if (target) mDive->SetTarget(target,nTg); - - -//+++++++++++++++++++++++++++++++++++++ - - int idive = mDive->Dive(); - -//+++++++++++++++++++++++++++++++++++++ - return idive; - -} -//_____________________________________________________________________________ -StvNode *StvKalmanTrackFinder::MakeDcaNode(StvTrack *tk) -{ -static StvToolkit *kit = StvToolkit::Inst(); - - StvNode *start = tk->front(); -// We search DCA point + errors only (no hits) - int opt = StvDiver::kTarg2D | StvDiver::kDoErrs; - StvNodePars dcaPars; - StvFitErrs dcaErrs; - StvFitDers dcaDers; - int iSwim = Swim(0,opt,0 - ,&(start->GetFP()),&(start->GetFE()) - ,&dcaPars,&dcaErrs,&dcaDers); - if (!(iSwim & StvDiver::kDiveDca)) return 0; - - StvNode *dcaNode = kit->GetNode(); - tk->push_front(dcaNode); - dcaNode->mLen = start->mLen + mDive->GetLength(); - // Set prediction - StvELossTrak *eld = mDive->TakeELoss(); - if (dcaPars.getP2()SetELoss(eld,0); - dcaErrs.Add(eld,dcaPars,0); - -// double p0 = start->GetFP().getP(); -// double p1 = dcaPars.getP(); -// double PiMASS=0.13956995; -// double e0 = sqrt(p0*p0+PiMASS*PiMASS); -// double e1 = sqrt(p1*p1+PiMASS*PiMASS); -//???assert(e1>e0); -//??assert(fabs((e1-e0)-eld->ELoss()) <0.3*eld->ELoss()+kOneMEV); - - } else { - kit->FreeELossTrak(eld); - } - dcaNode->SetPre(dcaPars,dcaErrs,0); - dcaNode->SetDer(dcaDers,0); - dcaNode->SetXi2(1e11,0); - dcaNode->SetType(StvNode::kDcaNode); - double testDca = TCL::vdot(&dcaPars._cosCA,dcaPars.P,2); - assert(fabs(testDca)<1e-4); - - return dcaNode; -} -//_____________________________________________________________________________ -int StvKalmanTrackFinder::FindPrimaries(const StvHits &vtxs) -{ -static StvToolkit *kit = StvToolkit::Inst(); - - StvTracks &traks = kit->GetTracks(); - int goodCount= 0, plus=0, minus=0; - int nVertex = vtxs.size(); - if (!nVertex) return 0; - int nTracks = 0; - for (StvTrackIter it=traks.begin(); it!=traks.end() ;++it) { - StvTrack *track = *it; nTracks++; - double dca00 = track->ToBeam(); - if (dca00 > mKons->mDca2dZeroXY) { - continue; - } - int bestVertex=-1; double bestXi2 = mKons->mXi2Vtx; - for (int iVertex=0;iVertexFit(track,vertex,0)) continue; - double Xi2 = mTrackFitter->GetXi2(); - if (Xi2>=bestXi2) continue; -// Found better Xi2 - bestXi2 = Xi2; bestVertex=iVertex; - }//End vertex loop - - if(bestVertex<0) continue; - StvNode *node = kit->GetNode(); - StvHit *hit = vtxs[bestVertex]; - hit->addCount(); - mTrackFitter->Fit(track,hit,node); - track->push_front(node); - track->SetPrimary(bestVertex+1); - node->SetType(StvNode::kPrimNode); - node->SetHit(hit); - node->SetXi2(bestXi2,0); - goodCount++; - if (track->GetCharge()>0) { plus++; } else { minus++; } - - }//End track loop - return goodCount; -} -//_____________________________________________________________________________ -int StvKalmanTrackFinder::Refit(int idir) -{ - return mTrackFitter->Refit(mCurrTrak,idir); -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -//_____________________________________________________________________________ -//_____________________________________________________________________________ -//_____________________________________________________________________________ -// int checkfgt(double x0, double y0, double x1, double y1){ -// static const double z=67.399; //disc1 z -// double x=x0+x1*z; -// double y=y0+y1*z; -// double r=sqrt(x*x+y*y); -// if(r>12.0 && r<38.0) return 1; -// return 0; -// } - -int ThruFgt(const StvNodePars &par) -{ -static const double kZ=67.399; //disc1 z -static const double kRmin =12.0; -static const double kRmax =38.0; - double t = (kZ-par._z)/par._tanl; - if (t<0) return 0; - double myX = par._x + par._cosCA*t; - double myY = par._y + par._sinCA*t; - double rr = myX*myX+myY*myY; - if (rrkRmax*kRmax) return 0; - return 1; -} diff --git a/StRoot/Stv/StvKalmanTrackFinder.h b/StRoot/Stv/StvKalmanTrackFinder.h deleted file mode 100644 index f3d92d2ddcf..00000000000 --- a/StRoot/Stv/StvKalmanTrackFinder.h +++ /dev/null @@ -1,57 +0,0 @@ -/// \File StvKalmanTrackFinder.h -/// \author Victor Perev 01/2010 -#ifndef StvKalmanTrackFinder_HH -#define StvKalmanTrackFinder_HH -#include "StvTrackFinder.h" - -class StvSeedFinder; -class StvDiver; -class StvPars; -class StvTrack; -class StvDiver; -class StvHitter; -class StvHitVector; -class StvNodePars; -class StvFitErrs; -class StvFitDers; -class StvHitCounter; -class StvKonst_st; -/// \class StvKalmanTrackFinder - -class StvKalmanTrackFinder : public StvTrackFinder -{ -public: - StvKalmanTrackFinder(const char *name="KalmanTrackFinder"); - ~StvKalmanTrackFinder(){;} - void SetCons(const StvKonst_st*); - int FindTracks(); - int Refit(int idir); - int FindTrack(int idir); -StvNode *MakeDcaNode(StvTrack *tk); - int FindPrimaries(const StvHits &vtxs); - int Swim(int idir,int opt, const double target[3] - ,const StvNodePars *inpPar,const StvFitErrs *inpErr - , StvNodePars *outPar, StvFitErrs *outErr - , StvFitDers *derivFit); - void Reset(); - void Clear(const char *opt=""); - - -protected: -char mBeg[1]; -int mMinHits; /*Min number of hits allowed MidEta*/ -int mNorHits; /*Normal number of hits allowed MidEta*/ -int mGoodHits; /*Min umber of Good hits in track MidEta*/ -const StvKonst_st *mKons; - StvHitCounter *mHitCounter; - StvSeedFinder *mSeedFinder; -const THelixTrack *mSeedHelx; - StvTrack *mCurrTrak; -StvDiver *mDive; -StvHitter *mHitter; -char mEnd[1]; -private: -ClassDef(StvKalmanTrackFinder,0); -}; - -#endif diff --git a/StRoot/Stv/StvKalmanTrackFitter.cxx b/StRoot/Stv/StvKalmanTrackFitter.cxx deleted file mode 100644 index cd0b596f838..00000000000 --- a/StRoot/Stv/StvKalmanTrackFitter.cxx +++ /dev/null @@ -1,676 +0,0 @@ -#include -#include -#include - -#include "TMath.h" - -#include "TCernLib.h" -#include "TSystem.h" -#include "StvKalmanTrackFitter.h" -#include "Stv/StvToolkit.h" -#include "Stv/StvHit.h" -#include "StvUtil/StvNodePars.h" -#include "StvUtil/StvDebug.h" -#include "StvUtil/StvELossTrak.h" -#include "Stv/StvFitter.h" -#include "Stv/StvEnum.h" -#include "Stv/StvConst.h" -#include "Stv/StvStl.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "Stv/StvConst.h" -ClassImp(StvKalmanTrackFitter) -#define DIST2(a,b) ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2])) - -static const int kXtendFactor = 10;//Xi2 factor that fit sure failed -static const double kPiMass=0.13956995; -static const double kMinP = 0.01,kMinE = sqrt(kMinP*kMinP+kPiMass*kPiMass); -static const double kMaxCorr = 0.1; -//_____________________________________________________________________________ -StvKalmanTrackFitter::StvKalmanTrackFitter():StvTrackFitter("StvKalmanTrackFitter") -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//_____________________________________________________________________________ -void StvKalmanTrackFitter::Clear(const char*) -{ - StvTrackFitter::Clear(""); -} -//_____________________________________________________________________________ -void StvKalmanTrackFitter::SetCons(const StvKonst_st *kons) -{ - mKons = kons; -} -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Refit(StvTrack *trak,int dir, int lane, int mode) -{ -/// refit or smouthe track, using the previous Kalman. -/// dir=0 moving from out to in -/// dir=1 moving from in to out -/// mode=0 No join -/// mode=1 Join -/// fit direction is imagined from left to rite -static int nCall=0; nCall++; - -static StvFitter *fitt = StvFitter::Inst(); - -//term LEFT here: Curren Kalman chain of fits from left to rite -// Rite here: Previous Kalman chain, allready fitted, in different direction. -// It was made from rite to left - - int jane=1-lane; - int nFitLeft=0; // number of fits made by this pass excluding current node - int nFitRite=0; // number of fits made during previous - // pass in different direction, including current node - int wasFitted=0; // this node was fitted in previous pass - mNHits = trak->GetNFits(jane); - if (mode&1) {//Join of two lanes - nFitRite = mNHits;} - else {//no join. lanes independent - jane=lane; - } - int nErr = 0; - - StvNodeIter it,itBeg,itEnd; - if (dir) { //fit in ==> out - itBeg = trak->begin(); itEnd = trak->end(); - } else {//fit out ==> in - itBeg = trak->end(); --itBeg; itEnd = trak->begin();--itEnd; - } - - - double myXi2=3e33; - StvNode *node=0,*preNode=0,*innNode=0,*outNode=0; - if(innNode){}; if(outNode){}; - int iNode=0,iFailed=0; - - for (it=itBeg; it!=itEnd; (dir)? ++it:--it) {//Main loop - preNode=node; - node = *it; iNode++; - if (!dir) { innNode = node; outNode = preNode;} - else { outNode = node; innNode = preNode;} -enum myCase {kNull=0,kLeft=1,kRite=2,kHit=4,kFit=8 }; - node->GetFE(lane).mHH = -1; - node->GetFE(lane).mZZ = -1; - -// if (node->GetType()==StvNode::kDcaNode) { -// printf("DCAInit lane=%d err=%g\n",jane,sqrt(node->mFE[jane].mPP)); -// assert(!(nFitLeft*nFitRite)); -// } - - int kase = 0; - if (nFitLeft) kase|=kLeft; - if (mode && nFitRite) kase|=kRite; - const StvHit *hit = node->GetHit(); - wasFitted = (mode&1)? node->IsFitted(jane):0; -// if (wasFitted ) kase|=kHit; - if (hit) kase|=kHit; - -// Imaginary we are always coming from left to right. -// kLeft = left fits only, no hit -// kLeft+kHit = Left fits only, now hit, -// kRite = No left, no hit, rite fits only -// kLeft+kRite = left fits, no hit, rite fits -// kHit+kRite = No left fits, now hit, rite fits -// kLeft+kRite+kHit = Left fits,now hit, rite fits - node->SetXi2(3e33,lane); - switch (kase) {// 1st switch, fill PREDICTION - - default: assert(0 && "Wrong Case1"); - - case kRite|kHit: // No left, now Hit, rite fits - case kNull|kHit: // No left, now Hit, No rite - { // Empty leading node -// It was not fits before(left) but shoulf be now. -// get params from previous dir and set huge errors - node->mPP[lane] = node->mFP[2]; //prediction from opposite fit - node->mPE[lane] = node->mFE[2]; - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - - node->mPE[lane]*=kKalmanErrFact; //Big errors - node->mPE[lane].Recov(); //But not too big - break; - } - - case kRite: // No left, no Hit, rite fits - case kNull: - { // Empty leading node -// It was not fits before(left) get params from previous dir -// and set huge errors - node->mPP[lane] = node->mFP[2]; //prediction from opposite fit - node->mPE[lane] = node->mFE[2]; //Big errors - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - break; - } - case kLeft: // Left fits only, no Hit - case kLeft| kHit: // Left fits only, now Hit - case kLeft|kRite : // Left fits, no Hit, Rite fits - case kLeft|kRite|kHit: // Left fits,now Hit, Rite fits - { -// It was fits before. Propagate it - Propagate(node,preNode,dir,lane); //prediction from last fit - break; - } - - }//End 1st prediction switch - -// if (node->GetType()==StvNode::kDcaNode) { -// printf("DCA1st lane=%d err=%g\n",lane,sqrt(node->mPE[lane].mPP)); -// } - switch (kase) {// 2nd switch, fill FITD - - case kNull: // No fits no Hit - case kLeft: // Left fits only, no Hit - case kRite: // Rite fits only, no Hit - case kLeft|kRite: // Left fits, no Hit, Rite fits - { -// No hit. Fit = Prediction - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - node->SetFit(node->mPP[lane],node->mPE[lane],lane); - break; - } - - case kNull| kHit: // Left fits only, now Hit - case kLeft| kHit: // Left fits only, now Hit - case kRite| kHit: // No left, now Hit, rite fits - case kLeft|kRite|kHit: // Left fits,now Hit, Rite fits - { -// Fit it -static int nQQQQ=0; nQQQQ++; -StvDebug::Break(nQQQQ);//??????????? - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - fitt->Set(node->mPP+lane,node->mPE+lane,node->mFP+lane,node->mFE+lane); - fitt->Prep(); - - myXi2 = fitt->Xi2(hit); iFailed = fitt->IsFailed(); -// ================================================= - node->SetXi2(myXi2,lane); - if (iFailed == StvFitter::kBigErrs) iFailed = 0; - if (iFailed ) nErr+=1; //Fit is bad yet - if (myXi2> mKons->mXi2Hit) nErr+=10; //Fit is bad yet - if ( myXi2> mKons->mXi2Hit*kXtendFactor) { // Fit failed. Hit not accepted - if (--mNHits <3) return 1; - node->SetHit(0); hit = 0; nFitLeft--; -// No hit anymore. Fit = Prediction - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - node->SetFit(node->mPP[lane],node->mPE[lane],lane); - break; - } - iFailed = fitt->Update(); if (iFailed) nErr+=100; - nFitLeft++; kase|=kLeft; - node->mFP[2] = node->mFP[lane]; - node->mFE[2] = node->mFE[lane]; - - break; - } - - default: assert(0 && "Wrong Case2"); - - }//end 2nd switch -// if (node->GetType()==StvNode::kDcaNode) { -// printf("DCA2nd lane=%d err=%g\n",lane,sqrt(node->mFE[lane].mPP)); -// } - - if (!mode) continue; - - switch (kase) {// 3rd switch,JOIN - - case kNull: // No fits no Hit - case kRite: // Rite fits only, no Hit -// No hit. No own ifo yet. Get everything from opposite fit - { - assert(node->mFE[jane].mHH>0); - assert(node->mFE[jane].mZZ>0); - node->SetFit(node->mFP[jane],node->mFE[jane],2); - break; - } - - case kLeft: // Left fits only, no Hit -// No hit. No own info yet. Get everything from opposite fit - { - node->SetFit(node->mFP[lane],node->mFE[lane],2); - break; - } - - default: - { - assert(node->mPE[lane].mHH>0); - assert(node->mPE[lane].mZZ>0); - assert(node->mPE[jane].mHH>0); - assert(node->mPE[jane].mZZ>0); - fitt->Set(node->mPP+lane ,node->mPE+lane - ,node->mPP+jane ,node->mPE+jane - ,node->mFP+2 ,node->mFE+2 ); - node->SetXi2(3e33,2); - myXi2 = fitt->Xi2(); iFailed = fitt->IsFailed(); -// ============================================== - node->SetXi2(myXi2/5*2,3); - if (iFailed ) nErr+=1000; - if (myXi2 > mKons->mXi2Joi) nErr+=10000; - iFailed = fitt->Update(); - if (iFailed) nErr+=100000; - if (myXi2 > mKons->mXi2Joi*kXtendFactor || iFailed>0) { //Joining is impossible. Stop joining - mode = 0; //No more joinings - node->SetFit(node->mFP[lane],node->mFE[lane],2); - break; - } - myXi2 = fitt->GetXi2(); - if (!hit) break; - - -// Fit hit to join data - StvNodePars myPars(node->mFP[2]); - StvFitErrs myErrs(node->mFE[2]); - assert(node->mFE[2].mHH>0); - assert(node->mFE[2].mZZ>0); - - fitt->Set(&myPars,&myErrs,node->mFP+2,node->mFE+2); - fitt->Prep(); - - myXi2 = fitt->Xi2(hit); iFailed = fitt->IsFailed(); -// ================================================= - if (iFailed== StvFitter::kBigErrs) iFailed=0; - node->SetXi2(myXi2,2); - if (iFailed ) nErr+=1000000; //Fit is bad yet - if (myXi2> mKons->mXi2Hit) nErr+=10000000; //Fit is bad yet - if (myXi2> mKons->mXi2Hit*kXtendFactor) { // Fit failed. Hit not accepted - node->SetHit(0); hit = 0; nFitLeft--; mNHits--; -// No hit anymore. Fit = Prediction - node->SetFit(myPars,myErrs,2); - break; - } - iFailed = fitt->Update(); if (iFailed) nErr+=100000000; - break; - } - - }//End 3rd case -// if (node->GetType()==StvNode::kDcaNode) { -// printf("DCA3rd lane=%d err=%g\n",2,sqrt(node->mFE[2].mPP)); -// } - - nFitRite-= wasFitted; - assert(node->mFE[lane].mHH>0); - assert(node->mFE[lane].mZZ>0); - - - }//endMainLoop - - return -nErr; -} -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Refit(StvTrack *tk, int idir) -{ -static int nCall=0;nCall++; -static const double kEps = 1.e-2,kEPS=1e-1; - - int ans=0,anz=0,lane = 1; - int& nHits = NHits(); - nHits = tk->GetNHits(); - int nBegHits = nHits; - int nRepair =(nHits-5)*0.1; - int state = 0; - StvNode *tstNode = (idir)? tk->front(): tk->back(); - int nIters = 0,nDrops=0; - for (int repair=0;repair<=nRepair;repair++) { //Repair loop - int converged = 0; - for (int refIt=0; refIt<10; refIt++) { //Fit iters - nIters++; - ans = Refit(tk,idir,lane,1); -// ================================== - nHits=NHits(); - if (nHits < mKons->mMinHits) break; - if (ans>0) break; //Very bad - - StvNodePars lstPars(tstNode->GetFP()); //Remeber params to compare after refit - anz = Refit(tk,1-idir,1-lane,1); -// ========================================== - nHits=NHits(); - if (nHits < mKons->mMinHits) break; - if (anz>0) break; - - double dif = lstPars.diff(tstNode->GetFP(),tstNode->GetFE()); - double eps = (ans || anz)? kEPS:kEps; - if ( dif < eps) { //Fit converged - converged = 1; break; } - - }// End Fit iters - - state = (ans!=0) + 10*((anz!=0) + 10*((!converged) - + 10*((tk->GetXi2()>mKons->mXi2Trk)+10*(nHits < mKons->mMinHits)))); - if (!state) break; - if (nHits < mKons->mMinHits) break; - StvNode *badNode=tk->GetNode(StvTrack::kMaxXi2); -// StvNode *badNode=tk->GetMaxKnnNode(); - if (!badNode) break; - badNode->SetHit(0); nDrops++; - nHits--; if (nHits < mKons->mMinHits) { state = 1000000; break;} - }//End Repair loop - - - if (ans<=0) state &= (-2); - if (anz<=0) state &= (-4); - - nHits = tk->GetNHits(); - nDrops = nBegHits-nHits; - return state; - -} - -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Propagate(StvNode *node,StvNode *preNode,int dir,int lane) -{ -static int nCall=0; nCall++; -static const char* PropagateHelix = gSystem->Getenv("PropagateHelix"); -StvDebug::Break(nCall); - StvFitDers derFit; - - StvNode *innNode=0,*outNode=0; - if (innNode){}; if (outNode){}; - if (!dir) {innNode = node; outNode=preNode;} - else {outNode = node; innNode=preNode;} - - double saveCurv = node->mFP[lane]._curv; - node->mFP[lane]._curv = (2*saveCurv+preNode->mFP[lane]._curv)/3; - -double dS=0; -if (PropagateHelix) //Propagate with THelixTrack ????? HACK -{ - THelixTrack myHlx; - preNode->mFP[lane].get(&myHlx); - const StvNodePars &prePars = preNode->mFP[lane]; - assert(preNode->mFE[lane].mHH>0); - const StvFitErrs &preErrs = preNode->mFE[lane]; - prePars.get(&myHlx); - preErrs.Get(&myHlx); - double Xnode[3]; - if (node->mHit) { TCL::ucopy(node->mHit->x(),Xnode,3);} - else { TCL::ucopy(node->mXDive ,Xnode,3);} - - double dS = myHlx.Path(Xnode); - StvHlxDers derHlx; -// reset ELossData for may be new momentum - innNode->ResetELoss(preNode->mFP[lane],dir); - const StvELossTrak *el = innNode->GetELoss(); - double dP = 0; - if (el) {//account energy loss - double P = sqrt(prePars.getP2()); - dP = el->PLoss(P)*(-dS); - } - if (dP > kMaxCorr) dP = kMaxCorr; - if (dP <-kMaxCorr) dP =-kMaxCorr; - double rho = prePars._curv; - double dRho = -rho*(dP); - myHlx.Set(rho+dRho/3); - dS = myHlx.Path(Xnode); - myHlx.Move(dS,derHlx); - myHlx.Set(rho+dRho); - node->mPP[lane].set(&myHlx,node->GetHz()); - node->mPE[lane].Set(&myHlx,node->GetHz()); - node->mPE[lane].Recov(); - node->mPE[lane].Add(el,node->mPP[lane],dS); - node->mPP[lane].convert(derFit,derHlx); - innNode->SetDer(derFit,lane); - - } -else - { - StvNodePars pars = preNode->mFP[lane]; - double p = pars.getP(); - - const StvELossTrak *el = innNode->GetELoss(); - double dPP = 0,dPdP0=0; - if (el) { - innNode->ResetELoss(preNode->mFP[lane],dir); - dPP = el->PLoss(p)*(el->TotLen())/p; - if (dPP > kMaxCorr) dPP = kMaxCorr; - dPP/=el->TotLen(); - } - - double Xnode[3]; - if (node->mHit) { TCL::ucopy(node->mHit->x(),Xnode,3);} - else { TCL::ucopy(node->mXDive ,Xnode,3);} - - dS = pars.move(Xnode,dPP,dir); - if ((dS>0)!=(dir>0)) { - pars = preNode->mFP[lane]; - dS = pars.move(node->mXDive,dPP,dir); - } - -//assert((dS>0)==(dir>0)); - node->mPP[lane] = pars; - - pars.Deriv(dS,derFit); - if (el) { - dPdP0 = el->dPLossdP0(p); - if (fabs(dPdP0)>0) pars.Deriv(dS,dPdP0,derFit); - } - StvFitErrs &nowErrs = node->mPE[lane]; - const StvFitErrs &preErrs = preNode->mFE[lane]; -assert(preErrs.mHH>0); -assert(preErrs.mZZ>0); - nowErrs = preErrs*derFit; -assert(nowErrs.mHH>0); -assert(preErrs.mZZ>0); - nowErrs.Add(el,pars,dS); -assert(nowErrs.mHH>0); -assert(preErrs.mZZ>0); - innNode->SetDer(derFit,lane); - } - - node->mFP[lane]._curv = saveCurv; - - return 0; - -} -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Fit(const StvTrack *trak,const StvHit *vtx,StvNode *node) -{ -static int nCall = 0; nCall++; -static StvToolkit *kit = StvToolkit::Inst(); -static StvFitter *fitt = StvFitter::Inst(); -enum {kDeltaZ = 100};//?????? - - const StvNode *lastNode = trak->GetNode(StvTrack::kDcaPoint); - if (!lastNode) return 1; - if (fabs(vtx->x()[2]-lastNode->GetFP()._z) > kDeltaZ) return 2; - THelixTrack th; - lastNode->GetFP().get(&th); - lastNode->GetFE().Get(&th); - const float *h = vtx->x(); - double d[3]={h[0],h[1],h[2]}; - double len = th.Path(d); - double x[3]; - th.Eval(len,x); - mDca3 = DIST2(d,x); - StvFitDers derivFit; - StvHlxDers derivHlx; - if (node) {th.Move(len,derivHlx);} else {th.Move(len);} - double Hz = kit->GetHz(th.Pos()); - StvNodePars par[2]; par[0].set(&th,Hz); - StvFitErrs err[2]; err[0].Set(&th,Hz); - fitt->Set(par+0,err+0,par+1,err+1); - fitt->Prep(); - mXi2 = fitt->Xi2(vtx); - if (!node) return 0; - - fitt->Update(); - assert(err[1].mHH>0); - assert(err[1].mZZ>0); - - - mXi2 = fitt->GetXi2(); - node->SetPre(par[0],err[0],0); - node->SetFit(par[1],err[1],0); - par[1].convert(derivFit,derivHlx); - node->SetDer(derivFit,0); - return 0; -} -//_____________________________________________________________________________ -THelixTrack* StvKalmanTrackFitter::GetHelix() const {return mHelx;} - -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Helix(StvTrack *trak,int mode) -{ -static int nCall=0;nCall++; -enum {kUseErrs=1, kUpdate=2, kPrint=4}; -// mode &1 use err -// mode &2 = update track -// mode &4 = print - - if (!mode ) mode = kPrint; - mXi2 = 0; - if (!mHelx) mHelx = new THelixFitter; - mHelx->Clear(); - StvFitDers Fstv; - StvHlxDers Fhlx; - THelixFitter& hlx = *mHelx; - StvNode *node=0,*preNode=0; if (preNode){}; - for (StvNodeIter it=trak->begin();it!=trak->end(); ++it) { - node = *it; - const StvHit *hit= node->GetHit(); - if (!hit) continue; - hlx.Add(hit->x()[0],hit->x()[1],hit->x()[2]); - if(mode&kUseErrs) { //Account errors - double cos2li = node->GetFP()._tanl; cos2li = (1+cos2li*cos2li); - const double *rr = node->GetHE(); - assert(rr[0]>0);assert(rr[2]>0);assert(rr[0]*rr[2]>rr[1]*rr[1]); - hlx.AddErr( rr[0],rr[2]*cos2li); - } - } - mXi2 = 3e33; if (hlx.Used()<3) return 1; - mXi2 =hlx.Fit(); - if(mode&kUseErrs) { hlx.MakeErrs();} - double dL = hlx.Path(trak->front()->GetFP().P); - hlx.Move(dL); - if ((mode&(kUpdate|kPrint))==0) return 0; - node=0; - double dHit[3],tstXi2=0,myXi2=0; - -// Loop for Print,compare & update - double totLen=0; - THelixTrack myHlx(hlx); - int iNode = -1; - for (StvNodeIter it=trak->begin();it!=trak->end(); ++it) { - iNode++;preNode=node; node = *it; - StvNodePars sFP = node->GetFP(0); - const StvHit *hit = node->GetHit(); - const float *hix = (hit)? hit->x():0; - - const double *X = node->mXDive; - if (hit) {for (int i=0;i<3;i++) {dHit[i]=hix[i];};X = dHit;} - double dS = myHlx.Path(X); myHlx.Move(dS,Fhlx); - totLen+=dS; - StvNodePars hFP; hFP.set(&myHlx,sFP._hz); - hFP.convert(Fstv,Fhlx); -//?? StvFitErrs sFE = node->GetFE(2); - StvFitErrs hFE; hFE.Set(&myHlx,sFP._hz); - - - myXi2 = 6e6; - if (hix) {//Hit is there. Calculate Xi2i etc... - StvNodePars iFP(hFP); iFP._x=hix[0];iFP._y=hix[1];iFP._z=hix[2]; - StvFitPars fp = hFP-iFP; - - const double *hRR = node->GetHE(); - myXi2 = fp.mH /(hFE.mHH+hRR[0]) *fp.mH; - myXi2+= fp.mZ /(hFE.mZZ+hRR[2]) *fp.mZ; - - tstXi2 += myXi2; - } - - if (mode&kUpdate) { //Update - node->mLen = totLen; - node->SetPre(hFP,hFE,0); - node->SetFit(hFP,hFE,0); - node->SetXi2(myXi2,0); - } - - if (mode&kPrint) { //Print Helix - printf("HelixPars(%g) Xi2i=%g ",totLen,myXi2); hFP.print(); - if (mode&1) hFE.Print("HelixErrs"); - } - - }//end of hit loop - - tstXi2/=hlx.Ndf();if (tstXi2){}; - double qwe = mXi2; if (qwe){};//only to see it in gdb - - - return 0; -} -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Check(StvTrack *trak) -{ -static int nCall = 0; nCall++; - if (trak->size()<10) return 0; - Helix(trak,1); - StvNode *node = trak->GetNode(StvTrack::kFirstPoint); -// StvNode *node = trak->front(); - double s = mHelx->Path(node->GetFP().P); - mHelx->Move(s); - const StvFitErrs &fe = node->GetFE(); - StvFitErrs my; - my.Set(mHelx,fe.mHz); - - -#define OLEG(a,b) (2*fabs(a-b)/(fabs(a)+fabs(b)+1e-11)) - int ierr = 0; - for (int i=0,li=0;i< 5;li+=++i) { - if (OLEG(my[li+i],fe[li+i])<0.3) continue; - ierr = ierr*10+i+1; - printf(" Err.%d = %g != %g\n",i,fe[li+i],my[li+i]); - }; -// assert(!ierr); - return ierr; -} -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Check(const StvNodePars &parA,const StvFitErrs &errA, - const StvNodePars &parB,const StvFitErrs &errB) -{ - THelixTrack helx; - parA.get(&helx); - errA.Get(&helx); - double s = helx.Path(parB.P); - helx.Move(s); - StvFitErrs my; - my.Set(&helx,errB.mHz); - int ierr = 0; - for (int i=0,li=0;i< 5;li+=++i) { - if (OLEG(my[li+i],errB[li+i])<0.1) continue; - ierr = ierr*10+i+1; - printf(" Err.%d = %g != %g\n",i,errB[li+i],my[li+i]); - }; - int rxy = parB.getRxy(); - printf("%3d Propagate HHold=%g HHnow=%g(%g) len=%g\n",rxy,errA.mHH,errB.mHH,my.mHH,s); - printf(" ZZold=%g ZZnow=%g(%g) \n", errA.mZZ,errB.mZZ,my.mZZ ); - -// assert(!ierr); - return ierr; -} - -//_____________________________________________________________________________ -int StvKalmanTrackFitter::Clean(StvTrack *trak) -{ - int nErr = 0; - - for (StvNodeIter it=trak->begin();it!=trak->end();++it) - { - int fail = 0; - StvNode *node = *it; - StvHit *hit = node->GetHit(); - if (!hit) continue; - const StvNodePars &np = node->GetFP(); - if (fabs(np._ptin) > mKons->mMaxPti) fail+= 1; - if (fabs(np._curv) > mKons->mMaxCurv) fail+= 2; - if ( np.diff(hit->x())> mKons->mMaxRes) fail+= 4; - if (!fail) continue; - node->SetXi2(3e33);node->SetHit(0); nErr++; - } - return nErr; -} - diff --git a/StRoot/Stv/StvKalmanTrackFitter.h b/StRoot/Stv/StvKalmanTrackFitter.h deleted file mode 100644 index a20fd4252ce..00000000000 --- a/StRoot/Stv/StvKalmanTrackFitter.h +++ /dev/null @@ -1,42 +0,0 @@ -/// \File StvKalmanTrackFitter.h -/// \author Victor Perev 9/2010 -#ifndef StvKalmanTrackFitter_HH -#define StvKalmanTrackFitter_HH -#include "StvTrackFitter.h" - -/// \class StvKalmanTrackFitter -class StvTrack; -class StvNode; -class THelixTrack; -class THelixFitter; -class StvKonst_st; -class StvKalmanTrackFitter : public StvTrackFitter -{ -public: - StvKalmanTrackFitter(); - void SetCons(const StvKonst_st* kons); - virtual ~StvKalmanTrackFitter(){;} - virtual int Refit(StvTrack *trak,int idir); - virtual int Refit(StvTrack *trak,int dir,int lane,int mode=1); - virtual int Fit(const StvTrack *trak,const StvHit *vtx,StvNode *node); - int Propagate(StvNode *node,StvNode *preNode,int dir,int lane); - virtual int Helix(StvTrack *trak,int mode); - virtual int Clean(StvTrack *trak); - virtual int Check(StvTrack *trak); - virtual int Check(const StvNodePars &parA,const StvFitErrs &errA, - const StvNodePars &parB,const StvFitErrs &errB); - virtual THelixTrack* GetHelix() const; - virtual void Clear(const char *opt=""); - - -protected: -char mBeg[1]; -const StvKonst_st *mKons; -THelixFitter *mHelx; -char mEnd[1]; - -ClassDef(StvKalmanTrackFitter,0); -}; - - -#endif diff --git a/StRoot/Stv/StvNode.cxx b/StRoot/Stv/StvNode.cxx deleted file mode 100644 index 47843d40081..00000000000 --- a/StRoot/Stv/StvNode.cxx +++ /dev/null @@ -1,230 +0,0 @@ -//StvKalmanTrack.cxx -/* - * $Id: StvNode.cxx,v 1.38 2016/12/09 21:21:41 perev Exp $ - * - * /author Victor Perev - */ - -#include -#include -#include -#include "TString.h" - -#include "Stv/StvToolkit.h" -#include "Stv/StvNode.h" -#include "Stv/StvHit.h" -#include "StvUtil/StvDebug.h" -#include "StvUtil/StvELossTrak.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - - -//______________________________________________________________________________ -void StvNode::reset() -{ -static int myCount=0; - assert(mBeg[0]=='@'); - memset(mBeg,0,mEnd-mBeg+1); - mId = ++myCount; - StvDebug::Break(mId); - mXi2[0] = 3e33;mXi2[1] = 3e33;mXi2[2] = 3e33; -} -//______________________________________________________________________________ -void StvNode::unset() -{ -static StvToolkit *kit = StvToolkit::Inst(); - if (mELoss) kit->FreeELossTrak(mELoss); - mELoss = 0; - assert(mBeg[0]!='@'); - memset(mBeg,'@',mEnd-mBeg+1); -} -//______________________________________________________________________________ -StvNode &StvNode::operator=(const StvNode &from) -{ -static StvToolkit* kit=StvToolkit::Inst(); - memcpy(mBeg,from.mBeg,mEnd-mBeg+1); - if (mELoss) { //Recreate ELossTrak - mELoss = kit->GetELossTrak(); - *mELoss = *from.mELoss; - } - return *this; -} - -//______________________________________________________________________________ -void StvNode::SetPre(StvNodePars &par,StvFitErrs &err,int dir) -{ - assert(err.mHH>0); - mPP[dir]=par;mPE[dir]=err; - mFP[dir]=par;mFE[dir]=err; - mFP[ 2]=par;mFE[ 2]=err; -} -//______________________________________________________________________________ -void StvNode::SetFit(StvNodePars &par,StvFitErrs &err,int dir) -{ - assert(err.mHH>0); - mFP[dir]=par;mFE[dir]=err; - if (dir==2) return; - mFP[2]=par;mFE[2]=err; -} -//______________________________________________________________________________ -StDetectorId StvNode::GetDetId() const -{ - const StHitPlane *hp = GetHitPlane(); if (!hp) return kUnknownId; - return hp->GetDetId(); -} -//________________________________________________________________________________ -double StvNode::GetTime() const -{ - return 0; -} -//________________________________________________________________________________ -void StvNode::Print(const char *opt) const -{ -static const char *txt = "X Y Z Pt Cu H R E Ep L Ps Tl P[ E[ Pa "; -static const char *hhh = "x y z r e "; - if (!opt || !opt[0]) opt = "_"; - TString myOpt(opt);myOpt+=" "; - int dir = myOpt.Index("="); - dir = (dir<0)? 2:myOpt[dir+1]-'0'; - int djr = dir; if (djr>3) djr-=4; - double val,err[2]; - const StvNodePars &fp= mFP[dir]; - const StvFitErrs &fe= mFE[dir]; - int dkr = (dir<2)? dir:0; - const StvFitErrs &pe= mPE[dkr]; -//const StvNodePars &pp= mPP[dkr]; - StvHit *hit = GetHit(); - TString ts; - if (mHitPlane) ts = "h"; - if (hit) ts = "H"; - if (GetType()==kDcaNode ) ts='D'; - if (GetType()==kPrimNode) ts='P'; - - printf("%p(%s)",(void*)this,ts.Data()); - printf("\t%s=%g","Xi2",GetXi2(djr)); - int iopt=0; - const char *myopt = myOpt.Data(); char*e; - for (int i=0;txt[i];i++) { - if (txt[i]==' ') continue; - int nc = 2; if (txt[i+1]=='[') nc = 4; - TString ts(txt+i,nc); - err[0]=-999;val=-999; - const char *cal = 0; - if ((iopt=myOpt.Index(ts))<0) continue; - int idx =(txt[i+1]=='[') ? strtol(myopt+iopt+2,&e,10):0; - - {//Single letter request - if (ts=="X ") {val = fp._x;} - else if (ts=="Y ") {val = fp._y;} - else if (ts=="Z ") {val = fp._z;} - else if (ts=="R ") {val = fp.getRxy();} - else if (ts=="Ps") {val = fp._psi ;} - else if (ts=="Tl") {val = fp._tanl ;} - else if (ts=="Pt") {val = fp.getPt() ;} - else if (ts=="Cu") {val = fp._curv;} - else if (ts=="E ") {err[0] = sqrt(fe.mHH); err[1] = sqrt(fe.mZZ);} - else if (ts=="Ep") {err[0] = sqrt(pe.mHH); err[1] = sqrt(pe.mZZ);} - else if (ts=="L ") {val = GetLen();} - else if (ts=="H ") {val = fp._hz;} - else if (ts=="P[") {val = fp[idx];} - else if (ts=="E[") {val = fe[idx];} - else if (ts=="Pa") {cal = (mHitPlane)? mHitPlane->GetPath():"";} - if (!cal && val==-999 && err[0]==-999) continue; - printf("\t%s=",ts.Data()); - if (cal) { printf("%s ",cal);} - if (fabs(val+999)>1e-6) { printf("%g",val);} - if (err[0]>-999) { printf("HH(%7.2g) ZZ(%7.2g)",err[0],err[1]);} - } - }//end for i - - if (hit) { - printf(" hit(%p) ",(void*)hit); - for (int i=0; hhh[i];i++) { - err[0]=-999;val=-999; - if (hhh[i]==' ') continue; - if ((iopt=myOpt.Index(TString(hhh+i,2)))<0) continue; - if (hhh[i+1]==' ') {//Single letter request - if (hhh[i]=='r') { val = hit->getRxy();} - else if (hhh[i]=='e') {err[0] = sqrt(mHrr[0]); err[1] = sqrt(mHrr[2]);} - else {val = hit->x()[i/2];} - if (fabs(val+999)>1e-6) {printf("\th%c=%g",hhh[i],val);} - if (err[0]>-999) {printf("\thh=%7.2g zz=%7.2g",err[0],err[1]);} - } else if (txt[i+1]=='[') {// now print by index - - int idx = strtol(myopt+i+2,&e,10); - TString tnam(myopt+i,e-(myopt+i)+1); - if (txt[i]=='e') {val = mHrr[idx];} - printf("\t%s=%g",tnam.Data(),val); - } - } - } - - printf("\n"); - return; -} -//________________________________________________________________________________ -void StvNode::SetDer(const StvFitDers &der, int dir) -{ - mDer[ dir]=der; - mDer[1-dir]=der; - mDer[1-dir].Reverse(); -} -//________________________________________________________________________________ -void StvNode::SetHit(StvHit *hit) -{ - mHit = hit; - if (!mHit) return; - assert(!mHit->isUsed()); -} -//________________________________________________________________________________ -void StvNode::SetMem(StvHit *hit[2],double xi2[2]) -{ - memcpy(memHit,hit,sizeof(memHit)); - memXi2[0]=xi2[0];memXi2[1]=xi2[1]; -} -//________________________________________________________________________________ -void StvNode::UpdateDca() -{ - const StvNodePars &P = mFP[2]; - double dL = -( P._x*P._cosCA+P._y*P._sinCA) - /(1+(-P._x*P._sinCA+P._y*P._cosCA)*P._curv); - if (fabs(dL)<1e-6) return; - THelixTrack hlx; - mFP[2].get(&hlx); - mFE[2].Get(&hlx); - dL = hlx.Path(0.,0.); - hlx.Move(dL); - mFP[2].set(&hlx,mFP[2]._hz); - mFE[2].Set(&hlx,mFP[2]._hz); -} -//________________________________________________________________________________ -int StvNode::Check(const char *tit, int dirs) const -{ - if (!tit) tit=""; - int nerr=0,ans; - for (int k=0;k<5;k++) { - TString ts; - if (tit[0]) {ts=tit; ts+="/par["; ts+=k;ts+="]"; } - int itst = (((1&k)+1)&dirs); - if (k==4) itst = 1; - if (!itst) continue; - ans = mPP[k].check(ts); if (ans) nerr++; - ans = mPE[k].Check(ts); if (ans) nerr++; - } - return nerr; -} -//________________________________________________________________________________ -int StvNode::ResetELoss(const StvNodePars &pars,int dir) -{ -static const double kSmaP =0.01; -static const double kBigP =3 ,kSmaDiff=1e-2; - - if (!mELoss) return 0; - double p = pars.getP(); - if (p>kBigP) p=kBigP; - if (pP(); - if (fabs(myP-p)Update(dir,p); - return 0; -} - diff --git a/StRoot/Stv/StvNode.h b/StRoot/Stv/StvNode.h deleted file mode 100644 index 8f32af97bba..00000000000 --- a/StRoot/Stv/StvNode.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef StvNode_H -#define StvNode_H 1 -#define STI_NODE_DEBUG - -#include -#include -#include -#include "StvUtil/StvNodePars.h" -#include "StEvent/StEnumerations.h" - -class StvHit; -class StHitPlane; -class StvELossTrak; - - -/*! \class StvNode - Work class used to handle Kalman filter information while - constructing track nodes. A node may or may not own a hit - depending whether it lies on a measurement layer where a hit - was found. A node can have 0, 1, or many children. - Nodes are nominally sequenced outside-in i.e. with decreasing - radius (or independent variable). The order can however be reversed. - In anycase, the order should always be monotonically increasing - or decreasing. - \author Claude A Pruneau -*/ -class StvNode -{ -public: -friend class StvTrack; -enum ENodeType {kRegNode=0,kDcaNode=1,kPrimNode=2}; - -public: - StvNode(){mBeg[0]='@';} - StvNode(const StvNode &node); - virtual ~StvNode(){mId=-1;}; - StvNode &operator=(const StvNode &from); - /// Resets the node to a "null" un-used state - void reset(); - void unset(); - const StvNodePars &GetFP() const {return mFP[2];} - const StvFitErrs &GetFE() const {return mFE[2];} - - StvNodePars &GetPP(int dir) {return mPP[dir];} - StvFitErrs &GetPE(int dir) {return mPE[dir];} - StvNodePars &GetFP(int dir) {return mFP[dir];} - StvFitErrs &GetFE(int dir) {return mFE[dir];} - const StvNodePars &GetFP(int dir) const {return mFP[dir];} - const double *GetHE() const {return mHrr ;} - void SetHE(const double he[3]) - {mHrr[0]=he[0]; mHrr[1]=he[1];mHrr[2]=he[2];} - - /// Extract state information from this node in TPT representation. - void GetGlobalTpt (float x[6],float e[15]); - - /// Calculates and returns the momentum and error of the track at this node. The momentum is - /// in the local reference frame of this node. - void GetMomentum(double p[3], double e[6]=0) const; - /// Calculates and returns the Z mag field in the current point. - /// units: PGeV = Hz*Radcurv_in_CM - double GetHz() const {return mFP[2]._hz;} - double GetTime() const; - int IsFitted(int dir) const { return (mHit && mXi2[dir]<1000);} - - StvHit *GetHit() const { return mHit;} - void SetHit(StvHit *hit); - void SetMem(StvHit *hit[2],double xi2[2]); - const StHitPlane *GetHitPlane() const { return mHitPlane ;} - void SetHitPlane(const StHitPlane *hitPlane) { mHitPlane=hitPlane;} - void SetELoss(StvELossTrak *el,int ) { mELoss=el ;} - const StvELossTrak *GetELoss() const { return mELoss ;} - - double GetXi2(int dir=2) const { return mXi2[dir] ;} - double GetLen() const { return mLen ;} - void SetXi2(double Xi2,int dir=2) { mXi2[dir]=Xi2; mXi2[2]=Xi2;} - void SetPre(StvNodePars &par,StvFitErrs &err,int dir); - void SetFit(StvNodePars &par,StvFitErrs &err,int dir); - void SetDer(const StvFitDers &der, int dir); - void SetXDive(const double xdive[3]) {memcpy(mXDive,xdive,sizeof(mXDive));} - int ResetELoss(const StvNodePars &pars,int dir); - StvNode::ENodeType GetType() const {return (StvNode::ENodeType)mType;} - void SetType(StvNode::ENodeType ty) {mType =(char)ty;} -StDetectorId GetDetId() const; -void UpdateDca(); - int Check(const char *tit="",int dirs=3) const; -void Print(const char *opt) const; - private: - - public: - - char mBeg[1]; - char mType; //0=regular,1=dca,2=primary - double mXDive[3]; // xyz from Diver -const StHitPlane *mHitPlane; -StvHit *mHit; -StvHit *memHit[2]; - float memXi2[2]; - -/// Z mag field in units PGev = Hz*Rcm - mutable double mHz; -/// indices of arrays 0=moving in, 1=moving out,2=join result of in & out - StvNodePars mFP[4]; // Fitted Parameters - StvNodePars mPP[2]; // Predicted Parameters+last id for helix - StvFitErrs mFE[4]; // Fitted errors - StvFitErrs mPE[2]; // Predicted errors - StvFitDers mDer[2]; // Derivative matrix 0=from outer to this; 1=from this to outer - double mHrr[3]; // Hit errors in DCA frame - float mXi2[4]; // Xi2 of fit to hit,join,helix - float mLen; // Length - StvELossTrak *mELoss; //EnergyLoss&MCS from the upper node - char mEnd[1]; -public: - int mId; //for debug only -}; - -#endif - diff --git a/StRoot/Stv/StvSeedFinder.cxx b/StRoot/Stv/StvSeedFinder.cxx deleted file mode 100644 index 5be665176c6..00000000000 --- a/StRoot/Stv/StvSeedFinder.cxx +++ /dev/null @@ -1,234 +0,0 @@ -#include "StvSeedFinder.h" -#include "TSystem.h" -#include "TVector3.h" -#include "TSystem.h" -#include "StvUtil/StvDebug.h" -#include "StvDraw.h" -#include "StvTrack.h" -#include "StvNode.h" -#include "StvHit.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "vector" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StvUtil/StvKNNUtil.h" -#include "Stv/StvConst.h" - -//Constants for THelixFitter (Approx) -static const double kBAD_XI2cm2 = 0.9*0.9 // max Xi2 in cm**2 without errs - , kBAD_XI2 = 50 // max Xi2 (with errs) - , kBAD_RHO=0.1 // max curvature - , kMIN_Rxy=50; // minimal radius for seed hits - -ClassImp(StvSeedFinder) - -//_____________________________________________________________________________ -StvSeedFinder::StvSeedFinder(const char *name):TNamed(name,"") -{ - fDraw=0; - fMinHits = 5; - fMaxHits = 10; - fSgn = 1; - fIdTruth = 0; - SetVtx(0); -} -//_____________________________________________________________________________ -void StvSeedFinder::SetCons(const StvKonst_st *kons) -{ - fMinHits= kons->mMinSeedHits; - fMaxHits= kons->mMaxSeedHits; -} -//_____________________________________________________________________________ -void StvSeedFinder::Clear(const char*) -{ - SetVtx(0); - fSeedHits.clear(); - if(fDraw) fDraw->Clear(); -} -//_____________________________________________________________________________ -void StvSeedFinder::SetVtx(const float vtx[3]) -{ - if (vtx) { memcpy(fVtx,vtx,sizeof(fVtx)); return; } - memset(fVtx,0,sizeof(fVtx)); - fVtx[2]= 3e33; -} -//_____________________________________________________________________________ -void StvSeedFinder::Show() -{ - if (!fDraw) fDraw = NewDraw(); - StvConstHits &ch = (StvConstHits &)fSeedHits; - fDraw->Road(fHelix,ch,kGlobalTrack,10.); - fDraw->UpdateModified(); - fDraw->Wait(); -} -//_____________________________________________________________________________ -void StvSeedFinder::ShowRest(EDraw3DStyle style) -{ - if (!fDraw) fDraw = NewDraw(); - std::vector myHits; - const StVoidArr *hitArr = StTGeoProxy::Inst()->GetSeedHits(); - int nHits = hitArr->size(); - for (int iHit=0;iHitisUsed()) continue; - myHits.push_back(stiHit); - } - fDraw->Hits(myHits,style); - fDraw->UpdateModified(); - fDraw->Wait(); -} -//_____________________________________________________________________________ -void StvSeedFinder::ShowIn() -{ - if (!fDraw) fDraw = NewDraw(); - std::vector myHits; - const StVoidArr *hitArr = StTGeoProxy::Inst()->GetSeedHits(); - int nHits = hitArr->size(); - for (int iHit=0;iHitx())) continue; - myHits.push_back(stiHit); - } - fDraw->Hits(myHits,kUnusedHit); - fDraw->UpdateModified(); - fDraw->Wait(); -} -//_____________________________________________________________________________ -StvDraw *StvSeedFinder::NewDraw() -{ - StvDraw *dr = new StvDraw(); - dr->SetBkColor(kWhite); - return dr; -} - -//_____________________________________________________________________________ -const THelixTrack *StvSeedFinder::Approx() -{ -static int nCall=0; nCall++; -// Loop over nodes and collect global xyz - - fHelix.Clear(); - THelixFitter circ; - int nNode=fSeedHits.size(); - const float *fBeg = fSeedHits.front()->x(); - const float *fEnd = fSeedHits.back ()->x(); - double r2Beg = fBeg[0]*fBeg[0]+fBeg[1]*fBeg[1]; - double r2End = fEnd[0]*fEnd[0]+fEnd[1]*fEnd[1]; - if (fSgn*r2Beg < fSgn*r2End) return 0; - - for (int iNode = 0; iNodex()[0],hit->x()[1],hit->x()[2]); - } - fXi2[0] =circ.Fit(); - if (fXi2[0]>kBAD_XI2cm2) return 0; //Xi2 too bad, no updates - if (fabs(circ.GetRho()) >kBAD_RHO) return 0; //Too big curvature - - const double dBeg[3]={fBeg[0],fBeg[1],fBeg[2]}; - double l = circ.Path(dBeg); circ.Move(l); - -// Now refit with errors - for (int iNode = 0; iNodex(); - const double dx[3]={fx[0],fx[1],fx[2]}; - double l = circ.Path(dx); circ.Move(l); -// Set position for helix - fHelix.Add(dx[0],dx[1],dx[2]); -// Set position errors for helix - const StHitPlane *hp = hit->detector(); - StvHitErrCalculator* myHitErrCalc = (StvHitErrCalculator*)hp->GetHitErrCalc(); - myHitErrCalc->SetTrack(circ.Dir()); - double hRR[3]; -// const Mtx33F_t &hd = hp->GetDir(fx); -// int ans = myHitErrCalc->CalcDcaErrs(fx,hd,hRR); - int ans = myHitErrCalc->CalcDcaErrs(hit,hRR); - if (ans) {// touching case - fHelix.AddErr( 1.,1.); - } else { - double cos2l = circ.GetCos(); cos2l*=cos2l; - if (hRR[0]<1e-4) hRR[0]=1.; - fHelix.AddErr( hRR[0],hRR[2]/cos2l); - } - } - fXi2[1] =fHelix.Fit(); - if (fXi2[1]>kBAD_XI2) return 0; //Xi2 too bad, no updates - fHelix.MakeErrs(); - if (fSgn>0) { - l = fHelix.Path(dBeg); - l-= 0.1; fHelix.Move(l); - } else { - const double dEnd[3]={fEnd[0],fEnd[1],fEnd[2]}; - l = fHelix.Path(dEnd); - l+= 0.1; fHelix.Move(l); - fHelix.Backward(); - } - return &fHelix; -} -#include "StarRoot/TIdTruUtil.h" -//_____________________________________________________________________________ -void StvSeedFinder::FeedBack(const StvTrack *tk) -{ - if (StvDebug::Debug()<2) return; - TIdTruUtil idu; - - for (int ih=0;ih<(int)fSeedHits.size();ih++) { - auto *hit = fSeedHits[ih]; - idu.Add(hit->idTru()); - } - double qua = idu.GetQua()*100; - if (!idu.GetIdTru()) qua=0; - StvDebug::Count("SeedAllQua",qua); - if (!tk) { // - StvDebug::Count("SeedBadXi2:Xi2E",fXi2[1],fXi2[0]); - StvDebug::Count("SeedBadQua",qua); - - } else { - StvDebug::Count("GooXi2:Xi2E",fXi2[1],fXi2[0]); - - StvDebug::Count("SeedGooQua",qua); - double tqua = tk->GetQua()*100; - StvDebug::Count("GlobGooQua",tqua); - StvDebug::Count("GlobGooQua::SeedGooQua",qua,tqua); - const StvNode *node = tk->GetNode(StvTrack::kFirstPoint); - double P[3]; - node->GetFP().getMom(P); - - double eta = TVector3(P).Eta(); - int nHits = tk->GetNHits(kPxlId); - nHits += tk->GetNHits(kIstId); - nHits += tk->GetNHits(kSstId); - StvDebug::Count("GoodEta",eta); - if (nHits>=2) StvDebug::Count("HftEta",eta); - } -} - -//_____________________________________________________________________________ -void StvSeedFinders::Clear() -{ - for (int i=0;i<(int)size();i++) {(*this)[i]->Clear();} -} - -//_____________________________________________________________________________ -void StvSeedFinders::Reset() -{ - for (int i=0;i<(int)size();i++) {(*this)[i]->Reset();} -} -//_____________________________________________________________________________ -void StvSeedFinders::SetCons(const StvKonst_st *kons) -{ - for (int i=0;i<(int)size();i++) {(*this)[i]->SetCons(kons);} -} -//_____________________________________________________________________________ -void StvSeedFinders::SetVtx(const float vtx[3]) -{ - for (int i=0;i<(int)size();i++) {(*this)[i]->SetVtx(vtx);} -} - -//_____________________________________________________________________________ -void StvSeedFinders::Add(StvSeedFinder *sf) -{ - push_back(sf); -} - - diff --git a/StRoot/Stv/StvSeedFinder.h b/StRoot/Stv/StvSeedFinder.h deleted file mode 100644 index 98dbb8caa30..00000000000 --- a/StRoot/Stv/StvSeedFinder.h +++ /dev/null @@ -1,81 +0,0 @@ -/// \File StvSeedFinder.h -/// \author Victor Perev 01/2010 -#ifndef StvSeedFinder_HH -#define StvSeedFinder_HH -#include -#include -#include "THelixTrack.h" -#include "TNamed.h" -#include "StvStl.h" -#include "StDraw3D.h" - -#ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -//#define KNNDEBUG 1 - - -/// \class StvSeedFinder -class StvDraw; -class StvHit; -class StvTrack; -class StvKonst_st; - - -class THelixTrack; -class StvSeedFinder : public TNamed -{ -public: - StvSeedFinder(const char *name); - virtual ~StvSeedFinder(){;} - void SetCons(const StvKonst_st *kons); - virtual const THelixTrack *NextSeed() =0; - virtual void Reset() =0; - virtual void Clear(const char* opt=""); - virtual int Again(int){return 0;} - virtual void FeedBack(const StvTrack *tk); - virtual void SetSgn(int sgn=1){fSgn = sgn;} - virtual void SetVtx(const float vtx[3]); - void SetIdTruth() { fIdTruth = 1; } - virtual int IfVtx() const {return fVtx[2]<1e11;} - -virtual const StvHits *GetHits() const {return &fSeedHits;} - - virtual void Show(); - virtual void ShowRest(EDraw3DStyle style = kUnusedHit); - virtual void ShowIn(); - virtual int Reject(const float *x) {return 0;} - - double GetXi2(int i=1) const {return fXi2[i];} - void KNNMiMax(double &mi,double &ma); - - -static StvDraw *NewDraw(); -protected: - const THelixTrack* Approx(); -protected: -int fMinHits; //Min number of hits accepted -int fMaxHits; //Max number hits fo seed -int fSgn; -int fIdTruth; -StvHits fSeedHits; -THelixFitter fHelix; -StvDraw *fDraw; -float fVtx[3]; //Vertex if already known -double fXi2[2]; //Xi2[0] without hit errs,[1] with hit errs -ClassDef(StvSeedFinder,0); -}; - -class StvSeedFinders : public std::vector -{ public: - void Clear(); - void Reset(); - void Add(StvSeedFinder *sf); - void SetCons(const StvKonst_st *kons); - void SetVtx(const float vtx[3]); -}; - - -#endif diff --git a/StRoot/Stv/StvStl.cxx b/StRoot/Stv/StvStl.cxx deleted file mode 100644 index f79ad9c3a73..00000000000 --- a/StRoot/Stv/StvStl.cxx +++ /dev/null @@ -1,29 +0,0 @@ -// $Id: StvStl.cxx,v 1.6 2015/12/12 01:58:25 perev Exp $ -// -// -// Class StvStl some stl containers for Stv objects -// ------------------ -#include -#include "StvStl.h" -#include "StvHit.h" -//_____________________________________________________________________________ -StvPoints &StvPoints::operator+=(const float add[3]) -{ push_back(add[0]); push_back(add[1]); push_back(add[2]);return *this;} -//_____________________________________________________________________________ -StvPoints &StvPoints::operator+=(const double add[3]) -{ push_back(add[0]); push_back(add[1]); push_back(add[2]);return *this;} - -//_____________________________________________________________________________ -void StvHits::Print(const char *txt) -{ - if (txt && txt[0]) printf("StvHits(%s)\n",txt); - for (int i=0;i<(int)size();i++) { - auto *stvHit = (*this)[i]; - const float *x = stvHit->x(); - double r = sqrt(x[0]*x[0]+x[1]*x[1]); - int idTru = stvHit->idTru(); - - - printf("%3d - idTru = %d Rxy=%g x=%g y=%g z=%g\n",i,idTru,r,x[0],x[1],x[2]); - } -} diff --git a/StRoot/Stv/StvStl.h b/StRoot/Stv/StvStl.h deleted file mode 100644 index 3498009732d..00000000000 --- a/StRoot/Stv/StvStl.h +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef StvStl_HH -#define StvStl_HH -#include -#include -class StvVoids : public std::vector -{ -public: -StvVoids &operator+=(void *add) {push_back(add);return *this;} -}; -class StvHit; -class StvHits : public std::vector -{ -public: -StvHits &operator+=( StvHit *add) {push_back(add);return *this;} -StvHits &operator+=(const StvHits &add); -StvHits &operator+=(const std::vector &add); -void Print(const char *txt=""); -}; -class StvConstHits : public std::vector -{ -public: -StvConstHits &operator+=(const StvHit *add) {push_back(add);return *this;} -}; - -class StvPoints : public std::vector{ -public: -StvPoints &operator+=(const float add[3]); -StvPoints &operator+=(const double add[3]); -}; - -class StvNode; -typedef std::list::iterator StvNodeIter; -typedef std::list::const_iterator StvNodeConstIter; -typedef std::list::reverse_iterator StvBakwNodeIter; -class StvNodes : public std::list{ -public: -}; -class StvTrack; -typedef std::list::iterator StvTrackIter; -typedef std::list::const_iterator StvTrackConstIter; -class StvTracks : public std::list{ -public: -}; -//_____________________________________________________________________________ -inline StvHits &StvHits::operator+=(const StvHits &add) -{ insert(end(),add.begin(),add.end()); return *this;} -//_____________________________________________________________________________ -inline StvHits &StvHits::operator+=(const std::vector &add) -{ - const StvHits &myAdd = (const StvHits &)add; - (*this)+=myAdd; - return *this; -} -#endif diff --git a/StRoot/Stv/StvTester.cxx b/StRoot/Stv/StvTester.cxx deleted file mode 100644 index ebfddc9fd99..00000000000 --- a/StRoot/Stv/StvTester.cxx +++ /dev/null @@ -1,179 +0,0 @@ -#include -#include -#include -#include "TMath.h" -#include "TMatrixD.h" -#include "TVectorD.h" -#include "TCernLib.h" -#include "TGeoManager.h" -#include "StvTester.h" -#include "StvTrack.h" -#include "StvNode.h" -#include "StvUtil/StvNodePars.h" -#include "StvHit.h" -#include "StvUtil/StvDebug.h" -#include "StvUtil/StvELossTrak.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - -StvTester *StvTester::mgTester=0; -static const double piMass=0.13956995; -static const double kAccu=1e-3; -//______________________________________________________________________________ -StvTester::StvTester(const char *name):TNamed(name,"") -{ - memset(mBeg,0,mEnd-mBeg+1); - mEl = new StvELossTrak; - assert(!mgTester); - mgTester = this; -} -//______________________________________________________________________________ -StvTester *StvTester::Inst() -{ - if (!mgTester) mgTester = new StvTester(); - return mgTester; -} -//______________________________________________________________________________ -int StvTester::TestIt(const char* tit,const StvTrack *tk) -{ - int iErr=0; -#if 0 -static int nCall = 0; nCall++; - int n=0,pora=0; - const StvNode *curNode,*preNode=0; - double pCur,pPre=0,pBeg[2],pErr,lenTot=0,eAcc[2]={0}; - double len=0,pLos,pDlt,pct,sample=0; - - for (StvNodeConstIter it=tk->begin();it!=tk->end();++it) { - curNode = (*it); n++; -// const StvHit *hit = curNode->GetHit(); - const StvNodePars &par = curNode->GetFP(); - const StvFitErrs &err = curNode->GetFE(); - pCur = sqrt(par.getP2()); - pErr = sqrt(err.mPP/par.getCos2L()); - do { //Pseudo loop - if (!preNode){pBeg[0] = pCur;pBeg[1]=pCur; break;} - { //test 1` - pLos = PLoss(curNode,preNode,&len); - sample += len; - eAcc[0]+=pLos; eAcc[1]+=pLos; - pora = sample>555; - pDlt = pBeg[1] - pCur; - - if ( pora && (eAcc[2] > pErr || fabs(pDlt) > pErr)) { - pct = fabs(eAcc[1]-pDlt)/(pCur)*100; - if (pct>1) - {iErr|=1;Error(tit,"P=%g Len=%4.1f dP=%g Loss=%g dif=%4.1f%%" - ,pCur,sample,pDlt,eAcc[1],pct);} - sample=0;eAcc[1]=0;pBeg[1]=pCur; pora = 0; - } - }//end test1 - - - { //Now TEST2 - - const StvELossData &dat = preNode->GetELoss(); - double pLos2 = (dat.mdPP) *len*pPre; - if (1 || fabs(pLos2-pLos) > pErr) { - pct = fabs(pLos2-pLos)/(pLos2+pLos)*200; - printf("===== Rxy=%g Z=%g StvPLoss = %g InDive = %g dif=%1.1f%%\n" - ,par.getRxy(),par._z,pLos,pLos2,pct); } - - } - } while(0); - - assert(fabs(len)<400); - lenTot += len; - assert(fabs(lenTot)<400); - preNode = curNode; - pPre = pCur; - } - pDlt = pBeg[0]-pCur; - if ( eAcc[0] > pErr || fabs(pDlt) > pErr) { - pct = fabs(pDlt-eAcc[0])/(pCur)*100; - if (pct>1) - {iErr+=1000;Error(tit,"P=%g Len=%4.1f dP=%g Loss=%g dif=%4.1f%% ****" - ,pCur,lenTot,pDlt,eAcc[0],pct);} - - } -#endif - return iErr; -} -//______________________________________________________________________________ -double StvTester::DeltaLen(const StvNode* curNode,const StvNode* preNode,double *lenXY) const -{ - const StvNodePars &parA = preNode->GetFP(); - const StvNodePars &parB = curNode->GetFP(); - - const double *x1 = &parA._x; - const double *x2 = &parB._x; - double dlen = sqrt(pow(x1[0]-x2[0],2) + pow(x1[1]-x2[1],2)); - double curv = 0.5*fabs(parA._curv+parB._curv); - double dsin = (0.5*dlen*curv); - if (dsin>0.9) dsin=0.9; - dlen = (dsin<0.01)? dlen*(1.+dsin*dsin/6) : 2*asin(dsin)/curv; - if (lenXY) *lenXY = dlen; - dlen =sqrt(dlen*dlen + pow(x1[2]-x2[2],2)); - - return dlen; -} -//______________________________________________________________________________ -double StvTester::PLoss(const StvNode* curNode,const StvNode* preNode, double *len) const -{ -#if 0 -static int nCall = 0; nCall++; - const StvNodePars &parA = preNode->GetFP(); - const StvNodePars &parB = curNode->GetFP(); - THelixTrack curHlx,preHlx; - double momA = sqrt(parA.getP2()); - double momB = sqrt(parB.getP2()); - - parA.get(&preHlx); - parB.get(&curHlx); - double lenA = preHlx.Path(curHlx.Pos()); - double lenB = curHlx.Path(preHlx.Pos()); - double totLen = (fabs(lenA)+fabs(lenB))/2; - double step = 0.1; - if (parA.getRxy()<60 || parB.getRxy()<60) step = 0.01; - int nSteps = int(totLen/step+1); - double stepA = fabs(lenA/nSteps); - double stepB = fabs(lenB/nSteps); - curHlx.Move(lenB); - mEl->Reset(); - for (int iStep=0;iStepFindNode(myX[0],myX[1],myX[2]); - assert(geoNode); - TGeoVolume *geoVolu = geoNode->GetVolume(); - TGeoMaterial *geoMate = geoVolu->GetMaterial(); - double a = geoMate->GetA(); - double z = geoMate->GetZ(); - double d = geoMate->GetDensity(); - double x0 = geoMate->GetRadLen(); - double p = momA*(1-wt)+momB*wt; - mEl->Set (a, z, d, x0, p, piMass, +1.0); - double s = stepA*(1-wt)+stepB*wt; - mEl->Add(s); - curHlx.Move(stepB); - preHlx.Move(stepA); - } - assert(fabs(totLen)<400); - if (len) *len = totLen; - double dP0 = totLen*momB*mEl->dPovPLen(); - double dP1 = mEl->dEdX()*totLen*sqrt(momA*momA+piMass*piMass)/momA; - if ( fabs(dP0-dP1)/(dP0+dP1)*200>1) { - printf ("PLoss dP0=%g dP1=%g\n",dP0,dP1); - } - return dP0; -#endif -return 0; -} - - - - - - - diff --git a/StRoot/Stv/StvTester.h b/StRoot/Stv/StvTester.h deleted file mode 100644 index 4461c1f3108..00000000000 --- a/StRoot/Stv/StvTester.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __StvTester_h_ -#define __StvTester_h_ -#include -#include -#include -#include -#include "TNamed.h" -#include "StvUtil/StvNodePars.h" - -class StvELossTrak; -class StvTrack; -class StvNode; -class StvTester : public TNamed { -private: -StvTester(const char *name="DefaultTester"); -public: -static StvTester *Inst(); -int TestIt(const char *tit,const StvTrack *tk); -private: -double DeltaLen(const StvNode* curNode,const StvNode* preNode,double *lenXY=0) const; -double PLoss (const StvNode* curNode,const StvNode* preNode,double *len =0) const; - -protected: - char mBeg[1]; - StvELossTrak *mEl; - char mEnd[1]; -static StvTester *mgTester; -ClassDef(StvTester,0); -}; - -#endif //__StvTester_h_ - - diff --git a/StRoot/Stv/StvToolkit.cxx b/StRoot/Stv/StvToolkit.cxx deleted file mode 100644 index 095363807a5..00000000000 --- a/StRoot/Stv/StvToolkit.cxx +++ /dev/null @@ -1,216 +0,0 @@ -#include -#include -#include -#include "StvToolkit.h" -#include "Stv/Factory/StvFactory.h" -#include "Stv/StvHit.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "StvUtil/StvELossTrak.h" -#include "Stv/StvStl.h" -#include "Stv/StvDraw.h" -#include "StarMagField.h" -#include "StvMaker/StvHitLoader.h" -#include "Stv/StvSeedFinder.h" -#include "Stv/StvTrackFinder.h" - -class StvHitFactory : public StvFactory {public:}; -class StvHitRrFactory : public StvFactory {public:}; -class StvNodeFactory : public StvFactory {public:}; -class StvTrackFactory : public StvFactory {public:}; -class StvELossTrakFactory : public StvFactory {public:}; -class StvVertexFactory : public StvFactory {public:}; - - -StvToolkit *StvToolkit::mgInstance = 0; - -//_____________________________________________________________________________ -StvToolkit::StvToolkit() -{ - assert(!mgInstance); - mgInstance = this; - memset(mBeg,0,mEnd-mBeg+1); - mX[0] = -999999; - mTraks = new StvTracks; -} - -//_____________________________________________________________________________ -StvToolkit * StvToolkit::Inst() -{ - if (!mgInstance) mgInstance = new StvToolkit(); - - return mgInstance; -} - -//_____________________________________________________________________________ -StvHit *StvToolkit::GetHit() -{ - if (!mHitFactory) { - mHitFactory = (StvHitFactory*)StvHitFactory::myInstance(); - mHitFactory->setMaxIncrementCount(4000000); - mHitFactory->setFastDelete(); - } - return mHitFactory->getInstance(); -} -//_____________________________________________________________________________ -StvHit *StvToolkit::GetHitRr() -{ - if (!mHitRrFactory) { - mHitRrFactory = (StvHitRrFactory*)StvHitRrFactory::myInstance(); - mHitRrFactory->setMaxIncrementCount(4000000); - mHitRrFactory->setFastDelete(); - } - return mHitRrFactory->getInstance(); -} -//_____________________________________________________________________________ -StvHit *StvToolkit::GetVertex() -{ - if (!mVertexFactory) { - mVertexFactory = (StvVertexFactory*)StvVertexFactory::myInstance(); - mVertexFactory->setMaxIncrementCount(100); - mVertexFactory->setFastDelete(); - } - return mVertexFactory->getInstance(); -} -//_____________________________________________________________________________ -void StvToolkit::FreeHit(StvHit *&stiHit) -{ - if (!stiHit) return; - if (stiHit->errMtx()) { StvHitRrFactory::Free(stiHit);} - else { StvHitFactory::Free(stiHit);} - stiHit=0; -} -//_____________________________________________________________________________ -StvTrack *StvToolkit::GetTrack() -{ - if (!mTrackFactory) { - mTrackFactory = (StvTrackFactory*)StvTrackFactory::myInstance(); - mTrackFactory->setMaxIncrementCount(40000); - } - return mTrackFactory->getInstance(); -} -//_____________________________________________________________________________ -StvELossTrak *StvToolkit::GetELossTrak() -{ - if (!mELossTrakFactory) { - mELossTrakFactory = (StvELossTrakFactory*)StvELossTrakFactory::myInstance(); - mELossTrakFactory->setMaxIncrementCount(4000000); - } - return mELossTrakFactory->getInstance(); -} -//_____________________________________________________________________________ -void StvToolkit::FreeTrack(StvTrack *&stiTrack) -{ - StvTrackFactory::Free(stiTrack); stiTrack=0; -} -//_____________________________________________________________________________ -void StvToolkit::FreeELossTrak(StvELossTrak *&stiELossTrak) -{ - StvELossTrakFactory::Free(stiELossTrak); stiELossTrak=0; -} -//_____________________________________________________________________________ -StvNode *StvToolkit::GetNode() -{ - if (!mNodeFactory) { - mNodeFactory = (StvNodeFactory*)StvNodeFactory::myInstance(); - mNodeFactory->setMaxIncrementCount(4000000); - mNodeFactory->setFastDelete(); - } - return mNodeFactory->getInstance(); -} -//_____________________________________________________________________________ -void StvToolkit::FreeNode(StvNode *&stiNode) -{ - StvNodeFactory::Free(stiNode); stiNode=0; -} -//_____________________________________________________________________________ -StvTracks &StvToolkit::GetTracks(){return *mTraks;} -//_____________________________________________________________________________ -void StvToolkit::Show() const -{ - StvToolkit *This = (StvToolkit*)this; - for (StvTrackConstIter it = This->GetTracks().begin(); - it!= This->GetTracks().end(); ++it) { - const StvTrack *tk = *it;tk->Show(); - } -} -//_____________________________________________________________________________ -void StvToolkit::Clear(const char*) -{ -//if (StvDraw::Jnst()) StvDraw::Jnst()->Clear(); - if (mTraks) mTraks->clear(); - if (mHitLoader) mHitLoader->Clear(); - if (mSeedFinders) mSeedFinders->Clear(); - if (mTrakFinder) mTrakFinder->Clear(); - - if (mTrackFactory) mTrackFactory->clear(); - if (mELossTrakFactory) mELossTrakFactory->clear(); - if (mNodeFactory) mNodeFactory->clear(); - if (mHitFactory) mHitFactory->clear(); - if (mHitRrFactory) mHitRrFactory->clear(); - if (mVertexFactory) mVertexFactory->clear(); - StvTrack::mgId=0; -} -/*! Calculate/return the z component of mag field -

- Calculate/return the z component of mag field -

- Field is calcualated via StarMagField class and cashed. -*/ -//_____________________________________________________________________________ -void StvToolkit::Print(const char*) -{ - if (mTrackFactory) mTrackFactory->print(); - if (mELossTrakFactory)mELossTrakFactory->print(); - if (mNodeFactory) mNodeFactory->print(); - if (mHitFactory) mHitFactory->print(); - if (mVertexFactory) mVertexFactory->print(); -} -//_____________________________________________________________________________ -void StvToolkit::Reset() -{ - if (mSeedFinders) mSeedFinders->Reset(); - if (mTrakFinder) mTrakFinder->Reset(); - -} -//______________________________________________________________________________ -double StvToolkit::GetHz(const double *x) const -{ - static const Double_t EC = 2.99792458e-4; - do { - if (fabs(x[0]-mX[0])>1e-3) break; - if (fabs(x[1]-mX[1])>1e-3) break; - if (fabs(x[2]-mX[2])>1e-3) break; - return mH[2]; - }while(0); - memcpy(mX,x,sizeof(mX)); - - StarMagField::Instance()->BField(mX,mH); - mH[0]*= EC;mH[1]*= EC;mH[2]*= EC; - if (fabs(mH[2]) < 3e-33) mH[2]=3e-33; - return mH[2]; -} -//______________________________________________________________________________ -double StvToolkit::GetHz(const float *x) const -{ double xx[3]={x[0],x[1],x[2]}; - return GetHz(xx); -} -//______________________________________________________________________________ -double StvToolkit::GetHA(const double *x) const -{ - static const Double_t EC = 2.99792458e-4; - double h[3]; - StarMagField::Instance()->BField(x,h); - double ha = (fabs(h[0])+fabs(h[1])+fabs(h[2]))*EC; - return ha; -} -//______________________________________________________________________________ -double StvToolkit::GetHA(const float *x) const -{ double xx[3]={x[0],x[1],x[2]}; - return GetHA(xx); -} -//______________________________________________________________________________ -int StvToolkit::Alive(void *obj) -{ - return FactoryB::Alive(obj); -} diff --git a/StRoot/Stv/StvToolkit.h b/StRoot/Stv/StvToolkit.h deleted file mode 100644 index d46e171c302..00000000000 --- a/StRoot/Stv/StvToolkit.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @file StvToolkit.h - */ -#ifndef StvToolkit_H -#define StvToolkit_H 1 - -/** - * @class StvToolkit - * @brief Definition of toolkit - */ -class StvGeoLoader; -class StvHitLoader; -class StvSeedFinder; -class StvSeedFinders; -class StvTrackFinder; -class StvEventFiller; -class StvHit; -class StvHitFactory; -class StvHitRrFactory; -class StvVertexFactory; - -class StvNode; -class StvNodeFactory; - -class StvTrack; -class StvTrackFactory; -class StvTracks; - -class StvELossTrak; -class StvELossTrakFactory; - -class StvToolkit -{ -protected: - StvToolkit(); -public: -void Clear(const char* opt=""); -void Print(const char* opt=""); -void Reset(); - -void Init (); -void Finish(); - -StvGeoLoader *GeoLoader(); -StvHitLoader *HitLoader() const {return mHitLoader ;} -StvSeedFinders *SeedFinders() const {return mSeedFinders;} -StvTrackFinder *TrackFinder() const {return mTrakFinder;} -StvEventFiller *EventFiller() const {return mEventFiller;} -double GetHz(const double *x) const; -double GetHz(const float *x) const; -double GetHA(const double *x) const; -double GetHA(const float *x) const; - -StvTracks &GetTracks(); -void Show() const; - - -// Factories for Stv objects -StvHit *GetHit(); -StvHit *GetHitRr(); -StvHit *GetVertex(); -void FreeHit(StvHit* &stiHit ); -StvNode *GetNode(); -void FreeNode(StvNode* &stiNode); -StvTrack *GetTrack(); -void FreeTrack(StvTrack* &stiTrak); -StvELossTrak *GetELossTrak(); -void FreeELossTrak(StvELossTrak* &stiELossTrak); - - -void SetHitLoader (StvHitLoader *loadHits ){ mHitLoader = loadHits ;} -void SetSeedFinders(StvSeedFinders *seedFinders){ mSeedFinders = seedFinders;} -void SetTrackFinder(StvTrackFinder *trackFinder){ mTrakFinder = trackFinder;} -void SetEventFiller(StvEventFiller *eventFiller){ mEventFiller = eventFiller;} - -public: -static StvToolkit* Inst(); -static int Alive(void *obj); - -protected: -char mBeg[1]; -StvGeoLoader *mGeoLoader; -StvHitLoader *mHitLoader; -StvSeedFinders *mSeedFinders; -StvTrackFinder *mTrakFinder; -StvTracks *mTraks; -StvEventFiller *mEventFiller; -StvHitFactory *mHitFactory; -StvHitRrFactory *mHitRrFactory; -StvNodeFactory *mNodeFactory; -StvTrackFactory *mTrackFactory; -StvELossTrakFactory *mELossTrakFactory; -StvVertexFactory *mVertexFactory; -// Mag field -mutable double mX[3],mH[3]; -char mEnd[1]; - -protected: -static StvToolkit* mgInstance; -}; - -#endif - diff --git a/StRoot/Stv/StvTrack.cxx b/StRoot/Stv/StvTrack.cxx deleted file mode 100644 index b7386a5a06d..00000000000 --- a/StRoot/Stv/StvTrack.cxx +++ /dev/null @@ -1,457 +0,0 @@ -#include -#include -#include -#include -#include - -#include "Stv/StvHit.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "Stv/StvDraw.h" -#include "Stv/StvToolkit.h" -#include "StvUtil/StvKNNUtil.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -int StvTrack::mgId=0; - -//______________________________________________________________________________ -StvTrack::StvTrack() -{ - mId = -1; -} - -//______________________________________________________________________________ -StvTrack::~StvTrack() -{ - unset(); -} -//______________________________________________________________________________ -void StvTrack::reset() -{ - mId = ++mgId; - mPrimary=0; - memset(mBeg,0,mEnd-mBeg+1); - clear(); -} -//______________________________________________________________________________ -void StvTrack::unset() -{ -static StvToolkit *kit = StvToolkit::Inst(); - for (StvNodeIter it = begin();it != end();++it) - { - StvNode *node = *it; - kit->FreeNode(node); - } - clear(); -} -//______________________________________________________________________________ -int StvTrack::GetNPoss(StDetectorId detectorId) const -{ - int n=0; - for (StvNodeConstIter it = begin(); it !=end();++it) { - const StvNode *node = *it; - const StHitPlane *hp = node->GetHitPlane(); - if (!hp) continue; - if (detectorId && hp->GetDetId()!=detectorId) continue; - n++; - } - return n; -} -//______________________________________________________________________________ -int StvTrack::GetNHits(StDetectorId detectorId) const -{ - int n=0; - for (StvNodeConstIter it = begin(); it !=end();++it) { - const StvNode *node = *it; - if (!node->GetHit()) continue; - if (node->GetXi2()>1000) continue; - if (detectorId) { - const StHitPlane *hp = node->GetHitPlane(); - if (!hp) continue; - if (hp->GetDetId()!=detectorId) continue; - } - n++; - } - return n; -} -//______________________________________________________________________________ -int StvTrack::GetNFits(int dir) const -{ - int n=0; - for (StvNodeConstIter it = begin(); it !=end();++it) { - const StvNode *node = *it; - if (node->IsFitted(dir)) n++; - } - return n; -} -//______________________________________________________________________________ -int StvTrack::SetUsed() -{ - int n = 0; - for (StvNodeConstIter it = begin(); it !=end();++it) { - StvNode *node = *it; - StvHit *hit = node->GetHit(); - if (!hit) continue; - if (!hit->detector()) continue; - if (node->GetXi2()<1000 && !hit->isUsed()) { - hit->addTimesUsed();n++; } - else { - node->SetHit(0); - } - } - return n; -} -//______________________________________________________________________________ -int StvTrack::SetUnused() -{ - int n = 0; - for (StvNodeConstIter it = begin(); it !=end();++it) { - StvNode *node = *it; - StvHit *hit = node->GetHit(); - if (!hit) continue; - if (!hit->detector()) continue; - hit->setTimesUsed(0);n++; - if (node->GetXi2()>1000) node->SetHit(0); - } - - return n; -} -//______________________________________________________________________________ -StvNode *StvTrack::GetNode(EPointType noTy) -{ - StvNode *node=0,*foundNode=0;int n=0; - double maxXi2 = 0; - if (noTy!=kLastPoint) { - for (StvNodeIter it = begin();it != end();++it) { - node = *it; n++; - switch(noTy) { - case kDcaPoint: if (n>2) return 0; - if (node->GetType()==StvNode::kDcaNode) {return node;} - break; - - case kPrimPoint: - if (node->GetType()==StvNode::kPrimNode) {return node;} - return 0; - - case kFirstPoint: - if (node->GetType()!=StvNode::kRegNode) break; - if (!node->GetHit()) break; - if ( node->GetXi2()>1000) break; - return node; - case kMaxXi2: - if (node->GetType()!=StvNode::kRegNode) break; - if (!node->GetHit()) break; - if ( node->GetXi2()GetXi2(); break; - - default: assert("Wrong Node type" && 0); - }//end switch - }//end loop - } else { - for (StvBakwNodeIter it = rbegin();it != rend();++it) { - node = *it; n++; - if (node->GetType()!=StvNode::kRegNode) continue; - if (!node->GetHit()) continue; - if ( node->GetXi2()>1000) continue; - return node; - } - }// end if - - return foundNode; - -} -//______________________________________________________________________________ -const StvNode *StvTrack::GetNode(EPointType noTy) const -{ return ((StvTrack*)this)->GetNode(noTy); } -//_____________________________________________________________________________ -double StvTrack::GetLength(EPointType ept) const -{ - const StvNodePars *pre=0; - double len = 0; - for (StvNodeConstIter it = begin();it != end();++it) - { - StvNode *node = *it; - if (!pre) { - StvNode::ENodeType ty = node->GetType(); - if (ty == StvNode::kPrimNode) { - if (ept!=kPrimPoint) continue; - pre = &(node->GetFP(2)); continue; - } - if (ty == StvNode::kDcaNode) { - if (ept!=kDcaPoint) continue; - pre = &(node->GetFP(2)); continue; - } - if (ty != StvNode::kRegNode) continue; - if (node->GetXi2()>1000) continue; - pre = &(node->GetFP(2)); continue; - } - const double *x1 = &pre->_x; - const double *x2 = &node->GetFP(2)._x; - double dlen = sqrt(pow(x1[0]-x2[0],2) + pow(x1[1]-x2[1],2)); - double curv = 0.5*fabs(pre->_curv+node->GetFP(2)._curv); - double dsin = (0.5*dlen*curv); - if (dsin>0.9) dsin=0.9; - dlen = (dsin<0.1)? dlen*(1.+dsin*dsin/6) : 2*asin(dsin)/curv; - len +=sqrt(dlen*dlen + pow(x1[2]-x2[2],2)); - pre = &(node->GetFP(2)); - } - return len; - -} -//_____________________________________________________________________________ -double StvTrack::GetXi2() const -{ - double Xi2 = 0; - int nd=0; - for (StvNodeConstIter it = begin();it != end();++it) - { - const StvNode *node = *it; - if (!node->GetHit()) continue; - if (node->GetXi2()>1000) continue; - nd++; Xi2+=node->GetXi2(); - } - nd = nd*2-5; - - return (nd>0)? Xi2/nd:0; - -} -//_____________________________________________________________________________ -double StvTrack::GetXi2Aux() const -{ - if (!mXi2Aux) mXi2Aux = GetXi2(); - return mXi2Aux; -} -//_____________________________________________________________________________ -double StvTrack::GetXi2P() const -{ - if (!IsPrimary()) return 0; - const StvNode *node = GetNode(kPrimPoint); - assert(node); - double Xi2 = node->GetXi2(); - assert(Xi2<1000.); - return Xi2; -} - -//_____________________________________________________________________________ -void StvTrack::CutTail(const StvNode *start) -{ -static StvToolkit *kit = StvToolkit::Inst(); - if (empty()) return; - if (!start) start = front(); - StvNodeIter tail = begin(); - int kase=0; - for (StvNodeIter it = begin();it != end();++it) - { - StvNode *node = *it; - switch (kase) { - case 0: if (node !=start) break; - kase=1; tail=it; - case 1: node->SetHit(0); - kit->FreeNode(node); - } - } - assert(kase); - erase(tail,end()); -} -//_____________________________________________________________________________ -void StvTrack::CutEnds() -{ -static StvToolkit *kit = StvToolkit::Inst(); - StvNodeIter it =begin(); - int nDel=0; - for (; it != end();++it) - { - StvNode *node = *it; - if (node->GetHit()) break; - nDel ++;kit->FreeNode(node); - } - if (nDel) {erase(begin(),it);} - - it = end(); --it; - nDel=0; - for (; it !=begin();--it) - { - StvNode *node = *it; - if (node->GetHit()) break; - nDel ++; kit->FreeNode(node); - } - if (nDel) { ++it; erase(it,end());} -} -//_____________________________________________________________________________ -double StvTrack::GetRes() const -{ - int nRes=0; double res = 0; - for (StvNodeConstIter it=begin();it!=end(); ++it) { - StvNode *node = *it; - const StvHit *hit= node->GetHit(); - if (!hit) continue; - TVector3 dif,dir; - const StvNodePars &fp = node->GetFP(); - for (int i=0;i<3;i++) { dif[i]=fp.P[i]-hit->x()[i];} - dir[0]= fp._cosCA; - dir[1]= fp._sinCA; - dir[2]= fp._tanl; - dir = dir.Unit(); - res += (dif.Cross(dir)).Mag(); nRes++; - } - return (nRes)? res/nRes:0.; -} - - -//_____________________________________________________________________________ -void StvTrack::Show() const -{ -StvHits showHits; -StvPoints showTrak; - for (StvNodeConstIter it = begin();it != end();++it) - { - const StvNode *node = *it; - const StvHit *hit = node->GetHit(); - showTrak += node->GetFP().P; - if (hit) showHits+=(StvHit*)hit; - } - StvDraw::Inst()->Trak(showTrak,kGlobalTrack); - StvDraw::Inst()->Hits(showHits,kUsedHit ); -} -//_____________________________________________________________________________ -int StvTrack::Check(const char *tit, int dirs) const -{ -if (!tit) tit = ""; - int n = -1,nerr=0; - for (StvNodeConstIter it = begin();it != end();++it) - { - n++; - const StvNode *node = *it; - TString ts; - if (tit[0]) {ts = tit; ts+="#"; ts+=n; - char mybuf[40]={0}; sprintf(mybuf," node=%p ",(void*)node); - ts+=mybuf; - } - int fail = node->Check(ts,dirs); - if (fail) nerr++; - } - return nerr; -} -//_____________________________________________________________________________ -void StvTrack::Print(const char *opt) const -{ - if (!opt) opt = ""; - printf("Track %p\n",(void*)this); - - int n=0; - for (StvNodeConstIter it=begin();it!=end();++it) { - const StvNode *node = (*it); -// const StvHit *hit = node->GetHit(); -// if (!hit && strchr(opt,'H')) continue; - n++;printf("%3d - ",n); - node->Print(opt); - } -} -//_____________________________________________________________________________ -double StvTrack::ToBeam() const -{ - const StvNode *node = GetNode(kDcaPoint); - if (!node) return 3e33; - return node->GetFP().getRxy(); -} -//_____________________________________________________________________________ -int StvTrack::GetCharge() const -{ - const StvNode *node = front(); - return node->GetFP().getCharge(); -} -//_____________________________________________________________________________ -void StvTrack::Reverse() -{ reverse(); } -//______________________________________________________________________________ -double StvTrack::GetXi2W() const -{ - if (mXi2W>0) return mXi2W; - mXi2W = 0; - for (auto it = begin();it != end();++it) - { - auto *node = *it; - if (node->GetType()!=StvNode::kRegNode) continue; - if (!(node->GetHit())) continue; - double Xi2 = node->GetXi2(); - if ( Xi2>1000) continue; - if ( Xi2 < mXi2W) continue; - mXi2W = Xi2; - } - return mXi2W; -} -//_____________________________________________________________________________ -StvTrack &StvTrack::operator=(const StvTrack &from) -{ -static StvToolkit *kit = StvToolkit::Inst(); - for (auto it = begin();it != end();++it) - { - StvNode *node = *it; kit->FreeNode(node); - } - clear(); - memcpy(mBeg,from.mBeg,mEnd-mBeg+1); - for (StvNodeConstIter it=from.begin();it!=from.end();++it) { - const StvNode *node = (*it); - StvNode *myNode = kit->GetNode(); - *myNode = *node; push_back(myNode); - } - return *this; -} -//______________________________________________________________________________ -StvNode *StvTrack::GetMaxKnnNode() -{ - StvNode *node=0;int n=0; - float var[2]; - const StvHit *hit=0; - StvKNNUtil knn(2,5); - for (StvNodeIter it = begin();it != end();++it) - { - node = *it; n++; - if (node->GetType()!=StvNode::kRegNode) continue; - if (!(hit=node->GetHit())) continue; - if ( node->GetXi2()>1000) continue; - const StvNodePars &par = node->GetFP(); - const double cosL = par.getCosL(); - const float *fx = hit->x(); - var[1] = (fx[2]-par._z)*cosL; - var[0] = ((fx[0]-par._x)*(-par._sinCA)+(fx[1]-par._y)*(par._cosCA)); - knn.Add((ULong_t)node,var); - } - knn.GetWost((ULong_t*)&node); - return node; -} -#include "StarRoot/TIdTruUtil.h" -#include "StEvent/StRnDHit.h" -//_____________________________________________________________________________ -double StvTrack::GetQua() const -{ - - TIdTruUtil idt; - const StvHit *hit=0; - - for (StvNodeConstIter it = begin();it != end();++it) - { - StvNode *node = *it; - if (node->GetType()!=StvNode::kRegNode) continue; - if (!(hit=node->GetHit())) continue; - if ( node->GetXi2()>1000) continue; - int idTru = hit->idTru(); -#ifdef kFtsIdentifier - if (!idTru && hit->detectorId()==kFtsId) { - auto *rndHit = (StRnDHit*)hit->stHit(); - int id0 = rndHit->extraByte0(); - int id1 = rndHit->extraByte1(); - assert (id0 && id1); - idt.Add(id0,50); - idt.Add(id1,50); - continue; - } -#endif - idt.Add(idTru); - } - if (!idt.GetIdTru()) return 0; - return idt.GetQua(); - -} - - - diff --git a/StRoot/Stv/StvTrack.h b/StRoot/Stv/StvTrack.h deleted file mode 100644 index fd526cd02cd..00000000000 --- a/StRoot/Stv/StvTrack.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * \file StvTrack.h - * \brief Definition StvTrack - * - */ -#ifndef StvTrack_H -#define StvTrack_H 1 - -#include "StEvent/StEnumerations.h" -#include "Stv/StvStl.h" - -class StvHit; -class StvTrack: public StvNodes -{ - public: - enum EPointType {kDcaPoint,kFirstPoint,kLastPoint,kPrimPoint,kMaxXi2}; - public: - StvTrack(); - StvTrack &operator=(const StvTrack &from); - StvTrack(const StvTrack &from) {*this=from;} - -/// Destructor - virtual ~StvTrack(); - void reset(); - void unset(); - - /// Set Type of End tracking - void SetTypeEnd (int tyEnd) {mTypeEnd = tyEnd;} - - /// returns node related ipt 0=DCA node, 1=1st point. 2=last point, 3=Primary vertex - StvNode *GetNode(EPointType poTy); -const StvNode *GetNode(EPointType poTy) const; - /// Returns node with biggest KNN distance - StvNode *GetMaxKnnNode() ; - /// Returns the number of hits associated and used in the fit of this track. - int GetNHits(StDetectorId detectorId=kUnknownId) const; - /// Return the number of possible hits with this track. - int GetNPoss(StDetectorId detectorId=kUnknownId) const; - /// Returns the number of fits associated direction.0=OutIn,1=InOut,2=Joined - int GetNFits(int dir) const; - - /// Returns the End Type i.e reason of the end of tracking - /// 0=Dca,1 = too many continues nits,2 = too many total nits - int GetTypeEnd () const {return mTypeEnd;} - - /// Returns the quality of track for montecarlo case -double GetQua() const; - - /// Delete all the nodes started form given - void CutTail(const StvNode *start=0); - - /// Delete all the hitless nodes a the the begining and at the end - void CutEnds(); - - /*! - Returns the track length (in centimeters) from the : - - first point (kFirstPoint) default; - - DCA point (kDcaPoint) ; - - Primary vertex (kPrimPoint) ; - to the last point on track. - */ - double GetLength(EPointType ept=kFirstPoint) const; - int GetCharge() const; - - void Reverse(); // Inverese node order. For debug only -double GetXi2() const; // chi2/ndf of fit, all nodes -double GetXi2P() const; // chi2 of fit to primary vertex -double GetXi2W() const; // chi2 of the worst node -double GetRes() const; // Average residual -double GetXi2Aux() const; // chi2/ndf of fit, special version or track ordering all nodes - - void SetFlag(int flag) {mFlag = flag;} - int GetFlag() const {return mFlag;} - int GetId() const {return mId ;} - void AddId(int info) {mId+=1000000*info;} - - void SetPrimary(int iprim) {mPrimary = iprim;} - int IsPrimary() const {return mPrimary ;} - void Print(const char *opt) const; - - int SetUsed(); - int SetUnused(); - - double ToBeam() const; - int Check(const char *tit="",int dirs=3) const; - void Show() const; - -protected: -unsigned char mBeg[1]; -unsigned char mPrimary; -unsigned char mTypeEnd; // Type of end tracking. 0=Dca, - int mFlag; -mutable float mXi2W; -mutable float mXi2Aux; -unsigned char mEnd[1]; -unsigned int mId; -public: -static int mDebug; // Debug level -static int mgId; // static track counter - -}; - -#endif - diff --git a/StRoot/Stv/StvTrackFinder.cxx b/StRoot/Stv/StvTrackFinder.cxx deleted file mode 100644 index c1345cf092f..00000000000 --- a/StRoot/Stv/StvTrackFinder.cxx +++ /dev/null @@ -1,49 +0,0 @@ -#include "StvTrackFinder.h" -#include "TSystem.h" -#include "StvDraw.h" -#include "vector" -ClassImp(StvTrackFinder) -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StvTrackFinder::~StvTrackFinder() -{ DoShow(0); -} -//_____________________________________________________________________________ -void StvTrackFinder::Show() -{ - if (!fDraw) return; - if(fShowTrak.size())fDraw->Trak(fShowTrak,kGlobalTrack); -//if(fShowTrak.size())fDraw->Line(fShowTrak,kGlobalTrack); - if(fShowTrakHits.size() )fDraw->Hits(fShowTrakHits ,kUsedHit ); - if(fShowFreeHits.size() )fDraw->Hits(fShowFreeHits ,kUnusedHit); - fShowTrak.clear();fShowTrakHits.clear();fShowFreeHits.clear(); - fDraw->UpdateModified(); -// fDraw->SetDrawOption("{view:all}"); - fDraw->ProcessEvents(); -} -//_____________________________________________________________________________ -StvDraw *StvTrackFinder::NewDraw() -{ - StvDraw *dr = new StvDraw(); - dr->SetBkColor(kWhite); -// dr->Style(kUsedHit).Siz() *=2; - dr->Style(kUnusedHit).Siz()*=20; - return dr; -} -//_____________________________________________________________________________ -void StvTrackFinder::DoShow(int lev) -{ - if (fDoShow == lev) return; - fDoShow = lev; - if (fDoShow) {if (!fDraw) fDraw=NewDraw();} - else { delete fDraw;fDraw=0 ;fShowTrak.clear(); - fShowTrakHits.clear();fShowFreeHits.clear();} -} -//_____________________________________________________________________________ -void StvTrackFinder::Clear(const char*) -{ -// if (fDraw) fDraw->Clear(); -// fShowTrak.clear(); -// fShowTrakHits.clear(); -// fShowFreeHits.clear(); -} diff --git a/StRoot/Stv/StvTrackFinder.h b/StRoot/Stv/StvTrackFinder.h deleted file mode 100644 index f7f26cd2161..00000000000 --- a/StRoot/Stv/StvTrackFinder.h +++ /dev/null @@ -1,50 +0,0 @@ -/// \File StvTrackFinder.h -/// \author Victor Perev 01/2010 -#ifndef StvTrackFinder_HH -#define StvTrackFinder_HH -#include "StvStl.h" -#include "TNamed.h" - -/// \class StvTrackFinder -class StvHit; -class StvDraw; -class StvPoints; -class StvHits; -class StvKonst_st; -class StvTrackFitter; -class StvTrackFinder : public TNamed -{ -public: - StvTrackFinder(const char *name):TNamed(name,""){fDraw=0;fDoShow=0;mRefit=1;} - virtual ~StvTrackFinder(); - virtual int FindTracks() =0; - virtual int FindPrimaries(const StvHits &vtxs) =0; - virtual void Reset() =0; - virtual void Clear(const char *opt=""); - virtual void SetCons(const StvKonst_st*)=0; - virtual void SetFitter(StvTrackFitter *fitter){mTrackFitter = fitter;} - void AddPoint(const double pt[3]); - void AddHits(const double pt[3]); - virtual StvNode *MakeDcaNode(StvTrack *tk)=0; - void Show(); - void DoShow(int lev); - int DoShow() const {return fDoShow;}; - void SetRefit(int r=1) {mRefit = r;} - -protected: -static StvDraw *NewDraw(); -protected: -StvTrackFitter *mTrackFitter; -int mRefit; //refit flag -int fDoShow; -StvDraw *fDraw; -StvPoints fShowTrak; -StvHits fShowTrakHits; -StvHits fShowFreeHits; -private: - -ClassDef(StvTrackFinder,0); -}; - - -#endif diff --git a/StRoot/Stv/StvTrackFitter.cxx b/StRoot/Stv/StvTrackFitter.cxx deleted file mode 100644 index fc08f3d7a2d..00000000000 --- a/StRoot/Stv/StvTrackFitter.cxx +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include "StvTrackFitter.h" -ClassImp(StvTrackFitter) -//______________________________________________________________________________ -StvTrackFitter::StvTrackFitter(const char *name):TNamed(name,"") -{ - Clear(); -} -//______________________________________________________________________________ -StvTrackFitter::~StvTrackFitter() -{;} - -//______________________________________________________________________________ -void StvTrackFitter::Clear(const char *) -{ - memset(mBeg,0,mEnd-mBeg+1); - mXi2=3e33; -} diff --git a/StRoot/Stv/StvTrackFitter.h b/StRoot/Stv/StvTrackFitter.h deleted file mode 100644 index f268319f909..00000000000 --- a/StRoot/Stv/StvTrackFitter.h +++ /dev/null @@ -1,51 +0,0 @@ -/// \File StvTrackFitter.h -/// \author Victor Perev 9/2010 -#ifndef StvTrackFitter_HH -#define StvTrackFitter_HH -#include "TNamed.h" - -/// \class StvTrackFitter -class THelixTrack; -class StvTrack; -class StvNode; -class StvHit; -class StvNodePars; -class StvFitErrs; -class StvKonst_st; -class StvTrackFitter : public TNamed -{ -public: - StvTrackFitter(const char *name); - virtual ~StvTrackFitter(); - virtual void SetCons(const StvKonst_st*)=0; - virtual int Refit(StvTrack *trak,int dir)=0; - virtual int Refit(StvTrack *trak,int dir,int lane, int mode=1)=0; - virtual void Clear(const char *opt=""); - virtual int Fit(const StvTrack *trak,const StvHit *vtx,StvNode *node)=0; - virtual int Helix(StvTrack *trak,int mode)=0; - virtual int Check(StvTrack *trak) {return 0;} - virtual int Check(const StvNodePars &parA,const StvFitErrs &errA, - const StvNodePars &parB,const StvFitErrs &errB) {return 0;} - virtual int Clean(StvTrack *trak)=0; - virtual THelixTrack* GetHelix() const {return 0;} - int GetNDF() const {return mNDF ;} - double GetDca3() const {return mDca3;} - double GetXi2() const {return mXi2 ;} - int Failed() const {return mFailed;} - int& NHits() {return mNHits;} - -protected: -char mBeg[1]; -char mFailed; -int mNHits; -int mNDF; -double mXi2; -double mDca3; -char mEnd[1]; -private: - -ClassDef(StvTrackFitter,0); -}; - - -#endif diff --git a/StRoot/Stv/StvVertexFinder.cxx b/StRoot/Stv/StvVertexFinder.cxx deleted file mode 100644 index 0ed3035340e..00000000000 --- a/StRoot/Stv/StvVertexFinder.cxx +++ /dev/null @@ -1,35 +0,0 @@ -#include "Stiostream.h" -#include "StvVertexFinder.h" -#include "Stv/StvHit.h" -#include "StvToolkit.h" - -//______________________________________________________________________________ -StvVertexFinder::StvVertexFinder(const char* name): TNamed(name,"") -{ - mResulted=0; - cout <<"StvVertexFinder::StvVertexFinder() -I- Started :" << name<GetVertex(); - for (int j=0;j<9;j++) {Xf[j]=Xd[j];} - hit->set(Xf,Xf+3); - mResult.push_back(hit);} - return mResult; -} diff --git a/StRoot/Stv/StvVertexFinder.h b/StRoot/Stv/StvVertexFinder.h deleted file mode 100755 index 2489a171320..00000000000 --- a/StRoot/Stv/StvVertexFinder.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef StvVertexFinder_H -#define StvVertexFinder_H 1 -#include -#include -#include "StvStl.h" - -class StEvent; -class StvHit; -class StvKonst_st; - -/*! -An abstract class defining the interface to the vertex finder. -*/ -class StvVertexFinder : public TNamed -{ -public: - StvVertexFinder(const char* name); - virtual ~StvVertexFinder(); - /// Find the vertex(es) associated with the given event - virtual int Fit(StEvent*)=0; // fit the vertex - virtual int GetVertex(int index,double xyz[3],double err[6]) =0; - virtual void Clear(const char * opt=0); - void SetCons(const StvKonst_st *kons){mKons = kons;} - -const StvHits &Result(); - -protected: - StvVertexFinder();//not implemented - const StvKonst_st *mKons; - int mResulted; - StvHits mResult; -}; - -#endif diff --git a/StRoot/Stv/mytags.txt b/StRoot/Stv/mytags.txt deleted file mode 100644 index 19036c886d1..00000000000 --- a/StRoot/Stv/mytags.txt +++ /dev/null @@ -1,5 +0,0 @@ -Fri Oct 27. Tag = StvKutta_1_00 -This version is full but still efficiency significantly les than Tag Stv1_01 -The last was done THelixTrack errs ==> Thelix3d ones fixed and tested - -============================================================================ diff --git a/StRoot/StvMaker/StvEventFiller.h b/StRoot/StvMaker/StvEventFiller.h deleted file mode 100755 index e32c3ef344f..00000000000 --- a/StRoot/StvMaker/StvEventFiller.h +++ /dev/null @@ -1,36 +0,0 @@ -//StvEventFiller.h -/*************************************************************************** - * - * $Id: StvEventFiller.h,v 1.4 2015/11/11 01:51:04 perev Exp $ - * It is base class for Transfer internal Stv structures into - * current experiment ones - * Author: Victor Perev, Jun 2010 - * - *************************************************************************** - */ -#ifndef StvEventFiller_HH -#define StvEventFiller_HH - -class StEvent; -class StvKonst_st; -class StvEventFiller -{ -public: - StvEventFiller(){mEvent=0;mTracks=0;mPullEvent=0;} - virtual ~StvEventFiller(){;} - void Set(StEvent* e,StvTracks* tk) { mEvent=e; mTracks = tk;} - void Set(StvPullEvent* pull) { mPullEvent=pull;} - virtual void fillEvent()=0; -virtual void fillEventPrimaries()=0; - void SetCons(const StvKonst_st *kons); -protected: - int mMinHits; - int mNorHits; - int mGoodHits; - StEvent* mEvent; - StvTracks* mTracks; - StvPullEvent* mPullEvent; - -}; - -#endif diff --git a/StRoot/StvMaker/StvFtsHitLoader.cxx.C b/StRoot/StvMaker/StvFtsHitLoader.cxx.C deleted file mode 100644 index 453049bf442..00000000000 --- a/StRoot/StvMaker/StvFtsHitLoader.cxx.C +++ /dev/null @@ -1,59 +0,0 @@ -// $Id: StvFtsHitLoader.cxx.C,v 1.1 2016/11/29 16:58:51 perev Exp $ -/*! -\author V Perev 2015 - -A StvFtsHitLoader loads Stv hits using StFtsHits. - - */ -#include "StEvent/StEnumerations.h" -#include "StvFtsHitLoader.h" -#include "StEvent/StFtsHit.h" -#include "Stv/StvHit.h" -#include "Stv/StvToolkit.h" -#include "TCernLib.h" - -static const double kFtsAccu = 0.9; - -ClassImp(StvFtsHitLoader) -//_____________________________________________________________________________ -int StvFtsHitLoader::MakeStvHit(const StHit *stHit,UInt_t upath, int &sure - ,StvHit *stvHit) -{ - int num = 0; -#ifdef kFtsIdentifier -static StvToolkit *kit = StvToolkit::Inst(); - auto detId = stHit->detector(); - if (detId != kFtsId) return StvHitLoader::MakeStvHit(stHit,upath,sure,stvHit); - assert(!stvHit); - - StThreeVectorF dRdPdZ = stHit->positionError(); - StThreeVectorF fx = stHit->position(); - double Rxy = sqrt(fx[0]*fx[0]+fx[1]*fx[1]); - double dRxy = dRdPdZ[0]*sqrt(12.); - double dPhi = dRdPdZ[1]*sqrt(12.); - - int nStp = dRxy/kFtsAccu+1; - double stp = dRxy/nStp; - double r = Rxy+0.5*(-dRxy+stp); - StFtsHit hit(*(StFtsHit*)stHit); - for (int iStp=0;iStpGetHitRr(); - int ans = StvHitLoader::MakeStvHit(&hit,upath,sure,stvHit); - stvHit->setStHit(stHit); - if (!ans) continue; - num += ans; - double cFi = fx[0]/Rxy,sFi = fx[1]/Rxy; - double T[2][2]= {{cFi,-fx[1]},{sFi,+fx[0]}}; - double gRFi[3] = {stp*stp/12,0,dPhi*dPhi/12}; - double gMtx[3]; - TCL::trasat(T[0],gRFi,gMtx,2,2); - float *e = stvHit->errMtx(); - memset(e+3,0,sizeof(e[0])*3); - TCL::ucopy(gMtx,e,3); e[3]=0; e[4]= 0; - e[5] = dRdPdZ[2]*dRdPdZ[2]; - } -#endif - return num; -} diff --git a/StRoot/StvMaker/StvFtsHitLoader.h.C b/StRoot/StvMaker/StvFtsHitLoader.h.C deleted file mode 100644 index 99e063c2fbf..00000000000 --- a/StRoot/StvMaker/StvFtsHitLoader.h.C +++ /dev/null @@ -1,20 +0,0 @@ -//StvFtsHitLoader.h - -#ifndef StvFtsHitLoader_HH -#define StvFtsHitLoader_HH -#include "StvHitLoader.h" - -class StvFtsHitLoader : public StvHitLoader - -{ - public: - - StvFtsHitLoader(const char* name = "StFtsHitsLoader"):StvHitLoader(name){} - virtual ~StvFtsHitLoader(){;} - protected: - int MakeStvHit(const StHit *stHit,UInt_t upath,int &sure,StvHit *stvHit=0); - private: - ClassDef(StvFtsHitLoader,0) -}; - -#endif diff --git a/StRoot/StvMaker/StvHitLoader.cxx b/StRoot/StvMaker/StvHitLoader.cxx deleted file mode 100644 index 8ee60466db8..00000000000 --- a/StRoot/StvMaker/StvHitLoader.cxx +++ /dev/null @@ -1,354 +0,0 @@ -// $Id: StvHitLoader.cxx,v 1.33 2017/01/19 16:56:01 perev Exp $ -/*! -\author V Perev 2010 - -A StvHitLoader loads Stv hits. -
-Main tasks: -

    -
  • Loop over StHits; -
  • Make & fill according StvHits; -
  • Fill StTGeoHelpr containers by StvHits; -
- - -*/ -#include -#include -#include -#include "TGeoManager.h" -#include "TCernLib.h" -#include "StEvent/StRnDHit.h" //???TempoHack??? -#include "StvHitLoader.h" -#include "StvStEventHitSelector.h" -#include "Stv/StvHit.h" -#include "Stv/StvToolkit.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StEvent.h" -#include "StHit.h" -#include "StEventUtilities/StEventHelper.h" -#include "StEventUtilities/StEventHitIter.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvDraw.h" -#include "Stv/StvStl.h" -#include "StvStEventHitSelector.h" -#include "Stv/StvToolkit.h" -ClassImp(StvHitLoader) - -StMatrixF Hack1to6(const StHit *stHit); - -//_____________________________________________________________________________ -StvHitLoader::StvHitLoader(const char *name) : TNamed(name,"") - -{ - mHitIter = new StEventHitIter(); - mHitSelector = 0; mHitLoadActor = 0; mNDets = 0; - memset(mMaxTimes,0,sizeof(mMaxTimes)); -} - -//_____________________________________________________________________________ -StvHitLoader::~StvHitLoader() -{ - delete mHitIter; -} - -//_____________________________________________________________________________ -void StvHitLoader::Clear(const char*) -{ - StTGeoProxy::Inst()->ClearHits(); -} - -//_____________________________________________________________________________ -Int_t StvHitLoader::Finish() -{ - return 0; -} - -//_____________________________________________________________________________ -Int_t StvHitLoader::Init() -{ - mNDets=0; - for (int id=1; idIsActive((StDetectorId)id)) continue; - mHitIter->AddDetector((StDetectorId)id); - mNDets++; - } - return mNDets; -} -//_____________________________________________________________________________ -int StvHitLoader::AddDetector(StDetectorId did) -{ - if (!StTGeoProxy::Inst()->IsActive((StDetectorId)did)) { - Warning("AddDetector","DetectorId=%d not active, ignored",(int)did); - return 13; - } - mHitIter->AddDetector((StDetectorId)did); - mNDets++; - return 0; -} -void StvHitLoader::SetHitSelector() -{ - mHitSelector = new StvStEventHitSelector; -} - -//_____________________________________________________________________________ -int StvHitLoader::LoadHits(const StEvent *stev) -{ -enum {kFCF_CHOPPED=256 // 0x100 cluster is chopped from its neighbour: OFFLINE use only - ,kFCF_SANITY =512}; // 0x200 cluster extents not sane -static int nCall=0; nCall++; -static int myGraph=0; -static StTGeoProxy* tgp = StTGeoProxy::Inst(); - tgp->SetHitLoadActor(mHitLoadActor); - -StvDraw *myDraw=0; -StvHits *myHits=0; -if (myGraph) { //create canvas - myDraw = new StvDraw(); - myHits = new StvHits; - if (myHits) {/*noopt*/} -} - mHitIter->Reset(stev); - int nSel = (mHitSelector)? mHitSelector->Edit(stev):-1; - if (!nSel) return 0; - const StHit *stHit=0; - StDetectorId didOld = kUnknownId; - int nTotHits = 0,nTotHitz=0,nTotGits=0, nHits=0,nHitz=0,nGits=0; - - for (; ; ++(*mHitIter)) { - stHit=*(*mHitIter); -// If hit selector is ON and hit is not marked, ignore it - StDetectorId did = mHitIter->DetectorId(); - - if (did != didOld || !stHit) { - if (didOld) { - Info("LoadHits","Loaded %d good, recovered %d and failed %d %s hits" - ,nHits,nHits-nGits,nHitz,StTGeoProxy::DetName(didOld)); - } - didOld = did; - - if (!stHit) break; - Info("LoadHits","Start %s hits",StTGeoProxy::DetName(did)); - if (mHitLoadActor) mHitLoadActor->SetDetId(did); - nHits=0; nHitz=0,nGits=0; - } - if (nSel> 0 && (!stHit->TestBit(StvStEventHitSelector::kMarked))) continue; // ignore not selected hit - if (stHit->flag() & kFCF_CHOPPED || stHit->flag() & kFCF_SANITY) continue; // ignore hits marked by AfterBurner as chopped o - mDetId = did; - int sure=0; - int nStvHits = MakeStvHit(stHit,mHitIter->UPath(),sure); -// if (!sure && mStvHit) { //Non reliable hit -// double rxy = sqrt(pow(mStvHit->x()[0],2)+pow(mStvHit->x()[1],2)); -// StvDebug::Count("OrphanHits",mStvHit->x()[2],rxy); -// } - - if (nStvHits) { - nHits+=nStvHits;nTotHits+=nStvHits;nGits+=sure;nTotGits+=sure; - if (mMaxTimes[mDetId]>1) mStvHit->setMaxTimes(mMaxTimes[mDetId]); - } - else {nHitz++;nTotHitz++;} - } - int nIniHits = tgp->InitHits(); - assert(nTotHits==nIniHits); - Info("LoadHits","Loaded %d good, recovered %d and failed %d of all hits" - ,nTotHits,nTotHits-nTotGits,nTotHitz); - return nTotHits; -} - -//_____________________________________________________________________________ -int StvHitLoader::MakeStvHit(const StHit *stHit,UInt_t upath, int &sure) -{ -static StTGeoProxy *tgh = StTGeoProxy::Inst(); -static StvToolkit *kit = StvToolkit::Inst(); - assert(stHit); - mStvHit = 0; - // StDetectorId did = stHit->detector(); - StDetectorId did = mDetId; - if (!did) { -static int knt=0;knt++; - printf("StvHitLoader::MakeStvHit(%d) No DETID***\n",knt); - return 0; - } - assert(did); - do { //May be errors exists - if (did==kTpcId) break; - StMatrixF errF(3,3); - int layer = -1; - do { - if (did != kFtsId) break; - layer = ((StRnDHit*)stHit)->layer(); - if (layer>6) break; - errF = Hack1to6(stHit); - } while(0); - if (errF[0][0]<=0) { - errF = stHit->covariantMatrix(); - } - assert(did!=kFtsId || errF[0][0]>1e-8); - if (errF[0][0]+errF[1][1]+errF[2][2]<1e-8) break; - assert(fabs(errF[0][1]-errF[1][0])<1e-8); - assert(fabs(errF[0][2]-errF[2][0])<1e-8); - assert(fabs(errF[1][2]-errF[2][1])<1e-8); - mStvHit = kit->GetHitRr(); - if (layer>6) mStvHit->SetCombo(1); - float *e = mStvHit->errMtx(); - for (int i=0,li=0;i< 3;li+=++i) { - for (int j=0;j<=i;j++) { e[li+j] = errF[i][j];}} - assert(e[0]>1e-8 && e[0]<64); - assert(e[0]*e[2]> e[1]*e[1] ); - assert(e[2]>1e-8 && e[2]<64); - assert(e[2]*e[5]>=e[4]*e[4] ); - assert(e[5]>= 0 && e[5]<64); - assert(e[0]*e[5]>=e[3]*e[3] ); - } while(0); - - if (!mStvHit) mStvHit= kit->GetHit(); - - int idTru = stHit->idTruth(); - if (idTru<0 && idTru>10000) idTru=0; - UInt_t hard = stHit->hardwarePosition(); - if (!hard) hard = upath; - StThreeVectorF v3f = stHit->position(); - const float *xyz = v3f.xyz(); - mStvHit->set(stHit,xyz); - mStvHit->setIdTru(idTru); - int seed = 1; - if (did == kTpcId) { // Special case for TPCHit. Prompt info added -// enum {zPrompt = 205,rMiddle=124}; - enum {zPrompt = 205,rMiddle=0}; - hard <<=1; hard |= (fabs(xyz[2]) > zPrompt); - if (xyz[0]*xyz[0]+xyz[1]*xyz[1] >rMiddle*rMiddle) seed = 1; - } else { -// the hits outside and with small mag field not for seed - const float* x = mStvHit->x(); - assert(fabs(x[0])+fabs(x[1])>1); - if (fabs(x[2])>250) { - static StvToolkit *tk = StvToolkit::Inst(); - if (tk->GetHA(x)<1./1000) seed = 0; - } } -//VP if (mStvHit->IsCombo()) seed = 0; - hard *= (unsigned int)kMaxDetectorId; hard+=(unsigned int)did; - - const StHitPlane *hp = tgh->AddHit(mStvHit,mDetId,xyz,hard,seed); - sure = tgh->IsGoodHit(); - if (!hp) { StvToolkit::Inst()->FreeHit(mStvHit); mStvHit = 0; return 0;} - - if (did == kTpcId && fabs(xyz[2])<200) {// TPC hit check for being in sector - const float* org = hp->GetOrg(xyz); - const float* ort = (fabs(org[2])<209)? hp->GetDir(xyz)[0]:hp->GetDir(xyz)[2]; - double art = atan2(ort[1],ort[0])*180/M_PI; - double arg = atan2(org[1],org[0])*180/M_PI; - assert(fabs(art-arg)<1.e-3); - - double dang = (atan2(ort[1],ort[0])-atan2(xyz[1],xyz[0]))*57.3; - if (dang> 180) dang-=360; - if (dang<-180) dang+=360; - if (fabs(dang)>17) printf("dang = %g\n",dang); - assert(fabs(dang)<31); - } - mStvHit->set(hp); - -#if 0 -static int nnn=0;nnn++; -printf("%d *** StvHitLoader::MakeStvHit %g %g %g ***\n",nnn - ,mStvHit->x()[0],mStvHit->x()[1],mStvHit->x()[2]); -StvDebug::Count("ZHits",mStvHit->x()[2]); -StvDebug::Count("XYHits",mStvHit->x()[1],mStvHit->x()[1]); -StvDebug::Count("ZXHits",mStvHit->x()[2],mStvHit->x()[0]); -StvDebug::Count("ZYHits",mStvHit->x()[2],mStvHit->x()[1]); -#endif - return 1; -} - -//_____________________________________________________________________________ -int StvHitLoader::TpcHitTest(const StHit *stHit) -{ - enum {nbpads = 73,maxpads=100}; - int tpads[maxpads] = { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, - 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, - 7, 8, 8, 8, 9, 9, 9,10,10,10, - 11,11,11,12,12,12,13,13,13,14, - 14,15,16,17,18,19,20,21,22,23, - 24,25,26,27,28,29,30,31,32,33, - 34,35,36,37,38,39,40,41,42,43, - 44,45,45}; - - int isdets[maxpads] = { 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, - 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, - 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, - 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2}; - - - StThreeVectorF v3f = stHit->position(); - TGeoNode *node = gGeoManager->FindNode(v3f[0],v3f[1],v3f[2]); - assert(node); - if (strncmp("TPA",node->GetName(),3)) return -1; - int numbv[3]; - for (int i=0;i<3;i++) { - node = gGeoManager->GetMother(i); - numbv[2-i] = node->GetNumber(); - } -//int tpgv = numbv[0]; -//int tpss = numbv[1]; -//int sector= tpss+12*(tpgv-1) ; - int tpad = numbv[2]; - int isdet = 0; - - if (tpad > nbpads) tpad -= nbpads; - isdet = isdets[tpad-1]; - tpad = tpads [tpad-1]; - if (isdet) { - Warning("TpcHitTest","TpcHit(%g,%g,%g) isdet=%d WRONG WRONG WRONG" - ,v3f[0],v3f[1],v3f[2], isdet); - } - return isdet; -} -//_____________________________________________________________________________ -void StvHitLoader::SetMaxTimes(int maxTimes,const char *detector) -{ - StDetectorId id = kUnknownId; - if (detector[0]!='*') { - id = detectorIdByName(detector); - assert(id); - } - SetMaxTimes(maxTimes,id); -} -//_____________________________________________________________________________ -void StvHitLoader::SetMaxTimes(int maxTimes,StDetectorId id) -{ - if (id) {mMaxTimes[id] = maxTimes; return; } - for (int i=1;i<=kMaxDetectorId;i++) { mMaxTimes[i]=maxTimes;} -} - -//_____________________________________________________________________________ -StMatrixF Hack1to6(const StHit *stHit) -{ -// X = R*cos(Fi), Y=R*sin(Fi), Z = z -// dX/dR = ( cos(Fi) ,sin(Fi),0) -// dX/dFi = (-R*sin(Fi), R*cos(Fi),0) -// dX/dZ = ( 0, 0,1) - - auto hiPos = stHit->position(); - auto hiErr = stHit->positionError(); - double Rxy = sqrt(hiPos[0]*hiPos[0]+hiPos[1]*hiPos[1]); - double cosFi = hiPos[0]/Rxy; - double sinFi = hiPos[1]/Rxy; - double T[3][3] = {{cosFi,-Rxy*sinFi,0} - ,{sinFi, Rxy*cosFi,0} - ,{ 0, 0,1}}; - double Ginp[6] = { hiErr[0]*hiErr[0] - , 0,hiErr[1]*hiErr[1] - , 0, 0,hiErr[2]*hiErr[2]}; - double Gout[6]; - - TCL::trasat(T[0],Ginp,Gout,3,3); - StMatrixF mtxF(3,3); - - for (int i=0,li=0;i< 3;li+=++i) { - for (int j=0;j<=i;j++) {mtxF[i][j] = Gout[li+j]; mtxF[j][i] = mtxF[i][j];}} - - return mtxF; -} diff --git a/StRoot/StvMaker/StvHitLoader.h b/StRoot/StvMaker/StvHitLoader.h deleted file mode 100644 index 6646910f499..00000000000 --- a/StRoot/StvMaker/StvHitLoader.h +++ /dev/null @@ -1,49 +0,0 @@ -//StvHitLoader.h - -#ifndef StvHitLoader_HH -#define StvHitLoader_HH - -#include - -#include "TNamed.h" -#include "StEvent/StEnumerations.h" - - -class StEvent; -class StHit; -class StvHit; -class StEventHitIter; -class StActorFunctor; -class StvStEventHitSelector; -class StvHitLoader : public TNamed -{ - public: - - StvHitLoader(const char* name = "StHitsLoader"); - virtual ~StvHitLoader(); - void Clear(const char* opt=""); - int Init(); - void SetHitSelector(); - void SetHitActor(StActorFunctor *act) {mHitLoadActor=act;} - int LoadHits(const StEvent *stev); - int Finish(); - int AddDetector(StDetectorId did); - int NumDetectors() const {return mNDets;}; - void SetMaxTimes(int maxTimes,const char *detectcor="*"); - void SetMaxTimes(int maxTimes,StDetectorId detiD); - protected: -virtual int MakeStvHit(const StHit *stHit,UInt_t upath,int &sure); - - int TpcHitTest(const StHit *stHit); - private: - int mNDets; - StDetectorId mDetId; - StvHit *mStvHit; - StEventHitIter *mHitIter; - StvStEventHitSelector *mHitSelector; - StActorFunctor *mHitLoadActor; - int mMaxTimes[kMaxDetectorId+1]; - ClassDef(StvHitLoader,0) -}; - -#endif diff --git a/StRoot/StvMaker/StvMaker.cxx b/StRoot/StvMaker/StvMaker.cxx deleted file mode 100644 index 51c58592e1f..00000000000 --- a/StRoot/StvMaker/StvMaker.cxx +++ /dev/null @@ -1,647 +0,0 @@ -// $Id: StvMaker.cxx,v 1.61 2017/09/29 16:54:51 perev Exp $ -/*! -\author V Perev 2010 - -A maker StvMaker is a steering maker for Stv package. -
-Main tasks: -
    -
  • Create StvHits; -
  • Make tracks; -
  • Make Primary vertices; -
  • Make Primary tracks; -
  • Save produced data into StEvent. -
-More detailed:
-
    -
  • On Init: -
      -
    • Detectors initialization. - - SetAttr("useEventFiller" ,kTRUE); // default On - SetAttr("useTracker" ,kTRUE); // default On - SetAttr("useVertexFinder" ,kTRUE); // default On - SetAttr("makePulls" ,kFALSE); // default Off - - SetAttr("noTreeSearch",kFALSE); // treeSearch default ON -
    - -
  • On InitRun: -
      -
    • Build detectors; -
    • Init seed finder; -
    • Init hit loader; -
    • Init tracker; -
    • Init StEvent filler; -
    • Init vertex finder; -
    -
  • In Make: -
      -
    • Load hits; -
    • Find seeds; -
    • Create global tracks; -
    • Save tracks into StEvent; -
    • Find vertecies; -
    • Create and assign primaries tracks; -
    • Save primary tracks into StEvent; - -*/ -#include -#include -#include -#include "TSystem.h" -#include "TROOT.h" -#include "TFile.h" -#include "TTree.h" -#include "TTable.h" -#include "TCernLib.h" -#include "TGeoManager.h" -#include "StDetectorId.h" -#include "StEvent.h" -#include "StEnumerations.h" -#include "StChainOpt.h" -#include "StvMaker.h" -#include "StarVMC/GeoTestMaker/StVMCApplication.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -//#include "StvMCInitApp.h" -#include "Stv/StvConst.h" -#include "Stv/StvHit.h" -#include "StvUtil/StvPullEvent.h" -#include "Stv/StvDiver.h" -#include "StvHitLoader.h" -//#include "StvFtsHitLoader.h" -//#include "StvUtil/StvFtsHitErrCalculator.h" -#include "Stv/StvToolkit.h" -#include "Stv/StvSeedFinder.h" -#include "Stv/StvKalmanTrackFinder.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvFitter.h" -#include "Stv/StvKalmanTrackFitter.h" -#include "StvStEventFiller.h" -#include "StvStarVertexFinder.h" -#include "StvTpcActive.h" -#include "Stv/StvTrack.h" -#include "Stv/StvNode.h" -#include "StvStEventMaker.h" -#include "TString.h" -#include "TObjString.h" - -/// Definion of minimal primary vertex errors. -/// Typical case,vertex got from simulations with zero errors. -/// But zero errors could to unpredicted problems -/// Now minimal possible error is 1 micron -static const float MIN_VTX_ERR2 = 1e-4*1e-4; -enum {kMidEta=1,kForwEta=2}; - -ClassImp(StvMaker) -//_____________________________________________________________________________ -StvMaker::StvMaker(const char *name) : StMaker(name) - -{ - assert(strcmp(gProgName,"root.exe")==0); - memset(mBeg,0,mEnd-mBeg+1); - cout <<"StvMaker::StvMaker() -I- Starting"<Clear(); - StMaker::Clear(); -} - -//_____________________________________________________________________________ -Int_t StvMaker::Finish() -{ - StTGeoProxy::Inst()->Finish(); - return StMaker::Finish(); -} - -//_____________________________________________________________________________ -Int_t StvMaker::Init() -{ -// Add maker immediately after Input maker to cleanup StEvent - StvStEventMaker *mk =StvStEventMaker::Inst(); - if (mk) mk->Init(); - return StMaker::Init(); -} - -//_____________________________________________________________________________ -Int_t StvMaker::InitDetectors() -{ - - StTGeoProxy *tgh = StTGeoProxy::Inst(); - -// Check is Stv is running in fit hit error utility - - mFETracks = IAttr("fiterr"); - if (mFETracks>0) SetAttr(".privilege",1,""); - -// TGeo herlper is ready, add error calculators - int actTpc = IAttr("activeTpc"); - mEtaRegion = 0; - if (actTpc) { //TPC error calculators - mHitLoader[0]->AddDetector(kTpcId); - - mEtaRegion|= kMidEta; - - const char* innOutNames[] = {"StvTpcInnerHitErrs" ,"StvTpcOuterHitErrs" - ,"StvTpcInnerPromptErrs" ,"StvTpcOuterPromptErrs",0}; - const char* innOut = 0; - for (int io=0;(innOut=innOutNames[io]);io++) { - TTable *tt = 0; - StvHitErrCalculator *hec = 0; - int nDo = !!mFETracks; - for (int iDo=0; iDo<=nDo; iDo++) { - TString myName(innOut); if (mFETracks && !iDo) myName+="FE"; - switch (io) { - case 0:; case 1: hec = new StvTpcHitErrCalculator(myName); break; - case 2:; case 3: hec = new StvHitErrCalculator (myName); break; - default: assert(0 && "Wrong tpcActive value"); - } - TString ts("Calibrations/tracker/"); - ts+=myName; - tt = (TTable*)GetDataBase(ts); - if (!tt) Error("Make","Table %s NOT FOUND",ts.Data()); - } - assert(tt); - hec->SetPars((double*)tt->GetArray()); - StvTpcSelector*sel = new StvTpcSelector(innOut); - int nHP = tgh->SetHitErrCalc(kTpcId,hec,sel); - Info("Init","%s: %d HitPlanes",innOut,nHP); - assert(nHP); - } - -// After 2009 tpcegeo3 is used - mHitLoader[0]->SetHitActor(new StvTpcHitActor); - } - - if (IAttr("activeEtr")) { //Etr error calculators - mHitLoader[0]->AddDetector(kEtrId); - TString myName("EtrHitErrs"); if (mFETracks) myName+="FE"; - StvHitErrCalculator *hec = new StvHitErrCalculator(myName,2); - double etrPars[StvHitErrCalculator::kMaxPars]={9e-4,9e-4}; - hec->SetPars(etrPars); - int nHP = tgh->SetHitErrCalc(kEtrId,hec,0); - Info("Init","%s: %d HitPlanes","EtrHitErrs",nHP); - assert(nHP); - } - - if (IAttr("activeFgt")) { // FGT error calculator - mHitLoader[1]->AddDetector(kFgtId); - mEtaRegion |= kForwEta; - TString myName("FgtHitErrs"); if (mFETracks) myName+="FE"; - StvHitErrCalculator *hec = new StvHitErrCalculator(myName, 2); - Double_t fgtPars[ StvHitErrCalculator::kMaxPars]={ - 9e-4,9e-4, - }; - hec -> SetPars( fgtPars ); - Int_t nHP = tgh->SetHitErrCalc(kFgtId,hec,0); - Info("Init","%s: %d Hitplanes", "FgtHitErrs", nHP); - } - if (IAttr("activeSst")) { // Sst error calculator - mHitLoader[0]->AddDetector(kSstId); - - } - if (IAttr("activeIst")) { // IST error calculator - mHitLoader[0]->AddDetector(kIstId); - mEtaRegion |= kMidEta; - TString myName("IstHitErrs"); if (mFETracks) myName+="FE"; - StvHitErrCalculator *hec = new StvHitErrCalculator(myName, 2); - TString ts("Calibrations/tracker/Stv");ts+=myName; - TTable *tt = (TTable*)GetDataBase(ts); - if (!tt) Error("Make","Table %s NOT FOUND",ts.Data()); - assert(tt); - hec->SetPars((double*)tt->GetArray()); - Int_t nHP = tgh->SetHitErrCalc(kIstId,hec,0); - Info("Init","%s: %d Hitplanes", "IstHitErrs", nHP); - } - - if (IAttr("activePxl")) { // PXL error calculator - mHitLoader[0]->AddDetector(kPxlId); - TString myName("PxlHitErrs"); if (mFETracks) myName+="FE"; - StvHitErrCalculator *hec = new StvHitErrCalculator(myName, 2); - TString ts("Calibrations/tracker/Stv");ts+=myName; - TTable *tt = (TTable*)GetDataBase(ts); - if (!tt) Error("Make","Table %s NOT FOUND",ts.Data()); - assert(tt); - hec->SetPars((double*)tt->GetArray()); - Int_t nHP = tgh->SetHitErrCalc(kPxlId,hec,0); - Info("Init","%s: %d Hitplanes", "PxlHitErrs", nHP); - } -#ifndef kFtsIdentifier -#error -#endif -#ifdef kFtsIdentifier - if (IAttr("activeFts")) { // FTS error calculator - mHitLoader[1]->AddDetector(kFtsId); - TString myName("FtsHitErrs"); - auto *hec = (StvHitErrCalculator*)gROOT->ProcessLineFast("new StvFtsHitErrCalculator()"); - Int_t nHP = tgh->SetHitErrCalc(kFtsId,hec,0); - Info("Init","%s: %d Hitplanes", "FtsHitErrs", nHP); - } -#endif - -// In case of fithiterr utility working, selects special hits to speedup - if (mFETracks) mHitLoader[0]->SetHitSelector(); - - return kStOk; -} - -//_____________________________________________________________________________ -Int_t StvMaker::InitRun(int run) -{ -static int initialized = 0; - if (initialized) return 0; - -// Geometry via DBMaker - TDataSet *myGeo = GetDataBase("VmcGeometry"); if (myGeo){}; - assert (gGeoManager); - - - StTGeoProxy *tgh = StTGeoProxy::Inst(); - if (*SAttr("HitLoadOpt")) tgh->SetOpt(IAttr("HitLoadOpt")); - -// What is the geo version - TString geoName(gGeoManager->GetName()); geoName.ToLower(); - -// Activate detectors -#ifdef kFtsIdentifier - if (IAttr("activeFts")) { int nakt = tgh->SetActive(kFtsId ); - assert(nakt); - SetAttr("activeTpc",0); - tgh->ls("SscA"); - } -#endif - if (IAttr("activeTpc")) { assert(tgh->SetActive(kTpcId,1,new StvTpcActive));} - if (IAttr("activeEtr")) { assert(tgh->SetActive(kEtrId ));} - if (IAttr("activeFgt")) { assert(tgh->SetActive(kFgtId ));} - if (IAttr("activeSst")) { assert(tgh->SetActive(kSstId ));} - if (IAttr("activeIst")) { assert(tgh->SetActive(kIstId ));} - if (IAttr("activePxl")) { assert(tgh->SetActive(kPxlId ));} - if (IAttr("activePixel")){assert(tgh->SetActive(kPxlId ));} - -// Now Initialize TGeo proxy - tgh->Init(1+2+4); - - if (IAttr("activeTpc")) { //prompt hits for geo >=y2009 - StvTpcPrompt promp; - tgh->InitHitPlane(&promp); - -// TPC has non standard TGeo. Edit it - StvTpcEdit tpce; - int nEdit = tgh->Edit(kTpcId,&tpce); //Disable fake padrows - Info("InitDetectors","%d fake TPC padrows disabled",nEdit); - }//End Tpc special - - - tgh->InitLayers(); - tgh->InitHitShape(); - - tgh->Summary(); - - - StVMCApplication *app = new StVMCApplication("StVMC", "StVMC application"); - StvMCInitApp *ini = new StvMCInitApp(); - app->SetInit(ini); - app->Init(); - - -// Choose seed finders - assert(gSystem->Load("StvSeed.so")>=0); - const char *seedAtt[2]={"seedFinders","SeedFinders.fw"}; - mMaxTimes = IAttr("setMaxTimes"); - for (int jreg=0;jreg<2; jreg++) { //0=midEta,1=forwardEta - mHitLoader[jreg] = new StvHitLoader; - if (mMaxTimes>1)mHitLoader[jreg]->SetMaxTimes(mMaxTimes); - mSeedFinders[jreg] = new StvSeedFinders; - if (IAttr("useEventFiller")) - mEventFiller[jreg]= new StvStEventFiller; - if (IAttr("useVertexFinder")) - mVertexFinder[jreg] = new StvStarVertexFinder("GenericVertex"); - mTrackFinder[jreg] = new StvKalmanTrackFinder; - mTrackFitter[jreg] = new StvKalmanTrackFitter; - int iRefit = IAttr("Refit"); - mTrackFinder[jreg]->SetRefit(iRefit); - - - TString seeds = SAttr(seedAtt[jreg]); - if (!seeds.Length()) seeds = "Default"; - TObjArray *tokens = seeds.Tokenize(" .,"); - int seedErr=0; - const char *seedNick[]={"CA" ,"Default" ,"KNN" ,"Fts" ,0}; - const char *seedNews[]={"new StvCASeedFinder","new StvDefaultSeedFinder","new StvKNSeedFinder","new StvDefaultSeedFinder",0}; - - - for (int idx=0;idx<=tokens->GetLast();idx++) { - TString &chunk = ((TObjString*)tokens->At(idx))->String(); - for (int nick=0;seedNick[nick];nick++) { - if (chunk.CompareTo(seedNick[nick],TString::kIgnoreCase)!=0) continue; - if (nick==0) { - assert(gSystem->Load("Vc.so")>=0); - assert(gSystem->Load("TPCCATracker.so") >=0); - } - StvSeedFinder *mySeedFinder = (StvSeedFinder*)gROOT->ProcessLineFast(seedNews[nick],&seedErr); - if (IAttr("truthSeedFinder")) mySeedFinder->SetIdTruth(); - if (TString(seedNick[nick])=="Fts") mySeedFinder->SetSgn(-1); - assert(mySeedFinder && !seedErr); - mSeedFinders[jreg]->Add(mySeedFinder); - Info("InitRun","Added %s seed finder",mySeedFinder->GetName()); - } - }; - delete tokens; - }//end of Eta regions - - - InitDetectors(); - - - int reg = 0; - do { - if (mHitLoader[reg] && mHitLoader[reg]->NumDetectors()==0) mHitLoader[reg]=0; ; - if (mHitLoader[reg]) break; - mSeedFinders[reg] = 0; - mEventFiller[reg] = 0; - mTrackFinder[reg] = 0; - mTrackFitter[reg] = 0; - } while (0); - - reg = 1; - do { - if (mHitLoader[reg] && mHitLoader[reg]->NumDetectors()==0) mHitLoader[reg]=0; ; - if (mHitLoader[reg]) break; - mSeedFinders[reg] = 0; - mEventFiller[reg] = 0; - mTrackFinder[reg] = 0; - mTrackFitter[reg] = 0; - mVertexFinder[reg]= 0; - } while(0); - - - InitPulls(); - - new StvFitter(); - - return StMaker::InitRun(run); -} - -//_____________________________________________________________________________ -Int_t StvMaker::Make() -{ -static const StvConst *kons = new StvConst(); -static StvToolkit* kit = StvToolkit::Inst(); - cout <<"StvMaker::Make() -I- Starting on new event"<(GetInputDS("StEvent")); - - if (!event) return kStWarn; - - for (int reg=0;reg<2;reg++) { //Loop over eta regions - const auto *par = kons->At(reg); - if (mHitLoader[reg]){ - mSeedFinders [reg]->SetCons(par); - mEventFiller [reg]->SetCons(par); - mTrackFitter [reg]->SetCons(par); - mCurTrackFitter = mTrackFitter[reg]; - mTrackFinder [reg]->SetCons(par); - mCurTrackFinder = mTrackFinder[reg]; - mCurTrackFinder->SetFitter(mCurTrackFitter); - } - if (mVertexFinder[reg]) - mVertexFinder[reg]->SetCons(par); - - if (mHitLoader[reg]) { - mHitLoader[reg]->LoadHits(event); - kit->SetSeedFinders(mSeedFinders[reg] ); - kit->Reset(); - int n = (nVtx)? nVtx:1; - for (int i=0;ix():0; - mSeedFinders[reg]->SetVtx(V); - int nTks = mTrackFinder[reg]->FindTracks(); - if (mMaxTimes>1) nTks = CleanGlobalTracks(); - TestGlobalTracks(); - mToTracks += nTks; - } - } - if (mEventFiller[reg]) { - mEventFiller[reg]->Set(event,&kit->GetTracks()); - mEventFiller[reg]->fillEvent(); - } - - do {//pseudo loop - if (!mVertexFinder[reg]) break; - nVtx = mVertexFinder[reg]->Fit(event); - if (!nVtx) break; - Info("Make","VertexFinder found %d vertices",nVtx); - vertexes = &mVertexFinder[reg]->Result(); - if (!vertexes->size()) break; - //Set minimal errors - for (size_t i=0;isize();i++) { - StvHit *vtx=(*vertexes)[i]; - float *vtxErr = vtx->errMtx(); - if (vtxErr[5]>MIN_VTX_ERR2) continue; - memset(vtxErr,0,sizeof(vtxErr[0])*6); - vtxErr[0]=MIN_VTX_ERR2; - vtxErr[2]=MIN_VTX_ERR2; - vtxErr[5]=MIN_VTX_ERR2; - } - } while(0); - //cout << "StvMaker::Make() -I- Got Vertex; extend Tracks"<FindPrimaries(*vertexes); - if (mEventFiller[reg]) - mEventFiller[reg]->fillEventPrimaries(); - } - }//end regions - if (mPullTTree) {FillPulls();} - - cout<< "StvMaker::Make() -I- Done"<Clear(); - StTGeoProxy::Inst()->Clear(); - if (mFETracks && mToTracks>mFETracks) return kStEOF; - return kStOK; -} -//_____________________________________________________________________________ -Int_t StvMaker::InitPulls() -{ - if (!IAttr("makePulls")) return 0; - - const StChainOpt *bfc = GetChainOpt(); - assert(bfc); - TFile *tfile = GetTFile(); - if (!tfile) { - TString ts = bfc->GetFileIn(); - ts= gSystem->BaseName(ts); - int ext = ts.Index("."); - if (ext>0) ts.Replace(ext,999,""); - ts +=".stipull.root"; - tfile = mPullFile = new TFile(ts,"RECREATE","TTree Stv Pulls ROOT file"); - } - tfile->cd(); - mPullTTree = new TTree("StvPulls","TTree Stv pulls"); - mPullTTree->SetAutoSave(10000000); // autosave when 0.01 Gbyte written - mPullEvent = new StvPullEvent; - TBranch *branch = mPullTTree->Branch("event", mPullEvent->ClassName(),&mPullEvent, 16000,99); - branch->SetAutoDelete(kFALSE); - if (mEventFiller[0])mEventFiller[0]->Set(mPullEvent); - if (mEventFiller[1])mEventFiller[1]->Set(mPullEvent); - return 0; -} -//_____________________________________________________________________________ -Int_t StvMaker::FillPulls() -{ - StEvtHddr *hddr = GetEvtHddr(); - mPullEvent->mRun = hddr->GetRunNumber(); - mPullEvent->mEvt = hddr->GetEventNumber(); - mPullEvent->mDate = hddr->GetDateTime(); //DAQ time (GMT) - const StvHit *vertex = 0; int nMaxTks=0,ivertex=0; - if (mVertexFinder[0] && mVertexFinder[0]->Result().size()) { - int nVtx = mVertexFinder[0]->Result().size(); - for (int iv=0;ivResult()[iv]; - if (nMaxTks > hit->getCount()) continue; - nMaxTks = hit->getCount(); - vertex = hit; ivertex = iv+1; - } } - mPullEvent->mChi2 = 0; - memset(mPullEvent->mVtx,0,sizeof(mPullEvent->mVtx)); - memset(mPullEvent->mEtx,0,sizeof(mPullEvent->mEtx)); - if (vertex) { - mPullEvent->mIVtx = ivertex; - mPullEvent->mVtx[0] = vertex->x()[0]; - mPullEvent->mVtx[1] = vertex->x()[1]; - mPullEvent->mVtx[2] = vertex->x()[2]; - TCL::ucopy(vertex->errMtx(),mPullEvent->mEtx,6); - } - mPullEvent->Finish(); - mPullTTree->Fill(); - mPullEvent->Clear(); - return kStOK; -} -//_____________________________________________________________________________ -int StvMaker::GeoTest() -{ - int ierr=0; - if (!gGeoManager) return 1; - for (int phi = 60,sect=1;phi>=-360+90;phi -=30,sect++) - { - double x = 100*cos(phi*3.1415/180); - double y = 100*sin(phi*3.1415/180); - double z = 100.; - TGeoNode *node = gGeoManager->FindNode(x,y,z);if(node){}; - TGeoNode *parn = gGeoManager->GetMother(1); - if (sect != parn->GetNumber()) ierr++; - - const char *path = gGeoManager->GetPath(); - printf("Sector=%d path=%s\n",sect,path); - - - } - for (int phi = 120,sect=13;sect<=24;phi +=30,sect++) - { - double x = 100*cos(phi*3.1415/180); - double y = 100*sin(phi*3.1415/180); - double z = -100.; - TGeoNode *node = gGeoManager->FindNode(x,y,z);if(node){}; - TGeoNode *parn = gGeoManager->GetMother(1); - if (sect-12 != parn->GetNumber()) ierr++; - const char *path = gGeoManager->GetPath(); - printf("Sector=%d path=%s\n",sect,path); - } -return ierr; -} -//________________________________________________________________________________ -static bool TrackCompareStatus(const StvTrack *a, const StvTrack *b) -{ - int nA = a->GetNHits(); - int nB = b->GetNHits(); - if (nA!=nB) return (nA > nB); - return (a->GetXi2Aux() GetXi2Aux()); -// return (a->GetXi2W()GetXi2W()); -} -//_____________________________________________________________________________ -int StvMaker::CleanGlobalTracks() -{ -static StvToolkit *kit = StvToolkit::Inst(); - StvTracks &trackContainer = kit->GetTracks(); - - for (auto it = trackContainer.begin(); it!=trackContainer.end(); ++it) - { - auto* kTrack = *it; - kTrack->SetUnused(); - } - trackContainer.sort(TrackCompareStatus ); - - for (auto it = trackContainer.begin(); it!=trackContainer.end();) - { - auto* kTrack =*it; - int nHits=0,nNits=0; - for (auto nodeIt =kTrack->begin();nodeIt!=kTrack->end();nodeIt++) - { - auto *node = *nodeIt; - StvHit *hit = node->GetHit(); if (!hit) continue; - if (hit->timesUsed()) { nNits++; node->SetHit(0) ;} - else { nHits++; hit->setTimesUsed(1);} - } - if (nHits<4) { it = trackContainer.erase(it); continue; } - StvNode *dcaNode = kTrack->GetNode(StvTrack::kDcaPoint); - if (dcaNode) { - kTrack->remove(dcaNode); - } - - - int ans = mCurTrackFitter->Refit(kTrack,1); - if (ans || kTrack->GetNHits()<4) { it = trackContainer.erase(it); continue; } - mCurTrackFinder->MakeDcaNode(kTrack); - ++it; - } - - for (auto it = trackContainer.begin(); it!=trackContainer.end(); ++it) - { - auto* kTrack = *it; - for (auto nodeIt =kTrack->begin();nodeIt!=kTrack->end();nodeIt++) - { - auto *node = *nodeIt; - auto *hit = node->GetHit(); if (!hit) continue; - assert(hit->timesUsed()==1); - } - } - return trackContainer.size(); -} - -//_____________________________________________________________________________ -int StvMaker::TestGlobalTracks() const -{ -static StvToolkit *kit = StvToolkit::Inst(); - StvTracks &trackContainer = kit->GetTracks(); - - for (auto it = trackContainer.begin(); it!=trackContainer.end(); ++it) - { - auto* kTrack = *it; - int nHits = kTrack->GetNHits(); - StvDebug::Count("IdQua_vs_NHits",nHits,kTrack->GetQua()*100); - } - return 0; -} diff --git a/StRoot/StvMaker/StvMaker.h b/StRoot/StvMaker/StvMaker.h deleted file mode 100644 index d74beaba0f1..00000000000 --- a/StRoot/StvMaker/StvMaker.h +++ /dev/null @@ -1,73 +0,0 @@ -//StvMaker.h - -#ifndef StvMaker_HH -#define StvMaker_HH - -#include - -#include "StMaker.h" -#include "StEvent/StEnumerations.h" - -class TFile; -class TTree; -class StvPullEvent; -class StEvent; -class StvHit; -class StvHitLoader; -class StvTrack; -class StvTrackContainer; -class StvTrackFinder; -class StvTrackFitter; -class StvTrackNode; -class StvTrack; -class StvToolkit; -class StvVertexFinder; -class StvEventFiller; -class StvSeedFinders; - -class StvMaker : public StMaker -{ - public: - - StvMaker(const char* name = "Stv"); - virtual ~StvMaker(); - virtual void Clear(const char* opt=""); - virtual int Init(); - int InitDetectors(); - int InitPulls(); - int FillPulls(); - virtual int InitRun(int); - virtual int Make(); - virtual int Finish(); - int CleanGlobalTracks(); - int TestGlobalTracks() const; - - virtual const char* GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StvMaker.h,v 1.9 2018/01/28 00:49:01 perev Exp $ built " __DATE__ " " __TIME__; return cvs;} - - - - protected: - int GeoTest(); -private: - char mBeg[1]; - int mEtaRegion; //bit0:TpcLike medium eta,bit1:Forward eta - StvHitLoader *mHitLoader[2]; - StvSeedFinders *mSeedFinders[2]; - StvEventFiller *mEventFiller[2]; - StvTrackFinder *mTrackFinder[2]; - StvTrackFinder *mCurTrackFinder; - StvTrackFitter *mCurTrackFitter; - StvTrackFitter *mTrackFitter[2]; - StvVertexFinder *mVertexFinder[2]; - TFile *mPullFile; - StvPullEvent *mPullEvent; - TTree *mPullTTree; - int mMaxTimes; //max times hit reused - int mFETracks; //max number of track requested if fit hit errs - int mToTracks; //total tracks created, if > mFETracks, stop - char mEnd[1]; - ClassDef(StvMaker,0) -}; - -#endif diff --git a/StRoot/StvMaker/StvStEventFiller.cxx b/StRoot/StvMaker/StvStEventFiller.cxx deleted file mode 100755 index c3ff1f9a4fe..00000000000 --- a/StRoot/StvMaker/StvStEventFiller.cxx +++ /dev/null @@ -1,1610 +0,0 @@ -/*************************************************************************** - * - * $Id: StvStEventFiller.cxx,v 1.43 2016/11/29 17:13:20 perev Exp $ - * - * Author: Manuel Calderon de la Barca Sanchez, Mar 2002 - *************************************************************************** - * - * $Log: StvStEventFiller.cxx,v $ - * Revision 1.43 2016/11/29 17:13:20 perev - * HideFts - * - * Revision 1.42 2016/11/28 01:38:51 perev - * Change max hits 1000>256 (loopers) - * - * Revision 1.41 2015/12/12 00:57:10 perev - * Separate mid and forward rapidity - * - * Revision 1.40 2015/11/11 01:57:06 perev - * Added SetCons(const StvKonst_st *kons) - * Now old constants like kMinHits, kGood hits etc become variable defined by SetCons - * It allows have to StEventFiller's with different constants - * Typical use case: mid rapidity (Tpc,Hft ..) and separately forward, big rapidity - * with different constants - * - * Revision 1.39 2015/10/30 19:39:33 perev - * do not fill detector id == 0 - * - * Revision 1.38 2015/06/18 02:17:14 perev - * Fix printout of counting used hits - * - * Revision 1.37 2015/06/10 17:28:21 perev - * Print of used hits (from Sti) added - * - * Revision 1.36 2013/10/31 16:11:19 perev - * test for minDca ==> fabs(minDca) - * - * Revision 1.35 2013/10/02 19:12:31 perev - * MaxTrackLen = 1500 now - * - * Revision 1.34 2013/09/27 20:35:46 perev - * Return fix topology map - * - * Revision 1.33 2013/07/02 04:07:48 perev - * add dca00 to pull tree - * - * Revision 1.32 2013/06/23 23:31:58 perev - * Assert++ - * - * Revision 1.31 2013/06/16 00:44:58 perev - * Cleanup - * - * Revision 1.30 2013/05/24 16:34:38 perev - * Introduction hit filter in case HitFitErr - * - * Revision 1.29 2013/05/20 18:38:52 perev - * Cleanup - * - * Revision 1.28 2013/04/20 22:02:42 perev - * Rename StTGeoHelper ==> StTGeoProxy - * - * Revision 1.27 2013/04/15 00:41:42 perev - * outdated assert removed - * - * Revision 1.26 2013/04/10 03:37:25 perev - * account non Tpc hits with waight =2 - * - * Revision 1.25 2013/03/20 20:52:07 perev - * Remove StuTopTopologyMap... - * - * Revision 1.24 2013/03/08 19:18:37 perev - * not setting huge impact if no vertice - * - * Revision 1.23 2013/02/20 00:26:59 perev - * remove deleteing Emc data in fillEvent() - * - * Revision 1.22 2013/02/16 01:25:10 perev - * fix double count in nallhits - * - * Revision 1.21 2012/10/21 22:56:56 perev - * Add IdTruth into pulls - * - * Revision 1.20 2012/06/21 01:10:54 perev - * Cleanup - * - * Revision 1.19 2012/05/15 17:54:13 perev - * Avoid Dca node in fillFitTraits - * - * Revision 1.18 2012/04/27 01:43:08 perev - * Use totFitsPointNumber for flag setting - * - * Revision 1.17 2012/04/10 22:42:13 perev - * Cleanup - * - * Revision 1.16 2012/03/22 00:19:14 perev - * Cleanup - * - * Revision 1.15 2012/02/23 18:13:15 perev - * Cleanup - * - * Revision 1.14 2011/11/18 23:34:40 perev - * Global impact fixed - * - * Revision 1.13 2011/10/26 20:35:39 perev - * Temporary fix primary hit ignored - * - * Revision 1.12 2011/10/07 19:35:46 perev - * StTrack::mKey short==>int - * - * Revision 1.11 2011/08/31 19:50:17 perev - * fix assert for small rxy - * - * Revision 1.10 2011/08/19 02:40:43 perev - * Add errors - * - * Revision 1.9 2011/08/13 23:00:50 perev - * wrong order o vtx accounted - * - * Revision 1.8 2011/07/19 20:05:37 perev - * Dca00 for primary into StvPull - * - * Revision 1.7 2011/05/04 17:57:37 perev - * Typo fixed - * - * Revision 1.6 2011/04/03 20:45:11 perev - * Cleanup - * - * Revision 1.5 2011/02/05 21:57:55 perev - * Test for +ve error matrix added - * - * Revision 1.4 2010/12/20 20:33:48 perev - * Cleanup of mTrackNumber in StvPulls - * - * Revision 1.3 2010/12/16 21:50:40 perev - * Primary track fit - * - * Revision 1.2 2010/09/29 23:39:25 perev - * Intereface fillPulls(...) chamnged - * - * Revision 1.1 2010/07/06 20:27:53 perev - * Alpha version of Stv (Star Tracker Virtual) - * - * Revision 1.2 2010/07/03 16:27:15 perev - * Last time name Stv - * - * Revision 1.1 2010/06/22 19:34:28 perev - * EventFiller added - * - * Revision 2.90 2010/01/27 21:43:49 perev - * Add _nPrimTracks for case of fiterr - * - * Revision 2.89 2009/10/18 22:47:29 perev - * assert instead of skip - * - * Revision 2.88 2009/10/16 14:56:02 fisyak - * Add check that pHit exists - * - * Revision 2.87 2009/10/15 03:29:30 perev - * Add primary vertex number and charge(GVB) - * - * Revision 2.86 2009/08/19 21:27:57 perev - * Account time of flight for StvPulls - * - * Revision 2.85 2009/03/16 13:50:14 fisyak - * Move out all Stv Chairs into StDetectorDb - * - * Revision 2.84 2008/08/22 13:32:52 fisyak - * add one more digit in trakc flag, mFlag=zxyy, where z = 1 for pile up track in TPC (otherwise 0) - * - * Revision 2.83 2008/04/03 20:04:05 fisyak - * Straighten out DB access via chairs - * - * Revision 2.82 2007/10/17 15:32:35 fisyak - * rename Hft => Pxl - * - * Revision 2.81 2007/04/16 22:47:18 perev - * aux.mPt is +ve - * - * Revision 2.80 2007/03/21 17:51:36 fisyak - * adjust for ROOT 5.14 - * - * Revision 2.79 2006/12/19 19:46:09 perev - * Filling pull tracks added - * - * Revision 2.78 2006/12/18 01:30:39 perev - * fillPulls reorganized - * - * Revision 2.77 2006/08/31 03:25:58 fisyak - * Make cut for EEMC pointing track based on StTrackDetectorInfo instead of StTrackFitTraits - * - * Revision 2.76 2006/08/29 22:18:37 fisyak - * move filling of StTrackDetectorInfo into fillTrack - * - * Revision 2.75 2006/08/28 17:02:23 fisyak - * Add +x11 short tracks pointing to EEMC, clean up StvDedxCalculator - * - * Revision 2.74 2006/06/16 21:28:57 perev - * FillStHitErr method added and called - * - * Revision 2.73 2006/05/31 03:59:04 fisyak - * Add Victor's dca track parameters, clean up - * - * Revision 2.72 2006/04/07 18:00:30 perev - * Back to the latest Stv - * - * Revision 2.69 2006/02/14 18:56:18 perev - * setGlobalDca==>setDca - * - * Revision 2.68 2006/01/19 22:29:57 jeromel - * kMaxId -> kMaxDetectorId - * - * Revision 2.67 2005/12/08 00:06:27 perev - * BugFix, Instead of vertex, first hit was used - * - * Revision 2.66 2005/08/18 22:31:47 perev - * More tests - * - * Revision 2.65 2005/08/17 22:04:36 perev - * PoinCount cleanup - * - * Revision 2.64 2005/08/16 21:09:06 perev - * remeve 5fit cut - * - * Revision 2.63 2005/08/16 20:37:23 perev - * remove small pt cut - * - * Revision 2.62 2005/08/14 01:24:40 perev - * test for nhits<5 removed - * - * Revision 2.61 2005/08/04 04:04:19 perev - * Cleanup - * - * Revision 2.60 2005/07/21 21:50:24 perev - * First/last point of track filled from node now - * - * Revision 2.59 2005/07/20 17:34:08 perev - * MultiVertex - * - * Revision 2.58 2005/05/12 18:32:20 perev - * Temprary hack, save residuals - * - * Revision 2.57 2005/04/11 17:42:39 perev - * Temporary residuals saving added - * - * Revision 2.56 2005/03/24 17:51:16 perev - * print error code added - * - * Revision 2.55 2005/03/17 06:33:20 perev - * TPT like errors implemented - * - * Revision 2.54 2005/02/25 17:43:15 perev - * StTrack::setKey(...StvTrack::getId()) now - * - * Revision 2.53 2005/02/17 23:19:03 perev - * NormalRefangle + Error reseting - * - * Revision 2.52 2005/02/07 18:34:16 fisyak - * Add VMC dead material - * - * Revision 2.51 2005/01/17 03:56:56 pruneau - * change track container to vector - * - * Revision 2.50 2005/01/17 01:32:13 perev - * parameters protected - * - * Revision 2.49 2004/12/21 20:46:00 perev - * Cleanup. All known bugs fixed - * - * Revision 2.48 2004/12/02 22:14:53 calderon - * Only fill the fitTraits.chi2[1] data member for primaries. - * It holds node->getChi2() from the innerMostHitNode, which will be the - * vertex for primaries. - * - * Revision 2.47 2004/12/02 04:18:06 pruneau - * chi2[1] now set to incremental chi2 at inner most hit or vertex - * - * Revision 2.46 2004/12/01 15:35:46 pruneau - * removed throw and replaced with continue - * - * Revision 2.45 2004/11/08 15:34:16 pruneau - * fix of the chi2 calculation - * - * Revision 2.44 2004/10/27 03:25:54 perev - * Version V3V - * - * Revision 2.43 2004/10/26 06:45:41 perev - * version V2V - * - * Revision 2.42 2004/10/14 02:21:34 calderon - * Updated code in StTrackDetectorInfo, now only increment the reference count - * for globals, not for primaries. So fillTrackDetectorInfo changed to reflect - * this. - * - * Revision 2.41 2004/10/01 01:13:51 calderon - * Added bug fix from Marco: - * flag%100 -> flag/100. - * - * Revision 2.40 2004/08/17 20:04:28 perev - * small leak fixed, delete physicalHelix,originD - * - * Revision 2.39 2004/08/17 04:53:05 calderon - * When filling fit traits for primary tracks, set the new flag - * mPrimaryVertexUsedInFit. - * - * Revision 2.38 2004/08/10 14:21:13 calderon - * Use the firstHit from the dynamic_cast, to avoid a compiler warning - * for an unused variable. - * - * Revision 2.37 2004/08/06 22:23:29 calderon - * Modified the code to use the setNumberOfxxxPoints(unsigned char,StDetectorId) - * methods of StTrack, StTrackDetectorInfo, StTrackFitTraits, and to use - * the maxPointCount(unsigned int detId) method of StvTrack. - * - * Revision 2.36 2004/08/06 02:29:20 andrewar - * Modifed call to getMaxPointCount - * - * Revision 2.35 2004/08/05 05:25:25 calderon - * Fix the assignment of the first point for primaries. Now, - * the logic for both globals and primaries is that the first - * point is the first element of the stHits() vector that - * can actually be casted to an StHit (the vertex will fail this test, - * all other hits coming from detectors will satisfy it). - * - * Revision 2.34 2004/07/30 18:49:18 calderon - * For running in production, Yuri's dEdx Maker will fill the Pid Traits, - * so the filling of Pid Traits in the filler is no longer needed: - * it actually causes confusion because the V0 finders will loop over - * the PID traits vector and find the first one, so they won't find - * the trait created by the dEdx Maker. It is best to just comment - * out the filling of the Pid Traits here. - * - * Revision 2.33 2004/07/07 19:33:48 calderon - * Added method fillFlags. Flags tpc, tpc+svt (globals and primaries) and flags -x02 tracks with less than 5 total fit points - * - * Revision 2.32 2004/04/21 21:36:24 calderon - * Correction in the comments about the encoded method. - * - * Revision 2.31 2004/03/31 00:27:29 calderon - * Modifications for setting the fit points based on the chi20 condition. - * - * Revision 2.28 2004/03/19 19:33:23 andrewar - * Restored primary filling logic. Now taking parameters at the - * vertex for Primary tracks. - * - * Revision 2.27 2004/01/27 23:40:46 calderon - * The filling of the impactParameter() for global tracks is done now - * only after finding the vertex. The - * StPhysicalHelix::distance(StThreeVectorD) method is used for both globals - * and primaries, the only difference is where the helix is obtained: - * - globals - helix from StTrack::geometry(), which was filled from the - * innermost hit node, which should be a hit at the time. - * - primaries - helix from innermost hit node, which should be the vertex - * at the time it is called. - * - * Revision 2.26 2003/12/11 03:44:29 calderon - * set the length right again, it had dissappeared from the code... - * - * Revision 2.25 2003/11/26 04:02:53 calderon - * track->getChi2() returns the sum of chi2 for all sti nodes. In StEvent, - * chi2(0) should be chi2/dof, so we need to divide by - * dof=track->getPointCount()-5; - * - * Revision 2.24 2003/09/07 03:49:10 perev - * gcc 3.2 + WarnOff - * - * Revision 2.23 2003/09/02 17:59:59 perev - * gcc 3.2 updates + WarnOff - * - * Revision 2.22 2003/08/21 21:21:56 andrewar - * Added trap for non-finite dEdx. Added logic to fillGeometry so - * info is for innerMostHitNode on a detector, not vertex (note: - * Primaries only) - * - * Revision 2.21 2003/08/05 18:26:15 andrewar - * DCA track update logic modified. - * - * Revision 2.20 2003/07/01 20:25:28 calderon - * fillGeometry() - use node->getX(), as it should have been since the - * beginning - * impactParameter() - always use the innermos hit node, not just for globals - * removed extra variables which are no longer used. - * - * Revision 2.19 2003/05/15 03:50:26 andrewar - * Disabled call to filldEdxInfo for the SVT. Checks need to be - * applied to make sure the detector is active before calculator - * is called, but for the review filling this info is unnecessary. - * - * Revision 2.18 2003/05/14 00:04:35 calderon - * The array of 15 floats containing the covariance matrix has a different - * order in Stv than in StEvent. In Stv the array is counted starting from - * the first row, column go to next column until you hit the diagonal, - * jump to next row starting from first column. In StEvent the array is - * counted starting from the first row, column go to the next row until you - * hit the end, jump to next column starting from diagonal. - * The filling of the fitTraits was fixed to reflect this. - * - * Revision 2.17 2003/05/12 21:21:39 calderon - * switch back to getting the chi2 from track->getChi2() - * Covariance matrix is still obtained from node->get(), and the values - * are not as expected in StEvent, so this will still need to change. - * - * Revision 2.16 2003/05/08 22:23:33 calderon - * Adding a check for finiteness of node origin and node curvature. If any - * of the numbers is not finite, the code will abort(). - *local - * Revision 2.15 2003/04/29 18:48:52 pruneau - * *** empty log message *** - * - * Revision 2.14 2003/04/29 15:28:10 andrewar - * Removed hacks to get helicity right; switch now done at source - * (StvNode). - * - * Revision 2.13 2003/04/25 21:42:47 andrewar - * corrected DCA bug and added temp fix for helicity problem. This will - * have to be modified when the helicity convention in StvStKalmanTrack - * is updated. - * - * Revision 2.12 2003/04/04 14:48:34 pruneau - * *** empty log message *** - * - * Revision 2.11 2003/03/14 19:02:55 pruneau - * various updates - DCA is a bitch - * - * Revision 2.10 2003/03/13 21:20:10 pruneau - * bug fix in filler fixed. - * - * Revision 2.9 2003/03/13 18:59:44 pruneau - * various updates - * - * Revision 2.8 2003/03/13 16:01:48 pruneau - * remove various cout - * - * Revision 2.7 2003/03/13 15:15:52 pruneau - * various - * - * Revision 2.6 2003/03/12 17:58:05 pruneau - * fixing stuff - * - * Revision 2.5 2003/02/25 16:56:20 pruneau - * *** empty log message *** - * - * Revision 2.4 2003/02/25 14:21:10 pruneau - * *** empty log message *** - * - * Revision 2.3 2003/01/24 06:12:28 pruneau - * removing centralized io - * - * Revision 2.2 2003/01/23 05:26:02 pruneau - * primaries rec reasonable now - * - * Revision 2.1 2003/01/22 21:12:15 calderon - * Restored encoded method, uses enums but stores the value in constructor - * as a data member so bit operations are only done once. - * Fixed warnings. - * - * Revision 2.0 2002/12/04 16:50:59 pruneau - * introducing version 2.0 - * - * Revision 1.21 2002/09/20 02:19:32 calderon - * Quick hack for getting code for review: - * The filler now checks the global Dca for the tracks and only fills - * primaries when dca<3 cm. - * Also removed some comments so that the production log files are not swamped - * with debug info. - * - * Revision 1.20 2002/09/12 22:27:15 andrewar - * Fixed signed curvature -> StHelixModel conversion bug. - * - * Revision 1.19 2002/09/05 05:47:36 pruneau - * Adding Editable Parameters and dynamic StvOptionFrame - * - * Revision 1.18 2002/08/29 21:09:22 andrewar - * Fixed seg violation bug. - * - * Revision 1.17 2002/08/22 21:46:00 pruneau - * Made a fix to StvStEventFiller to remove calls to StHelix and StPhysicalHelix. - * Currently there is one instance of StHelix used a calculation broker to - * get helix parameters such as the distance of closest approach to the main - * vertex. - * - * Revision 1.16 2002/08/19 19:33:00 pruneau - * eliminated cout when unnecessary, made helix member of the EventFStvStEventFilleriller - * - * Revision 1.15 2002/08/12 21:39:56 calderon - * Introduced fillPidTraits, which uses the values obtained from - * Andrews brand new dEdxCalculator to create two instances of an - * StTrackPidTraits object and pass it to the track being filled. - * - * Revision 1.14 2002/08/12 15:29:21 andrewar - * Added dedx calculators - * - * Revision 1.13 2002/06/28 23:30:56 calderon - * Updated with changes debugging for number of primary tracks added. - * Merged with Claude's latest changes, but restored the tabs, othewise - * cvs diff will not give useful information: everything will be different. - * - * Revision 1.12 2002/06/26 23:05:31 pruneau - * changed macro - * - * Revision 1.11 2002/06/25 15:09:16 pruneau - * *** empty log message *** - * - * Revision 1.10 2002/06/18 18:08:34 pruneau - * some cout statements removed/added - * - * Revision 1.9 2002/06/05 20:31:15 calderon - * remove some redundant statements, the call to - * StTrackNode::addTrack() - * already calls - * track->SetNode(this), so I don't need to do it again - * - * Revision 1.8 2002/05/29 19:14:45 calderon - * Filling of primaries, in - * StvStEventFiller::fillEventPrimaries() - * - * Revision 1.7 2002/04/16 19:46:44 pruneau - * must catch exception - * - * Revision 1.6 2002/04/16 13:11:30 pruneau - * *** empty log message *** - * - * Revision 1.5 2002/04/09 16:03:13 pruneau - * Included explicit extension of tracks to the main vertex. - * - * Revision 1.4 2002/04/03 16:35:03 calderon - * Check if primary vertex is available in StvStEventFiller::impactParameter(), - * if not, return DBL_MAX; - * - * Revision 1.3 2002/03/28 04:29:49 calderon - * First test version of Filler - * Currently fills only global tracks with the following characteristics - * -Flag is set to 101, as most current global tracks are. This is not - * strictly correct, as this flag is supposed to mean a tpc only track, so - * really need to check if the track has svt hits and then set it to the - * appropriate flag (501 or 601). - * -Encoded method is set with bits 15 and 1 (starting from bit 0). Bit 1 - * means Kalman fit. - * Bit 15 is an as-yet unused track-finding bit, which Thomas said ITTF - * could grab. - * -Impact Parameter calculation is done using StHelix and the primary vertex - * from StEvent - * -length is set using getTrackLength, which might still need tweaking - * -possible points is currently set from getMaxPointCount which returns the - * total, and it is not - * what we need for StEvent, so this needs to be modified - * -inner geometry (using the innermostHitNode -> Ben's transformer -> - * StPhysicalHelix -> StHelixModel)StvStEventFiller - * -outer geometry, needs inside-out pass to obtain good parameters at - * outermostHitNode - * -fit traits, still missing the probability of chi2 - * -topology map, filled from StuFixTopoMap once StDetectorInfo is properly set - * - * This version prints out lots of messages for debugging, should be more quiet - * when we make progress. - * - **************************************************************************/ -//ROOT -#include "RVersion.h" -#include "TCernLib.h" -#include "TVectorD.h" -#include "TMatrixD.h" -//std -#include "Stiostream.h" -#include -#include - -// SCL -#include "StPhysicalHelix.hh" -#include "StThreeVector.hh" -#include "StThreeVectorF.hh" -#include "PhysicalConstants.h" -#include "SystemOfUnits.h" -#include "StTrackDefinitions.h" -#include "StTrackMethod.h" -#include "StDedxMethod.h" - -//StEvent -#include "StPrimaryVertex.h" -#include "StEventTypes.h" -#include "StDetectorId.h" -#include "StHelix.hh" -#include "StDcaGeometry.h" -#include "StHit.h" - - -#include "StEventUtilities/StEventHelper.h" -#include "Stv/StvConst.h" -#include "Stv/StvStl.h" -#include "Stv/StvHit.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "StvUtil/StvPullEvent.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StvUtil/StvDebug.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -//#include "StDetectorDbMaker/StvKalmanTrackFitterParameters.h" - -//StvMaker -#include "StvMaker/StvStEventFiller.h" - -#include "TMath.h" - -#include -std::map gTrkNodeMap; -typedef std::map::iterator TkMapIter; - -#include "StEventUtilities/StuFixTopoMap.cxx" -//_____________________________________________________________________________ -inline StThreeVectorF position(const StvNode *node) -{ - const double *d = node->GetFP().P; - return StThreeVectorF(d[0],d[1],d[2]); -} -//_____________________________________________________________________________ -inline StThreeVectorF position(const StvHit *hit ) -{ - const float *f = hit->x(); - return StThreeVectorF(f[0],f[1],f[2]); -} -//_____________________________________________________________________________ -inline int getCharge(const StvNode *node) -{ - return node->GetFP().getCharge(); -} -//_____________________________________________________________________________ -inline double getCurvature(const StvNode *node) -{ - return node->GetFP()._curv; -} -//_____________________________________________________________________________ -inline double getPhi(const StvNode *node) -{ - return node->GetFP()._psi; -} -//_____________________________________________________________________________ -inline double getDip(const StvNode *node) -{ - return atan(node->GetFP()._tanl); -} -//_____________________________________________________________________________ -inline StThreeVectorF getMom(const StvNode *node) -{ - double p[3]; - node->GetFP().getMom(p); return StThreeVectorF(p[0],p[1],p[2]); -} -//_____________________________________________________________________________ -inline int getHelicity(const StvNode *node) -{ - double curv = node->GetFP()._curv; - return (curv < 0) ? -1 : 1; -} - -//_____________________________________________________________________________ -inline double NICE(double ang) -{ return fmod(ang+M_PI*11,M_PI*2)-M_PI;} -//______________________________________________________________________________ -/** - returns the node information in TPT representation - double x[6], : state, for a definition, in radial implementation - rad - radius at start (cm). See also comments - phi - azimuthal angle (in rad) - z - z-coord. (cm) - psi - azimuthal angle of pT vector (in rads) - tanl - tan(dip) =pz/pt - q/pt - - double cc[15] : error matrix of the state "x" rad is fixed - code definition adopted here, where: - - Units - ______|________________|____________ - phi*R | 0 1 2 3 4 | deg*cm - z0 | 1 5 6 7 8 | cm - tanl | 2 6 9 10 11 | 1 covar(i) - psi | 3 7 10 12 13 | deg - q/pt | 4 8 11 13 14 | e*1/(GeV/c) - ----------------------------------- - - and where phi = atan2(y0,x0)*(180 deg/pi) - R = sqrt(x0*x0 + y0*y0) - q/pt = icharge*invpt; (This is what the - radius of curvature actually - determines) -PhiPhi PhiZ PhiTan PhiPsi PhiPt - ZZ ZTan ZPsi ZPt - TanTan TanPsi TanPt - PsiPsi PsiPt - PtPt - - -*/ - -//_____________________________________________________________________________ -void getTpt(const StvNode *node,float x[6],float e[15]) -{ - enum {jRad=0,jPhi,jZ,jTan,jPsi,jPti}; -static const double DEG = 180./M_PI; -static double fak[6] = {1,DEG,1,1,DEG,1}; -static const int toUpp[15] = {0, - 1, 5, - 2, 6, 9, - 3, 7, 10, 12, - 4, 8, 11, 13, 14}; - - double xx[6],ee[15]; - const StvNodePars &fp = node->GetFP(); - if (node->GetType()==StvNode::kPrimNode) {fp.GetPrimial(xx,ee,&node->GetFE());} - else {fp.GetRadial (xx,ee,&node->GetFE());} - - for (int i=0;i<6;i++) {x[i] = (float)(xx[i]);} - if (!e) return; - - x[0] = (float)xx[0]; - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++) { - e[toUpp[li+j]] = (float)(ee[li+j]*fak[i+1]*fak[j+1]); - } } -} -//_____________________________________________________________________________ -void getDcaLocal(const StvNode *node,float yz[2],float yzErr[2]) -{ -static int nCall=0; nCall++; - const StvNodePars &fp = node->GetFP(); - double myTan = fp._tanl; - double cos2L = 1./(1+myTan*myTan); - double cosL = sqrt(cos2L); - double sinL = myTan*cosL; - double cosP = fp._cosCA; - double sinP = fp._sinCA; -// Track Frame - TMatrixD dcaFrame(3,3); - - dcaFrame[0][0] = cosL*cosP; - dcaFrame[0][1] = cosL*sinP; - dcaFrame[0][2] = sinL; - - dcaFrame[1][0] = -sinP; - dcaFrame[1][1] = cosP; - dcaFrame[1][2] = 0; - - dcaFrame[2][0] = -sinL*cosP; - dcaFrame[2][1] = -sinL*sinP; - dcaFrame[2][2] = cosL; - - StvHit *hit=node->GetHit(); - assert(hit); - const double *hrr=node->GetHE(); - double d[3]={ hit->x()[0]-fp._x, hit->x()[1]-fp._y,hit->x()[2]-fp._z}; - TVectorD dif(3,d); - TVectorD loc = dcaFrame*dif; - yz[0]= loc[1]; yz[1]= loc[2] ; - - yzErr[0] = (hrr[0] - node->GetFE().mHH); - yzErr[1] = (hrr[2] - node->GetFE().mZZ); - for (int j=0;j<2;j++){yzErr[j] = (yzErr[j]>1e-6)? sqrt(yzErr[j]):1e-3;} - - -} - -//_____________________________________________________________________________ -StvStEventFiller::StvStEventFiller() -{ - mMinHits = 5; mNorHits = 10; mGoodHits = 15; - mGloPri = 0; - mPullEvent=0; - - unsigned short bit = 1 << tpcOther; // shifting the "1" exactly tpcOther places to the left - mStvEncoded = kITKalmanFitId + bit; // adding that to the proper fitting Id - -} - -//_____________________________________________________________________________ -StvStEventFiller::~StvStEventFiller() -{ - cout <<"StvStEventFiller::~StvStEventFiller()"< - In addition to the StGlobalTrack, we need to create the following objects (owned by it): - StTrackTopologyMap - StTrackFitTraits - StTrackGeometry (2 are needed, one at first point, one at last point) - (note: StHelixModel is implementation of the StTrackGeometry abstract class) - - The track also owns a container of PidTraits, this algorithm will not fill this container. - - And set up links to: - StTrackDetectorInfo (owned by StEvent, StSPtrVecTrackDetectorInfo) - StTrackNode (owned by StEvent, StSPtrVecTrackNode) - These links are - track -> detector info - track <-> track node - - Skeleton of the algorithm: - \n - StSPtrVecTrackNode& trNodeVec = mEvent->trackNodes(); \n - StSPtrVecTrackDetectorInfo& detInfoVec = mEvent->trackDetectorInfo(); \n - for (trackIterator trackIt = mTracks->begin(); trackIt != mTracks->end(); ++trackIt) { \n - StvTrack* kTrack = (*trackIt).second; // the container is a , need second entry of \n -\n - StTrackDetectorInfo* detInfo = new StTrackDetectorInfo();\n - fillDetectorInfo(detInfo,kTrack);\n - detInfoVec.push_back(detInfo);\n - \n - StTrackNode* trackNode = new StTrackNode;\n - trNodeVec.push_back(trackNode);\n - \n - StGlobalTrack* gTrack = new StGlobalTrack();\n - fillGlobalTrack(gTrack,kTrack);\n - \n - // set up relationships between objects\n - gTrack->setDetectorInfo(detInfo);\n - gTrack->setNode(trackNode);\n - trackNode->AddTrack(gTrack);\n - }\n - - The creation of the various objects needed by StGlobalTrack are taken care of in the methods: - fillTopologyMap(), fillGeometry(), fillFitTraits(), which are called within fillGlobalTrack(). - -*/ -//_____________________________________________________________________________ -void StvStEventFiller::fillEvent() -{ - //cout << "StvStEventFiller::fillEvent() -I- Started"<trackNodes(); - StSPtrVecTrackDetectorInfo& detInfoVec = mEvent->trackDetectorInfo(); - int errorCount=0; - - memset(mUsedHits,0,sizeof(mUsedHits)); - memset(mUsedGits,0,sizeof(mUsedGits)); - int fillTrackCount1=0; - int fillTrackCount2=0; - int fillTrackCountG=0; - StErrorHelper errh; - mTrackNumber=0; - for (StvTrackConstIter trackIt = mTracks->begin(); trackIt!=mTracks->end();++trackIt) - { - const StvTrack* kTrack = (*trackIt); - if (!accept(kTrack)) continue; // get rid of riff-raff - mTrackNumber++; - StTrackDetectorInfo* detInfo = new StTrackDetectorInfo; - fillDetectorInfo(detInfo,kTrack,true); //3d argument used to increase/not increase the refCount. MCBS oct 04. - // track node where the new StTrack will reside - StTrackNode* trackNode = new StTrackNode; - // actual filling of StTrack from StvTrack - StGlobalTrack* gTrack = new StGlobalTrack; - { - fillTrackCount1++; - fillTrack(gTrack,kTrack,detInfo); - // filling successful, set up relationships between objects - detInfoVec.push_back(detInfo); - //cout <<"Setting key: "<<(unsigned short)(trNodeVec.size())<setKey(kTrack->GetId()); - gTrack->setIdTruth(); - trackNode->addTrack(gTrack); - trNodeVec.push_back(trackNode); - // reuse the utility to fill the topology map - // this has to be done at the end as it relies on - // having the proper track->detectorInfo() relationship - // and a valid StDetectorInfo object. - //cout<<"Tester: Event Track Node Entries: "<entries()<entries(global)<1) - cout << "StvStEventFiller::fillEvent() -E- Track Node has no entries!! -------------------------" << endl; - int ibad = gTrack->bad(); - errh.Add(ibad); - if (ibad) { -//VP printf("GTrack error: %s\n",errh.Say(ibad).Data()); -//VP throw runtime_error("StvStEventFiller::fillEvent() StTrack::bad() non zero"); - } - fillTrackCount2++; - fillPulls(kTrack,gTrack,0); - -assert(gTrack->fitTraits().numberOfFitPoints(kTpcId)<=gTrack->numberOfPossiblePoints(kTpcId)); -assert(gTrack->fitTraits().numberOfFitPoints( )<=gTrack->numberOfPossiblePoints( )); - if (gTrack->fitTraits().numberOfFitPoints()4) - cout << "There were "<trackDetectorInfo(); - cout << "StvStEventFiller::fillEventPrimaries() -I- Tracks in container:" << mTracks->size() << endl; - int mVertN=0; - int noPipe=0; - int ifcOK=0; - int fillTrackCount1=0; - int fillTrackCount2=0; - int fillTrackCountG=0; - StErrorHelper errh; - const StvTrack *kTrack = 0; - StPrimaryTrack *pTrack = 0; - StGlobalTrack *gTrack = 0; - StTrackNode *nTRack = 0; - mTrackNumber=0; - for (StvTrackConstIter tkIter= mTracks->begin(); tkIter!=mTracks->end();++tkIter) { - kTrack = *tkIter; - if (!accept(kTrack)) continue; - nTRack = gTrkNodeMap[kTrack]; - if (!nTRack) continue; - mTrackNumber++; - assert(nTRack->entries()<=10); - assert(nTRack->entries(global)==1); - - //double globalDca = nTRack->track(global)->impactParameter(); - //Even though this is filling of primary tracks, there are certain - // quantities that need to be filled for global tracks that are only known - // after the vertex is found, such as dca. Here we can fill them. - // - gTrack = static_cast(nTRack->track(global)); - assert(gTrack->key()==kTrack->GetId()); - float minDca = 1e10; //We do not know which primary. Use the smallest one - - pTrack = 0; - for (mVertN=0; (vertex = mEvent->primaryVertex(mVertN));mVertN++) { - StThreeVectorD vertexPosition = vertex->position(); -//VP double zPrim = vertexPosition.z(); - // loop over StvKalmanTracks - float globalDca = impactParameter(gTrack,vertexPosition); - if (fabs(minDca) > fabs(globalDca)) minDca = globalDca; - - if (kTrack->IsPrimary()!=mVertN+1) continue; - - fillTrackCount1++; - // detector info - StTrackDetectorInfo* detInfo = new StTrackDetectorInfo; - fillDetectorInfo(detInfo,kTrack,false); //3d argument used to increase/not increase the refCount. MCBS oct 04. - pTrack = new StPrimaryTrack; - pTrack->setKey( gTrack->key()); - - fillTrack(pTrack,kTrack, detInfo); - // set up relationships between objects - detInfoVec.push_back(detInfo); - - nTRack->addTrack(pTrack); // StTrackNode::addTrack() calls track->setNode(this); - vertex->addDaughter(pTrack); - fillPulls(kTrack,pTrack,1); - fillTrackCount2++; - int ibad = pTrack->bad(); - errh.Add(ibad); - if (ibad) { -//VP printf("PTrack error: %s\n",errh.Say(ibad).Data()); -//VP throw runtime_error("StvStEventFiller::fillEventPrimaries() StTrack::bad() non zero"); - } - if (pTrack->fitTraits().numberOfFitPoints()geometry()->momentum().mag()<0.1) break; - StDcaGeometry *myDca = gTrack->dcaGeometry(); - if (!myDca) break; - - fillTrackCountG++; - break; - } //end of verteces - if (fabs(minDca)<1000) { - gTrack->setImpactParameter(minDca); - if (pTrack) pTrack->setImpactParameter(minDca); - } - - } // kalman track loop - gTrkNodeMap.clear(); // need to reset for the next event - cout <<"StvStEventFiller::fillEventPrimaries() -I- Primaries (1):"<< fillTrackCount1<< " (2):"<< fillTrackCount2<< " no pipe node:"<getPointCount() later? -//_____________________________________________________________________________ -void StvStEventFiller::fillDetectorInfo(StTrackDetectorInfo* detInfo, const StvTrack* track, bool refCountIncr) -{ - //cout << "StvStEventFiller::fillDetectorInfo() -I- Started"<setNumberOfPoints(np,(StDetectorId)(i)); - assert((int)detInfo->numberOfPoints((StDetectorId)(i)) == np); - } - for (StvNodeConstIter it = track->begin();it!=track->end();++it) - { - node = (*it); - - - if (node->GetType() != StvNode::kRegNode) continue; - const StvHit *stiHit = GetHit(node); - if (!stiHit) continue; - - -// Count used hits for tracks tpc hits >10 - if (nTotHits >= mNorHits) { - int gid = node->GetDetId(); - if (mUsedHits[0]=mGoodHits) { - if (mUsedGits[0]stHit(); - FillStHitErr(hh,node); - - detInfo->addHit(hh,refCountIncr); - if (!refCountIncr) continue; - hh->setFitFlag(1); - } - node = track->GetNode(StvTrack::kLastPoint); - detInfo->setLastPoint (position(node)); - - node = track->GetNode(StvTrack::kFirstPoint); - detInfo->setFirstPoint (position(node)); - -} -//_____________________________________________________________________________ -void StvStEventFiller::fillGeometry(StTrack* gTrack, const StvTrack* track, bool outer) -{ - //cout << "StvStEventFiller::fillGeometry() -I- Started"<type() == primary) needType = StvTrack::kPrimPoint; - const StvNode* node = track->GetNode(needType); - assert(node); - StvHit *ihit = node->GetHit(); - StThreeVectorF nodpos(position(node)); - StThreeVectorF hitpos(position(ihit)); - - - // making some checks. Seems the curvature is infinity sometimes and - // the origin is sometimes filled with nan's... - - StTrackGeometry* geometry =new StHelixModel(short(getCharge(node)), - getPhi(node), - fabs(getCurvature(node)), - getDip(node), - nodpos, - getMom(node), - getHelicity(node)); - - if (outer) - gTrack->setOuterGeometry(geometry); - else - gTrack->setGeometry(geometry); - - - return; -} - -//_____________________________________________________________________________ -// void StvStEventFiller::fillTopologyMap(StTrack* gTrack, const StvTrack* track){ -// cout << "StvStEventFiller::fillTopologyMap()" << endl; -// int map1,map2; -// map1 = map2 = 0; -// // change: add code to set the bits appropriately here - -// StTrackTopologyMap topomap(map1,map2); -// gTrack->setTopologyMap(topomap); -// return; -// } - -//_____________________________________________________________________________ -void StvStEventFiller::fillFitTraits(StTrack* gTrack, const StvTrack* track) -{ -static int nCall=0; nCall++; - // mass - // this makes no sense right now... double massHyp = track->getMass(); // change: perhaps this mass is not set right? - unsigned short geantIdPidHyp = 9999; - //if (.13< massHyp<.14) - geantIdPidHyp = 9; - // chi square and covariance matrix, plus other stuff from the - // innermost track node - StvTrack::EPointType needNode = (track->IsPrimary())? StvTrack::kPrimPoint : StvTrack::kFirstPoint; - const StvNode* node = track->GetNode(needNode); - assert(node); - - float x[6],covMFloat[15]; - getTpt(node,x,covMFloat); - float chi2[2]; - //get chi2/dof - chi2[0] = track->GetXi2(); - chi2[1] = -999; // change: here goes an actual probability, need to calculate? - // December 04: The second element of the array will now hold the incremental chi2 of adding - // the vertex for primary tracks - if (gTrack->type()==primary) { - node = track->GetNode(StvTrack::kPrimPoint); - assert(!node->GetDetId()); - chi2[1]=node->GetXi2(); - } - - // setFitTraits uses assignment operator of StTrackFitTraits, which is the default one, - // which does a memberwise copy. Therefore, constructing a local instance of - // StTrackFitTraits is fine, as it will get properly copied. - StTrackFitTraits fitTraits(geantIdPidHyp,0,chi2,covMFloat); - // Now we have to use the new setters that take a detector ID to fix - // a bug. There is no encoding anymore. - - int dets[kMaxDetectorId][3]; - getAllPointCount(track,dets); - for (int i=1;itype()==primary) { - fitTraits.setPrimaryVertexUsedInFit(true); - } - gTrack->setFitTraits(fitTraits); - return; -} - -///_____________________________________________________________________________ -/// data members from StEvent/StTrack.h -/// The track flag (mFlag accessed via flag() method) definitions with ITTF -///(flag definition in EGR era can be found at http://www.star.bnl.gov/STAR/html/all_l/html/dst_track_flags.html) -/// -/// mFlag=zxyy, where z = 1 for pile up track in TPC (otherwise 0) -/// x indicates the detectors included in the fit and -/// yy indicates the status of the fit. -/// Positive mFlag values are good fits, negative values are bad fits. -/// -/// The first digit indicates which detectors were used in the refit: -/// -/// x=1 -> TPC only -/// x=3 -> TPC + primary vertex -/// x=5 -> SVT + TPC -/// x=6 -> SVT + TPC + primary vertex -/// x=7 -> FTPC only -/// x=8 -> FTPC + primary -/// x=9 -> TPC beam background tracks -/// -/// The last two digits indicate the status of the refit: -/// = +x01 -> good track -/// -/// = -x01 -> Bad fit, outlier removal eliminated too many points -/// = -x02 -> Bad fit, not enough points to fit -/// = -x03 -> Bad fit, too many fit iterations -/// = -x04 -> Bad Fit, too many outlier removal iterations -/// = -x06 -> Bad fit, outlier could not be identified -/// = -x10 -> Bad fit, not enough points to start -/// -/// = -x11 -> Short track pointing to EEMC - -void StvStEventFiller::fillFlags(StTrack* gTrack) { - if (gTrack->type()==global) { - gTrack->setFlag(101); //change: make sure flag is ok - } - else if (gTrack->type()==primary) { - gTrack->setFlag(301); - } - const StTrackFitTraits &fitTrait = gTrack->fitTraits(); - int totFitPoints = fitTrait.numberOfFitPoints(); - const StTrackDetectorInfo *dinfo = gTrack->detectorInfo(); - if (dinfo) { - Int_t NoTpcFitPoints = dinfo->numberOfPoints(kTpcId); - // Check that it could be TPC pile-up track, i.e. in the same half TPC (West East) - // there are more than 2 hits with wrong Z -position - Int_t flag = TMath::Abs(gTrack->flag()); - if (NoTpcFitPoints >= 11) { - const StTrackDetectorInfo *dinfo = gTrack->detectorInfo(); - const StPtrVecHit& hits = dinfo->hits(kTpcId); - Int_t Nhits = hits.size(); - Int_t NoWrongSignZ = 0; - for (Int_t i = 0; i < Nhits; i++) { - const StTpcHit *hit = (StTpcHit *) hits[i]; - if ((hit->position().z() < -1.0 && hit->sector() <= 12) || - (hit->position().z() > 1.0 && hit->sector() > 12)) NoWrongSignZ++; - } - if (NoWrongSignZ >= 2) - gTrack->setFlag((flag%1000) + 1000); // +1000 - } - if (totFitPoints < mMinHits ) { - // hadrcoded number correspondant to __MIN_HITS_TPC__ 11 in StMuFilter.cxx - //keep most sig. digit, set last digit to 2, and set negative sign - gTrack->setFlag(-(((flag/100)*100)+2)); // -x02 - if (gTrack->geometry()) { - const StThreeVectorF &momentum = gTrack->geometry()->momentum(); - if (momentum.pseudoRapidity() > 0.5) { - const StPtrVecHit& hits = dinfo->hits(); - Int_t Nhits = hits.size(); - for (Int_t i = 0; i < Nhits; i++) { - const StHit *hit = hits[i]; - if (hit->position().z() > 150.0 -#ifdef kFtsIdentifier - ||hit->detector()==kFtsId -#endif - ) - { - gTrack->setFlag((((flag/100)*100)+11)); // +x11 - return; - } - } - } - } - } - } -} -//_____________________________________________________________________________ -void StvStEventFiller::fillTrack(StTrack* gTrack, const StvTrack* track,StTrackDetectorInfo* detInfo ) -{ - - //cout << "StvStEventFiller::fillTrack()" << endl; - // encoded method = 16 bits = 12 fitting and 4 finding, for the moment use: - // kKalmanFitId - // bit 15 for finding, (needs to be changed in StEvent). - // change: make sure bits are ok, are the bits set up one in each position and nothing else? - // this would mean that the encoded method is wasting space! - // the problem is that in principle there might be combinations of finders for each tracking detector - // but the integrated tracker will use only one for all detectors maybe - // so need this bit pattern: - // finding 100000000000 - // fitting 0010 - // 32768 + 2 = 32770; - // - // above is no longer used, instead use kITKalmanfitId as fitter and tpcOther as finding method - - gTrack->setEncodedMethod(mStvEncoded); - double tlen = track->GetLength(); - assert(tlen >0.0 && tlen<1500.); - gTrack->setLength(tlen);// someone removed this, grrrr!!!! - - // Follow the StDetectorId.h enumerations... - // can't include them from here in order not to - // create a package dependence... - int dets[kMaxDetectorId][3]; - getAllPointCount(track,dets); - for (int i=1;isetNumberOfPossiblePoints(np,(StDetectorId)i); - assert((int)gTrack->numberOfPossiblePoints((StDetectorId)i)==np); - } - - fillGeometry(gTrack, track, false); // inner geometry - fillGeometry(gTrack, track, true ); // outer geometry - fillFitTraits(gTrack, track); - gTrack->setDetectorInfo(detInfo); - StuFixTopoMap(gTrack); - fillFlags(gTrack); - if (!track->GetNode(StvTrack::kPrimPoint)) fillDca(gTrack,track); - return; -} -//_____________________________________________________________________________ -bool StvStEventFiller::accept(const StvTrack* track) -{ -// int nPossiblePoints = track->getMaxPointCount(0); -// int nMeasuredPoints = track->getPointCount (0); - int n=0; - for (StvNodeConstIter it = track->begin(); it !=track->end();++it) { - const StvNode *node = *it; - if (!node->IsFitted(2)) continue; - if (node->GetDetId()==kTpcId) { n++;} else {n+=2;} - - } - if (n < mMinHits ) return 0; - if(track->GetLength()<=0) return 0; - return 1; -} -//_____________________________________________________________________________ -double StvStEventFiller::impactParameter(StTrack* track, StThreeVectorD &vertex) -{ - StPhysicalHelixD helix = track->geometry()->helix(); - - //cout <<"PHelix: "<(stTrack); - assert(gTrack); - - const StvNode *tNode = track->GetNode(StvTrack::kDcaPoint); - if (!tNode) return; - const StvNodePars &pars = tNode->GetFP(); - const StvFitErrs &errs = tNode->GetFE(); - StvImpact myImp; - double signA = errs.Sign(); - if (signA<=0) { - Warning("fillDca","-TIVE input errors %g, SKIPPED",signA); - return; - } - pars.GetImpact(&myImp,&errs); - - double signB = StvFitErrs::EmxSign(5,&myImp.mImpImp); - if (signB<=0) { - Warning("fillDca","-TIVE DCA errors %g %g, SKIPPED",signA,signB); - return; - } - StDcaGeometry *dca = new StDcaGeometry; - gTrack->setDcaGeometry(dca); - dca->set(&myImp.mImp,&myImp.mImpImp); - assert(fabs(pars.getRxy()-fabs(dca->params()[0]))<1e-2*(1+pars.getRxy())); - stTrack->setImpactParameter(myImp.mImp); - -} -//_____________________________________________________________________________ -void StvStEventFiller::FillStHitErr(StHit *hh,const StvNode *node) -{ -#if 0 - double stiErr[6],stErr[6]; - memcpy(stiErr,node->hitErrs(),sizeof(stiErr)); - double alfa = node->getAlpha(); - double c = cos(alfa); - double s = sin(alfa); - double T[3][3]={{c,-s, 0} - ,{s, c, 0} - ,{0, 0, 1}}; - - TCL::trasat(T[0],stiErr,stErr,3,3); - StThreeVectorF f3(sqrt(stErr[0]),sqrt(stErr[2]),sqrt(stErr[5])); - hh->setPositionError(f3); -#endif //0 -} -//_____________________________________________________________________________ -void StvStEventFiller::fillPulls(const StvTrack* track, const StTrack *stTrack,int gloPri) -{ -static int nCall=0; nCall++; - //cout << "StvStEventFiller::fillDetectorInfo() -I- Started"<GetNode(pty); - if (!node) return; - - const StvNodePars &fp = node->GetFP(); - const StvFitErrs &fe = node->GetFE(); - int dets[kMaxDetectorId][3]; - getAllPointCount(track,dets); - StvPullTrk aux; - aux.mVertex = (unsigned char)track->IsPrimary(); - aux.mTrackNumber=track->GetId();; - aux.nAllHits = dets[0][2]; - aux.nTpcHits = dets[kTpcId][2]; - aux.nSsdHits = dets[kSsdId][2]; - aux.nFtpcHits = dets[kFtpcEastId][2]+dets[kFtpcWestId][2]; - aux.mL = (unsigned char)track->GetLength(); - aux.mTypeEnd = (unsigned char)track->GetTypeEnd(); - aux.mChi2 = track->GetXi2(); - aux.mChi2P = track->GetXi2P(); - - - aux.mCurv = fp._curv; - aux.mPt = fp.getPt(); - aux.mPsi = fp._psi; - aux.mDip = atan(fp._tanl); - StThreeVectorD v3(fp.P); - aux.mRxy = v3.perp(); - aux.mPhi = v3.phi(); - aux.mZ = v3.z(); - - aux.mPtErr = sqrt(fe.mPP)*aux.mPt*aux.mPt; - aux.mPsiErr = sqrt(fe.mAA); - aux.mDipErr = sqrt(fe.mLL); - aux.mRxyErr = sqrt(fe.mHH); - aux.mZErr = sqrt(fe.mZZ); - - aux.mIdTruTk = stTrack->idTruth(); - aux.mQaTruTk = stTrack->qaTruth(); - - mPullEvent->Add(aux,gloPri); - if (!gloPri) { - double ar[7]; - ar[0] = aux.mRxy*cos(aux.mPhi); - ar[1] = aux.mRxy*sin(aux.mPhi); - ar[2] = aux.mZ; - ar[3] = cos(aux.mDip)*cos(aux.mPsi); - ar[4] = cos(aux.mDip)*sin(aux.mPsi); - ar[5] = sin(aux.mDip); - ar[6] = aux.mCurv; - THelixTrack th(ar,ar+3,ar[6]); - double dL = th.Path(0.,0.); - th.Eval(dL,ar,ar+3); - aux.mDca00 = (-ar[0]*ar[4]+ar[1]*ar[3])/cos(aux.mDip); - } - - double len=0,preRho,preXy[2]; int myNode=0; - for (StvNodeConstIter tNode=track->begin();tNode!=track->end();++tNode) - { - const StvNode *node = (*tNode); - const StvHit *stiHit = GetHit(node); - if (!stiHit) continue; - StHit *hh = (StHit*)stiHit->stHit(); - assert(hh); - const StvNodePars &fp = node->GetFP(); - double dL = (stiHit->x()[0]-fp._x)*fp._cosCA - + (stiHit->x()[1]-fp._y)*fp._sinCA; - double myX = fp._x+dL*fp._cosCA; - double myY = fp._y+dL*fp._sinCA; - if (myNode) { - dL = sqrt(pow(preXy[0]-myX,2)+pow(preXy[1]-myY,2)); - double rho = 0.5*(preRho+fabs(fp._curv)); - double mySin = 0.5*dL*rho; if (mySin>0.99) break; - if (mySin>0.01) dL = 2*asin(mySin)/rho; - len+=dL; - } - myNode++;preXy[0]=myX; preXy[1]=myY; preRho = fabs(fp._curv); - - fillPulls(len,hh,stiHit,node,track,dets,gloPri); - - - if (gloPri) continue; - fillPulls(len,hh,stiHit,node,track,dets,2); - } -} -//_____________________________________________________________________________ - void StvStEventFiller::fillPulls(double len - ,StHit *stHit,const StvHit *stiHit - ,const StvNode *node - ,const StvTrack *track - ,int dets[1][3],int gloPriRnd) -{ - double x,y,z,r; - - -//const StvFitErrs &fe = node->GetFE(); - const StvNodePars &fp = node->GetFP(); - float yz[2],yzErr[2]; - getDcaLocal(node,yz,yzErr); - - StvPullHit aux; - aux.mIdTruth = stHit->idTruth(); - aux.mQaTruth = stHit->qaTruth(); - -// local frame -// local HIT - aux.mVertex = (unsigned char)track->IsPrimary(); -// aux.nHitCand = node->getHitCand(); -// aux.iHitCand = node->getIHitCand(); -// if (!aux.nHitCand) aux.nHitCand=1; - aux.lYHit = yz[0]; - aux.lZHit = yz[1]; - aux.lYHitErr = sqrt(node->GetHE()[0]); - aux.lZHitErr = sqrt(node->GetHE()[2]); - aux.lYPulErr = yzErr[0]; - aux.lZPulErr = yzErr[1]; - aux.lYPul = aux.lYHit/aux.lYPulErr; if (fabs(aux.lYPul)>10) aux.lYPul=10; - aux.lZPul = aux.lZHit/aux.lZPulErr; if (fabs(aux.lZPul)>10) aux.lZPul=10; - aux.lLen = len; - -// global frame - -// global Hit - const StHitPlane *hitPlane = stiHit->detector(); -// assert(hitPlane); - if (!hitPlane) return; //Temporary??????? - const float *n = hitPlane->GetDir(stiHit->x())[0]; - aux.gPhiHP = atan2(n[1],n[0]); - aux.gLamHP = asin(n[2]); - - x = stiHit->x()[0]; y = stiHit->x()[1]; z = stiHit->x()[2]; - r = sqrt(x*x+y*y); - - aux.gRHit = r; - aux.gPHit = atan2(y,x);aux.gPHit = NICE(aux.gPHit); - aux.gZHit = z; - - -// global Fit - x = fp._x; y = fp._y;z = fp._z; - r = sqrt(x*x+y*y); - aux.gRFit = r; - aux.gPFit = (atan2(y,x));aux.gPFit=NICE(aux.gPFit); - aux.gZFit = z; - - - - aux.gPsi = fp._psi; - aux.gDip = atan(fp._tanl); - - // invariant - aux.mCurv = fp._curv; - aux.mPt = fabs(1./fp._ptin); - aux.mCharge = stHit->charge(); - aux.mChi2 = node->GetXi2(); - aux.mDetector=node->GetDetId(); - aux.mTrackNumber=track->GetId(); - aux.nAllHits = dets[0][2]; - aux.nTpcHits = dets[kTpcId][2]; - aux.nFtpcHits = dets[kFtpcEastId][2]+dets[kFtpcWestId][2]; - aux.nSsdHits = dets[kSsdId][2]; - mPullEvent->Add(aux,gloPriRnd); - -} -//_____________________________________________________________________________ -const StvHit* StvStEventFiller::GetHit(const StvNode *node) const -{ - const StvHit* h = node->GetHit(); - if (!h) return 0; - if (node->GetType() != StvNode::kRegNode) return 0; - int detId= node->GetDetId(); - if (!detId) return 0; - if (!h->stHit()) return 0; - const StHitPlane *hitPlane = h->detector(); - if (!hitPlane) return 0; - if (node->GetXi2()>1000) return 0; - return h; -} - -//_____________________________________________________________________________ -void StvStEventFiller::getAllPointCount(const StvTrack *track,int count[1][3]) -{ -// output array actually is count[maxDetId+1][3] -// count[0] all detectors -// count[detId] for particular detector -// count[detId][0] == number of possible points -// count[detId][1] == number of measured points -// count[detId][2] == number of fitted points -enum {kPP=0,kMP=1,kFP=2}; - - memset(count[0],0,(kMaxDetectorId)*3*sizeof(int)); - StvNodeConstIter it; - - for (it=track->begin();it!=track->end();it++){ - const StvNode *node = (*it); - int detId= node->GetDetId(); - if (!detId) continue; - if (!node->GetHitPlane()) continue; -//fill possible points - count[0][kPP]++; count[detId][kPP]++; - const StvHit* h = GetHit(node); - if (!h ) continue; - count[0][kMP]++; count[detId][kMP]++; - count[0][kFP]++; count[detId][kFP]++; - } -} - -//_____________________________________________________________________________ -void StvEventFiller::SetCons(const StvKonst_st *kons) -{ - mMinHits=kons->mMinHits; - mNorHits=kons->mNorHits; - mGoodHits=kons->mGoodHits; -} diff --git a/StRoot/StvMaker/StvStEventFiller.h b/StRoot/StvMaker/StvStEventFiller.h deleted file mode 100755 index db3fb70fa6a..00000000000 --- a/StRoot/StvMaker/StvStEventFiller.h +++ /dev/null @@ -1,115 +0,0 @@ -//StvStEventFiller.h -/*************************************************************************** - * - * $Id: StvStEventFiller.h,v 1.8 2015/11/11 01:52:57 perev Exp $ - * - * Author: Manuel Calderon de la Barca Sanchez, Mar 2002 - * Author: Victor Perev, Jun 2010 - *************************************************************************** - * - * $Log: StvStEventFiller.h,v $ - * Revision 1.8 2015/11/11 01:52:57 perev - * Remove non used method setUseAux - * - * Revision 1.7 2015/06/10 17:28:08 perev - * Print of used hits (from Sti) added - * - * Revision 1.6 2013/10/02 20:23:00 perev - * kMinFitPoints 10 ==> 11 to be like Sti - * - * Revision 1.5 2012/10/21 22:57:22 perev - * Add IdTruth into pulls - * - * Revision 1.4 2012/04/27 01:40:19 perev - * Add konstant min hit number - * - * Revision 1.3 2012/04/10 22:41:54 perev - * Cleanup - * - * Revision 1.2 2010/09/29 23:39:12 perev - * Intereface fillPulls(...) chamnged - * - * Revision 1.1 2010/07/06 20:27:53 perev - * Alpha version of Stv (Star Tracker Virtual) - * - * Revision 1.2 2010/07/03 16:27:15 perev - * Last time name Stv - * - * Revision 1.1 2010/06/22 19:34:28 perev - * EventFiller added - * - * Revision 2.24 2006/12/18 01:30:52 perev - * fillPulls reorganized - * - * - **************************************************************************/ -#ifndef StvStEventFiller_HH -#define StvStEventFiller_HH -#include "StDetectorId.h" - -enum ECuts { kMinFitPoints=11 }; - - -class StEvent; -class StTrackNode; -class StTrackDetectorInfo; -class StvNode; -class StvHit; -class StTrack; -class StvPullEvent; -#include "StvEventFiller.h" -#include "StThreeVectorD.hh" -//class StHelix; -//class StHelixModel; -#include "StPhysicalHelixD.hh" - -/*! \class StvStEventFiller - StvStEventFiller is a utilitity class meant to properly convert StvTrack - objects into StTrack (Global/Primary) objects and hang these on the StEvent - Track-node. - - \author Manuel Calderon de la Barca Sanchez (Yale Software) - Rewritten for StvVmc - \author Victor Perev (BNL) - - */ -class StvStEventFiller : public StvEventFiller -{ -public: - StvStEventFiller(); - virtual ~StvStEventFiller(); - void fillEvent(); - void fillEventPrimaries(); - void fillDetectorInfo(StTrackDetectorInfo* detInfo, const StvTrack* kTrack,bool refCountIncr); - void fillGeometry(StTrack* track, const StvTrack* kTrack, bool outer); - //void fillTopologyMap(StTrack* track, const StvTrack* kTrack); - void fillFitTraits(StTrack* track, const StvTrack* kTrack); - void fillTrack(StTrack* track, const StvTrack* kTrack,StTrackDetectorInfo* detInfo ); - void fillDca(StTrack* track, const StvTrack* kTrack); - void fillFlags(StTrack* track); - double impactParameter(StTrack* strack , StThreeVectorD &vertexPosition); - void setPullEvent(StvPullEvent *pe) {mPullEvent=pe;} - void getAllPointCount(const StvTrack *track,int count[1][3]); - const StvHit *GetHit(const StvNode *node) const; -private: - void fillResHack(StHit *hh,const StvHit *stiHit, const StvNode *node); - void fillPulls (double len,StHit *hh,const StvHit *stiHit - ,const StvNode *node - ,const StvTrack *track - ,int dets[1][3],int gloPri); - void fillPulls (const StvTrack *ktrack,const StTrack *stTrack,int gloPri); - bool accept(const StvTrack* kTrack); - void FillStHitErr(StHit *hh,const StvNode *node); - -private: - int mGloPri; //0=filing global,1=filing primary - int mTrackNumber; - int mUsedHits[100]; - int mUsedGits[100]; - - unsigned short mStvEncoded; - - -}; - -#endif diff --git a/StRoot/StvMaker/StvStEventHitSelector.cxx b/StRoot/StvMaker/StvStEventHitSelector.cxx deleted file mode 100644 index 5b01ee18677..00000000000 --- a/StRoot/StvMaker/StvStEventHitSelector.cxx +++ /dev/null @@ -1,56 +0,0 @@ - -// $Id: StvStEventHitSelector.cxx,v 1.1 2013/05/24 16:35:42 perev Exp $ -/*! -\author V Perev 2013 - -Hit selector. Using track info, marks selected hits. Used for hit error fit -to use only hits from "good" tracks -
      -*/ -#include "StEvent/StEvent.h" -#include "StEvent/StHit.h" -#include "StEvent/StTrack.h" -#include "StEvent/StTrackGeometry.h" -#include "StEvent/StTrackNode.h" -#include "StEvent/StTrackDetectorInfo.h" -#include "StarClassLibrary/StThreeVectorF.hh" -#include "StvStEventHitSelector.h" - - -ClassImp(StvStEventHitSelector) - -//_____________________________________________________________________________ -StvStEventHitSelector::StvStEventHitSelector(const char *name) : TNamed(name,"") -{ - mPtMin = 0.5; -} - -//_____________________________________________________________________________ -int StvStEventHitSelector::Edit(const StEvent *event) -{ - - int nSel = 0; - if (!event) return 0; - const StSPtrVecTrackNode& trackNode = event->trackNodes(); - int nTracks = trackNode.size(); - if (!nTracks) return -1; //No track info - for (int itk=0; itk < nTracks; itk++) { - StTrackNode *node = trackNode[itk]; - if (!node) continue; - StTrack *glTrack = node->track(global); - if (!glTrack) continue; - StTrackGeometry *geo = glTrack->geometry(); - if (!geo) continue; - StThreeVectorF mom = geo->momentum(); - if (mom.perp2()< mPtMin*mPtMin) continue; - const StPtrVecHit& hits = glTrack->detectorInfo()->hits(); - int nHits = hits.size(); - if (nHits <15) continue; - for(int ih=0; ihSetBit(kMarked); nSel++; - } - } - return nSel; -} diff --git a/StRoot/StvMaker/StvStEventHitSelector.h b/StRoot/StvMaker/StvStEventHitSelector.h deleted file mode 100644 index 960623ac65e..00000000000 --- a/StRoot/StvMaker/StvStEventHitSelector.h +++ /dev/null @@ -1,24 +0,0 @@ -//StvStEventHitSelector.h - -#ifndef StvStEventHitSelector_HH -#define StvStEventHitSelector_HH - - -#include "TNamed.h" -class StEvent; - -class StvStEventHitSelector : public TNamed -{ - public: - enum {kMarked = 1}; - public: - StvStEventHitSelector(const char* name = "HitSelector"); - int Edit(const StEvent *evt); - void SetPtMin(double pt) { mPtMin = pt;} -private: -double mPtMin; - -ClassDef(StvStEventHitSelector,0) -}; - -#endif diff --git a/StRoot/StvMaker/StvStEventMaker.cxx b/StRoot/StvMaker/StvStEventMaker.cxx deleted file mode 100644 index 1b2011d6ce8..00000000000 --- a/StRoot/StvMaker/StvStEventMaker.cxx +++ /dev/null @@ -1,53 +0,0 @@ - -// $Id: StvStEventMaker.cxx,v 1.2 2013/05/24 16:35:00 perev Exp $ -/*! -\author V Perev 2030 - -A maker StvStEventMaker remove all redundant info from StEvent -if StEvent is used for input. Only TpcHits must survive -
      -*/ -#include "StEvent/StEvent.h" -#include "StvStEventMaker.h" -ClassImp(StvStEventMaker) - -//_____________________________________________________________________________ -StvStEventMaker::StvStEventMaker(const char *name) : StMaker(name) -{ -} - -//_____________________________________________________________________________ -Int_t StvStEventMaker::Make() -{ - - StEvent *event = (StEvent*)GetInputDS("StEvent"); - if (!event) return kStOK; - StSPtrVecObject& V = event->content(); - int n = V.size(); - for (int i=0; iClassName(),"Hit" )) continue; - if (strstr(to->ClassName(),"Track")) continue; - V[i] = 0; delete to; - } - return kStOK; -} -//_____________________________________________________________________________ -StvStEventMaker* StvStEventMaker::Inst() -{ - StMaker *mk = StMaker::GetChain(); - assert(mk); -// Search of StIOMaker::inputStream - mk = mk->GetMaker("inputStream"); - if (!mk) return 0; - assert(strcmp(mk->ClassName(),"StIOMaker")==0); - StvStEventMaker *myMaker = new StvStEventMaker; - TDataSet *par = myMaker->GetParent(); - par->Remove(myMaker); - par = mk->GetParent(); - TList* tl= par->GetList(); - tl->AddAfter(mk,myMaker); - myMaker->SetParent(par); - return myMaker; -} diff --git a/StRoot/StvMaker/StvStEventMaker.h b/StRoot/StvMaker/StvStEventMaker.h deleted file mode 100644 index 4f076de19c0..00000000000 --- a/StRoot/StvMaker/StvStEventMaker.h +++ /dev/null @@ -1,22 +0,0 @@ -//StvStEventMaker.h - -#ifndef StvStEventMaker_HH -#define StvStEventMaker_HH - - -#include "StMaker.h" - - -class StvStEventMaker : public StMaker -{ - public: - - StvStEventMaker(const char* name = "StvStEvent"); - virtual Int_t Make(); - static StvStEventMaker* Inst(); - virtual const char* GetCVS() const - {static const char cvs[]="Tag $Name: $ $Id: StvStEventMaker.h,v 1.3 2018/01/28 00:49:01 perev Exp $ built " __DATE__ " " __TIME__; return cvs;} - ClassDef(StvStEventMaker,0) -}; - -#endif diff --git a/StRoot/StvMaker/StvStarVertexFinder.cxx b/StRoot/StvMaker/StvStarVertexFinder.cxx deleted file mode 100644 index b84eae9b3ca..00000000000 --- a/StRoot/StvMaker/StvStarVertexFinder.cxx +++ /dev/null @@ -1,90 +0,0 @@ -#include "StvMaker/StvStarVertexFinder.h" -#include "Stv/StvHit.h" -#include "StThreeVectorF.hh" -#include "StMatrixF.hh" -#include "StEvent.h" -#include "StPrimaryVertex.h" -#include "StGenericVertexMaker/StGenericVertexMaker.h" -#include "StGenericVertexMaker/StGenericVertexFinder.h" -#include "StMaker.h" -#include "StvUtil/StvNodePars.h" - - -//______________________________________________________________________________ -StvStarVertexFinder::StvStarVertexFinder(const char *name) - : StvVertexFinder(name) -{mGVF=0;} - -//______________________________________________________________________________ -StvStarVertexFinder::~StvStarVertexFinder() -{} -//______________________________________________________________________________ -void StvStarVertexFinder::Clear(const char*) -{ - if (mGVF) mGVF->Clear(); - StvVertexFinder::Clear(); -} - -//______________________________________________________________________________ -/// Return the main vertex held by the given StEvent -/// A null pointer is returned if StEvent holds no valid -/// vertex. -//______________________________________________________________________________ -int StvStarVertexFinder::Fit(StEvent * event) -{ - cout <<"StvStarVertexFinder::fit(StEvent * event) -I- Started"<GetMaker("GenericVertex"); - if ( gvm ){ - mGVF = gvm->GetGenericFinder(); - assert(mGVF); - } else { - LOG_WARN << "Could not find a GenericVertex instance" << endm; - } - } - //AAR - modified - // changed to fill primary vert only if fit returns true (okay) - int nVtx=0; - if ( mGVF ){ - Clear(); // this calls mGVF->Clear() requiring knowing about GenericVertex - nVtx = mGVF->fit(event); - if(nVtx){ - //vertex fit returns okay, so save - mGVF->FillStEvent(event); - } - } - return nVtx; - -} - -//______________________________________________________________________________ -/// Return the main vertex held by the given StEvent -/// A null pointer is returned if StEvent holds no valid -/// vertex. -//______________________________________________________________________________ -int StvStarVertexFinder::GetVertex(int idx,double x[3],double e[6]) -{ - if (!mGVF) return 1; - StPrimaryVertex *spv = mGVF->getVertex(idx); - if (!spv) return 2; - - // Get an instance of StHit from the factory - const StThreeVectorF& vp = spv->position(); - StMatrixF cov = spv->covariantMatrix(); - - cout <<"StvStarVertexFinder::GetVertex("<IsFixed() || StvFitErrs::EmxSign(3,e)>0); - return 0; -} diff --git a/StRoot/StvMaker/StvStarVertexFinder.h b/StRoot/StvMaker/StvStarVertexFinder.h deleted file mode 100644 index 5dc9685253d..00000000000 --- a/StRoot/StvMaker/StvStarVertexFinder.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef StvStarVertexFinder_H -#define StvStarVertexFinder_H 1 -#include "Stv/StvVertexFinder.h" -class StGenericVertexFinder; -class StvStarVertexFinder : public StvVertexFinder -{ -public: - StvStarVertexFinder(const char* name); - virtual ~StvStarVertexFinder(); - int Fit(StEvent*); // fit the vertex - void Clear(const char *opt=0); -private: - int GetVertex(int index,double xyz[3],double err[6]); -private: -StGenericVertexFinder* mGVF; -}; - - -#endif diff --git a/StRoot/StvMaker/StvTpcActive.cxx b/StRoot/StvMaker/StvTpcActive.cxx deleted file mode 100644 index 94c28e74914..00000000000 --- a/StRoot/StvMaker/StvTpcActive.cxx +++ /dev/null @@ -1,221 +0,0 @@ -#include -#include -#include -#include -#include "StvTpcActive.h" -#include "StEvent/StEnumerations.h" -#include "TGeoManager.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "TGeoVolume.h" - -#include "StDetectorDbMaker/St_tpcRDOMasksC.h" -#include "StDetectorDbMaker/St_tpcAnodeHVavgC.h" -#include "StDetectorDbMaker/St_tpcPadGainT0BC.h" - - -// This is from file g2t_volume_is.g -// nbpads = 73 -// tpads = { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, -// 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, -// 7, 8, 8, 8, 9, 9, 9,10,10,10, -// 11,11,11,12,12,12,13,13,13,14, -// 14,15,16,17,18,19,20,21,22,23, -// 24,25,26,27,28,29,30,31,32,33, -// 34,35,36,37,38,39,40,41,42,43, -// 44,45,45}; -// -// isdets = { 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, -// 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, -// 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, -// 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, -// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -// 0, 0, 2 }; -enum {kNGPads=73,kNTPads=45}; -static const double kZPrompt = 205; - -static const int TPADS[kNGPads]={ -1, 1, 1, 2, 2, 2, 3, 3, 3, 4, -4, 4, 5, 5, 5, 6, 6, 6, 7, 7, -7, 8, 8, 8, 9, 9, 9,10,10,10, -11,11,11,12,12,12,13,13,13,14, -14,15,16,17,18,19,20,21,22,23, -24,25,26,27,28,29,30,31,32,33, -34,35,36,37,38,39,40,41,42,43, -44,45,45}; - -static const int RPADS[kNGPads]={ - 0, 1, 0, 0, 2, 0, 0, 3, 0, 0 -, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7 -, 0, 0, 8, 0, 0, 9, 0, 0,10, 0 -, 0,11, 0, 0,12, 0, 0,13, 0, 0 -,14,15,16,17,18,19,20,21,22,23 -,24,25,26,27,28,29,30,31,32,33 -,34,35,36,37,38,39,40,41,42,43 -,44,45, 0}; -static const int GPADS[kNTPads]={ - 2, 5, 8,11,14,17,20,23,26,29 -,32,35,38,41,42,43,44,45,46,47 -,48,49,50,51,52,53,54,55,56,57 -,58,59,60,61,62,63,64,65,66,67 -,68,69,70,71,72}; - -static const int ISDETS[kNGPads]={ -1, 0, 2, 1, 0, 2, 1, 0, 2, 1, -0, 2, 1, 0, 2, 1, 0, 2, 1, 0, -2, 1, 0, 2, 1, 0, 2, 1, 0, 2, -1, 0, 2, 1, 0, 2, 1, 0, 2, 1, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 2}; - -ClassImp(StvTpcActive) - -//______________________________________________________________________________ -StvTpcActive::StvTpcActive(const char *name):StActorFunctor(name) -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//______________________________________________________________________________ -int StvTpcActive::VoluId() -{ - - if (GetDetId() != kTpcId) return 0; - if (strncmp(GetVolu()->GetName(),"TPA",3)) return 0; - int numbv[3]; - GetIPath(3,numbv); - int tpgv = numbv[2]; - int tpss = numbv[1]; - mSector= tpss+12*(tpgv-1); - mGPad = numbv[0]; - -// tpad >nbpads (73) prompt hits - mPrompt = 0; - if (mGPad > kNGPads) { mGPad -= kNGPads; mPrompt = 1; } - mIsDet = ISDETS[mGPad-1]; - mTPad = RPADS [mGPad-1]; - return 100000*mIsDet+100*mSector+mTPad; -} -//______________________________________________________________________________ -int StvTpcActive::operator()( const double *) -{ -static St_tpcRDOMasksC *pRdoMasks = St_tpcRDOMasksC::instance(); -static St_tpcAnodeHVavgC *tpcAnodeHVavgC = St_tpcAnodeHVavgC::instance(); -static St_tpcPadGainT0BC *tpcPadGainT0BC = St_tpcPadGainT0BC::instance(); - - - if (!VoluId()) return 0; - if (!mTPad) return 0; - int iRdo = pRdoMasks->rdoForPadrow(mTPad); - int iact = pRdoMasks->isOn(mSector, iRdo); - if (!iact) return 0; - - iact = tpcAnodeHVavgC->livePadrow(mSector,mTPad) - && tpcPadGainT0BC->livePadrow(mSector,mTPad); - - return iact; -} - -ClassImp(StvTpcSelector) - -//______________________________________________________________________________ -StvTpcSelector::StvTpcSelector(const char *name):StvTpcActive(name) -{ - mInOut=-99; - TString ts(name); - if (ts.Index("Inner" ,0,TString::kIgnoreCase)>-1) mInOut =0; - if (ts.Index("Outer" ,0,TString::kIgnoreCase)>-1) mInOut =1; - if (ts.Index("Prompt",0,TString::kIgnoreCase)>-1) mInOut+=2; - assert(mInOut>=0); -} -//______________________________________________________________________________ -int StvTpcSelector::operator()(const double xyz[3]) -{ - - if (!VoluId()) return 0; - if (!mTPad) return 0; - if ((mTPad>13 ) != (mInOut&1 )) return 0; - if ((mPrompt==0) != ((mInOut&2)==0)) return 0; - return 1; -} - - -ClassImp(StvTpcEdit) - -//______________________________________________________________________________ -StvTpcEdit::StvTpcEdit():StvTpcActive("TpcEdit") -{ -} -//______________________________________________________________________________ -int StvTpcEdit::operator()( const double *) -{ -static StTGeoProxy *tg = StTGeoProxy::Inst(); - if (!VoluId()) return 0; - const TGeoVolume *vol = GetVolu(); - assert(vol); - if (!tg->IsSensitive(vol)) return 0; - StHitPlaneInfo* inf = tg->IsHitPlane(vol); - if (!inf) return 0; - const char *path = GetPath(); - StHitPlane *hp = inf->GetHitPlane(path); - if (!hp) return 0; - if (mTPad) return 0; //Not fake volume - hp=inf->RemHitPlane(path); - delete hp; - return 1; -} -//______________________________________________________________________________ -int StvTpcPrompt::operator()(const double xyz[3]) -{ - - if (!VoluId()) return 0; - if (!mTPad) return 0; - if (!mPrompt) return 0; - return 123; -} -//______________________________________________________________________________ -#include "StEvent/StTpcHit.h" -#include "Stv/StvHit.h" -// Workaround of bug in StTpcHit::padrow() -#include "StDetectorDbMaker/St_tpcPadPlanesC.h" -// End of workaround - -//______________________________________________________________________________ -int StvTpcHitActor::operator()(const double xyz[3]) -{ -static int nCall = 0; nCall++; -static const int kMaxRows = St_tpcPadPlanesC::instance()->numberOfRows(); -static const int iSect[24] = {23,22,21,20,19,18,17,16,15,14,13,24 - ,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1,12}; - assert(mHit); - TString path(GetPath()); - if (mDetId != kTpcId) return 0; - int jTPCE = path.Index("TPCE"); - if (jTPCE<0) return 0; - StvHit *hit = (StvHit *)mHit; - StTpcHit *tpcHit = (StTpcHit*)hit->stHit(); - - int sector = tpcHit->sector(); - if ((sector<=12) != (xyz[2]>0)) { - sector = iSect[sector-1];// pileup tracks with wrong Z - } - int tpadrow = tpcHit->padrow(); - -// Workaround of bug int StTpcHit::padrow() - if (tpadrow>kMaxRows) tpadrow &= 0x3F; -// End of workaround - - int gpadrow = GPADS[tpadrow-1]; - if (fabs(xyz[2]) > kZPrompt) gpadrow+=kNGPads; - int tpgv = 1; if (sector>12) {tpgv = 2; sector-=12;} - path.Remove(jTPCE+6,99); - path+="/TPGV_"; path+=tpgv; - path+="/TPSS_"; path+=sector; - if (tpadrow<=13) { path+="/TPAD_";} else { path+="/TPA1_"; } - path+=gpadrow; - int ok = gGeoManager->cd(path); - assert(ok); - return 1; -} diff --git a/StRoot/StvMaker/StvTpcActive.h b/StRoot/StvMaker/StvTpcActive.h deleted file mode 100644 index 255f8918012..00000000000 --- a/StRoot/StvMaker/StvTpcActive.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef __StvTpcActive_h_ -#define __StvTpcActive_h_ -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StvTpcActive: public StActorFunctor -{ -public: - StvTpcActive(const char *name=""); -virtual ~StvTpcActive(){} -virtual int operator()(const double xyz[3]=0); -int VoluId(); -protected: -char mBeg[1]; -int mSector; -int mIsDet; -int mGPad; //Padrow number including all non physical -int mTPad; //Padrow number including only physical -int mPrompt; //It is a prompt hit , -char mEnd[1]; - -ClassDef(StvTpcActive,0) -}; - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StvTpcSelector: public StvTpcActive -{ -public: - StvTpcSelector(const char *name); -virtual ~StvTpcSelector(){} -virtual int operator()(const double xyz[3]); -protected: -int mInOut; - -ClassDef(StvTpcSelector,0) -}; - - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StvTpcEdit: public StvTpcActive -{ -public: - StvTpcEdit(); - ~StvTpcEdit(){} -int operator()(const double xyz[3]=0); -protected: - -ClassDef(StvTpcEdit,0) -}; -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ - -class StvTpcPrompt: public StvTpcActive -{ -public: - StvTpcPrompt(){;} - ~StvTpcPrompt(){;} -int operator()(const double xyz[3]=0); -protected: - -ClassDef(StvTpcPrompt,0) -}; -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ - -class StvTpcHitActor: public StvTpcActive -{ -public: - StvTpcHitActor(){;} - ~StvTpcHitActor(){;} -int operator()(const double xyz[3]=0); -protected: - -ClassDef(StvTpcHitActor,0) -}; -#endif diff --git a/StRoot/StvSeed/StvCASeedFinder.cxx b/StRoot/StvSeed/StvCASeedFinder.cxx deleted file mode 100644 index bf03007f1fd..00000000000 --- a/StRoot/StvSeed/StvCASeedFinder.cxx +++ /dev/null @@ -1,322 +0,0 @@ -#if 0 //Temporary OFF -#include -#include -#include -#include -#include -#include "TCernLib.h" -#include "StvCASeedFinder.h" -#include "StMultiKeyMap.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" - -#include "StEvent/StEnumerations.h" -#include "StEvent/StTpcHit.h" - -#include "StDbUtilities/StTpcCoordinateTransform.hh" -#include "StDbUtilities/StGlobalCoordinate.hh" -#include "StDbUtilities/StTpcLocalSectorCoordinate.hh" - -#include "Stv/StvHit.h" -#include "THelixTrack.h" -//#define APPROX_DEBUG -#include "StarMagField/StarMagField.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvDraw.h" -#include "Stv/StvHit.h" - -#define ENABLE_VECTORIZATION -#include "TPCCATracker/code/AliHLTTPCCAGBHit.h" -#include "TPCCATracker/code/AliHLTTPCCAGBTrack.h" -#include "TPCCATracker/code/AliHLTTPCCAParam.h" -#include "TPCCATracker/code/AliHLTTPCCAGBTracker.h" - -// -// static double innerR[13] = {60.000, 64.800, 69.600, 74.400, 79.200, // 5 -// 84.000, 88.800, 93.600, 98.800, 104.000, // 10 -// 109.200, 114.400, 119.600}; -// static double outerR[32] = {127.195, 129.195, // 15 -// 131.195, 133.195, 135.195, 137.195, 139.195, // 20 -// 141.195, 143.195, 145.195, 147.195, 149.195, // 25 -// 151.195, 153.195, 155.195, 157.195, 159.195, // 30 -// 161.195, 163.195, 165.195, 167.195, 169.195, // 35 -// 171.195, 173.195, 175.195, 177.195, 179.195, // 40 -// 181.195, 183.195, 185.195, 187.195, 189.195};// 45 - -static const int NumberOfPadsAtRow[45] = { - 88, 96,104,112,118,126,134,142,150,158, // Inner - 166,174,182, - 98,100,102,104,106,106,108, // Outer - 110,112,112,114,116,118,120,122,122,124, - 126,128,128,130,132,134,136,138,138,140, - 142,144,144,144,144 -}; -static const int kNSlices = 24; //TODO initialize from StRoot -static const int kNRows = 45; - -static float rRows[kNRows] = - {60.000, 64.800, 69.600, 74.400, 79.200, // 5 //TODO initialize from StRoot - 84.000, 88.800, 93.600, 98.800, 104.000, // 10 - 109.200, 114.400, 119.600, - 127.195, 129.195, // 15 - 131.195, 133.195, 135.195, 137.195, 139.195, // 20 - 141.195, 143.195, 145.195, 147.195, 149.195, // 25 - 151.195, 153.195, 155.195, 157.195, 159.195, // 30 - 161.195, 163.195, 165.195, 167.195, 169.195, // 35 - 171.195, 173.195, 175.195, 177.195, 179.195, // 40 - 181.195, 183.195, 185.195, 187.195, 189.195};// 45 - -typedef std::complex myComplex; -static const double kToRad = M_PI/180; -static const myComplex kIm = myComplex(0,1); - -static const myComplex sectAng[24] = { -exp(-kIm*kToRad* 60.),exp(-kIm*kToRad* 30.),exp(-kIm*kToRad* 0.), -exp( kIm*kToRad* 30.),exp( kIm*kToRad* 60.),exp( kIm*kToRad* 90.), -exp( kIm*kToRad*120.),exp( kIm*kToRad*150.),exp(-kIm*kToRad*180.), -exp(-kIm*kToRad*150.),exp(-kIm*kToRad*120.),exp(-kIm*kToRad* 90.), - -exp(-kIm*kToRad*120.),exp(-kIm*kToRad*150.),exp(-kIm*kToRad*180.), -exp( kIm*kToRad*150.),exp( kIm*kToRad*120.),exp( kIm*kToRad* 90.), -exp( kIm*kToRad* 60.),exp( kIm*kToRad* 30.),exp( kIm*kToRad* 0.), -exp(-kIm*kToRad* 30.),exp(-kIm*kToRad* 60.),exp(-kIm*kToRad* 90.)}; - - - -class AliHLTTPCCAParamVector: public std::vector{}; -class AliHLTTPCCAGBHitVector :public std::vector{}; -class IdTruthVector :public std::vector {}; - - -ClassImp(StvCASeedFinder) -//_____________________________________________________________________________ -StvCASeedFinder::StvCASeedFinder(const char *name):StvSeedFinder(name) -{ - memset(mBeg,0,mEnd-mBeg+1); - fTracker = new AliHLTTPCCAGBTracker; - fCaParam = new AliHLTTPCCAParamVector; - fCaHits = new AliHLTTPCCAGBHitVector; - fIdTruth = new IdTruthVector; - Clear(); -} -//_____________________________________________________________________________ -void StvCASeedFinder::Clear(const char*) -{ - memset(mBeg,0,mMed-mBeg+1); - fTracker->StartEvent(); - fCaParam->clear(); // settings for all sectors to give CATracker - fCaHits->clear(); // hits to give CATracker - fIdTruth->clear(); // id of the Track, which has created CaHit -} -//_____________________________________________________________________________ -void StvCASeedFinder::Reset() -{ - memset(mBeg,0,mMed-mBeg+1); -} -//_____________________________________________________________________________ -void StvCASeedFinder::MakeSettings() -{ - for ( int iSlice = 0; iSlice < kNSlices; iSlice++ ) { - AliHLTTPCCAParam SlicePar; - memset(&SlicePar, 0, sizeof(AliHLTTPCCAParam)); - - int sector = iSlice+1; - // int sector = iSlice; - SlicePar.SetISlice( iSlice ); - SlicePar.SetNRows ( kNRows ); - double beta = 0; - if (sector > 12) beta = (24-sector)*2.*TMath::Pi()/12.; - else beta = sector *2.*TMath::Pi()/12.; - SlicePar.SetAlpha ( beta ); - SlicePar.SetDAlpha ( 30*TMath::DegToRad() ); //TODO initialize from StRoot - SlicePar.SetCosAlpha ( TMath::Cos(SlicePar.Alpha()) ); - SlicePar.SetSinAlpha ( TMath::Sin(SlicePar.Alpha()) ); - SlicePar.SetAngleMin ( SlicePar.Alpha() - 0.5*SlicePar.DAlpha() ); - SlicePar.SetAngleMax ( SlicePar.Alpha() + 0.5*SlicePar.DAlpha() ); - SlicePar.SetRMin ( 51. ); //TODO initialize from StRoot - SlicePar.SetRMax ( 194. ); //TODO initialize from StRoot - SlicePar.SetErrX ( 0. ); //TODO initialize from StRoot - SlicePar.SetErrY ( 0.12 ); // 0.06 for Inner //TODO initialize from StRoot - SlicePar.SetErrZ ( 0.16 ); // 0.12 for Inner NodePar->fitPars() //TODO initialize from StRoot - // SlicePar.SetPadPitch ( 0.675 );// 0.335 -"- - float x[3]={0,0,0},b[3]; - StarMagField::Instance()->BField(x,b); - SlicePar.SetBz ( - b[2] ); // change sign because change z - if (sector <= 12) { - SlicePar.SetZMin ( 0. ); //TODO initialize from StRoot - SlicePar.SetZMax ( 210. ); //TODO initialize from StRoot - } else { - SlicePar.SetZMin (-210. ); //TODO initialize from StRoot - SlicePar.SetZMax ( 0. ); //TODO initialize from StRoot - } - for( int iR = 0; iR < kNRows; iR++){ - SlicePar.SetRowX(iR, rRows[iR]); - } -#if 1 - SlicePar.SetRecoType(1); //Stv hiterr parametrisation - const double *coeffInner = StvHitErrCalculator::Inst("StvTpcInnerHitErrs")->GetPars(); - for(int iCoef=0; iCoef<6; iCoef++) - { - SlicePar.SetParamS0Par(0, 0, iCoef, (float)coeffInner[iCoef] ); - } - SlicePar.SetParamS0Par(0, 0, 6, 0.0f ); - const double *coeffOuter = StvHitErrCalculator::Inst("StvTpcOuterHitErrs")->GetPars(); - for(int iCoef=0; iCoef<6; iCoef++) - { - SlicePar.SetParamS0Par(0, 1, iCoef, (float)coeffOuter[iCoef] ); - } -#endif -#if 0 //Hack - SlicePar.SetRecoType(0); //Stv hiterr parametrisation - float inn[6]= {0.000944592291, 0.00096804701, 0.0307030007 - ,0.005380766 , 0.00276213209, 0.0185125507}; - - float out[6]= {0.00119955395, 0.000499619695, 0.0558479801 - ,0.0100383796 , 0.000534858496, 0.0479304604}; - - for(int iCoef=0; iCoef<6; iCoef++) - { - SlicePar.SetParamS0Par(0, 0, iCoef, inn[iCoef] ); - SlicePar.SetParamS0Par(0, 1, iCoef, out[iCoef] ); - } -#endif - - SlicePar.SetParamS0Par(0, 1, 6, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 0, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 1, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 2, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 3, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 4, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 5, 0.0f ); - SlicePar.SetParamS0Par(0, 2, 6, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 0, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 1, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 2, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 3, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 4, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 5, 0.0f ); - SlicePar.SetParamS0Par(1, 0, 6, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 0, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 1, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 2, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 3, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 4, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 5, 0.0f ); - SlicePar.SetParamS0Par(1, 1, 6, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 0, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 1, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 2, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 3, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 4, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 5, 0.0f ); - SlicePar.SetParamS0Par(1, 2, 6, 0.0f ); - - fCaParam->push_back(SlicePar); - } // for iSlice -} // void StiTPCCATrackerInterface::MakeSettings() - -//_____________________________________________________________________________ -void StvCASeedFinder::MakeHits() -{ -const static double TAN15 = tan(M_PI*20/180); //18 != mistype - - fStvHits = StTGeoProxy::Inst()->GetAllHits(); - if (!fStvHits) return; - int nHits = fStvHits->size(); - if (!nHits) return; - for (int ihit = 0;ihitdetector(); - if (!hp) continue; - if (hp->GetDetId()!=kTpcId) continue; - const StTpcHit *tpcHit = (StTpcHit*)(hit->stHit()); - if ( ! tpcHit) continue; - int sector = tpcHit->sector(); - int padrow = tpcHit->padrow(); - - -// Make CA Hit - AliHLTTPCCAGBHit caHit; - myComplex myXY(hit->x()[0],hit->x()[1]); - myXY*=sectAng[sector-1]; - assert(fabs(myXY.imag()/myXY.real())<=TAN15); - assert(myXY.real()>0); - caHit.SetX( myXY.real()); // take position of the row - caHit.SetY( - myXY.imag()); - caHit.SetZ( - hit->x()[2]); - // caHit.SetErrX( ); - caHit.SetErrY( 0.12 );// TODO: read parameters from somewhere - caHit.SetErrZ( 0.16 ); - caHit.SetISlice( sector - 1 ); - caHit.SetIRow(padrow-1 ); - caHit.SetID(ihit); - fIdTruth->push_back( tpcHit->idTruth()); - fCaHits->push_back(caHit); - } - -} -//________________________________________________________________________________ -void StvCASeedFinder::Run() -{ - -// TStopwatch timer; -// timer.Start(); - - MakeSettings(); - MakeHits(); - - // run tracker - fTracker->SetSettings(*fCaParam); - fTracker->SetHits(*fCaHits); - - - -// timer.Stop(); -// fPreparationTime_real = timer.RealTime(); -// fPreparationTime_cpu = timer.CpuTime(); - - fTracker->FindTracks(); - fNTracks = fTracker->NTracks(); - fITrack = -1; -// copy hits -// timer.Start(); - -// timer.Stop(); -// fPreparationTime_real += timer.RealTime(); -// fPreparationTime_cpu += timer.CpuTime(); - -} -//________________________________________________________________________________ -const THelixTrack* StvCASeedFinder::NextSeed() -{ - if (!fNTracks) Run(); - if (!fNTracks) return 0;; - - while (++fITrackTrack( fITrack ); - const int NHits = tr.NHits(); - if (NHits <3) continue; - for ( int iHit = NHits-1; iHit >= 0; iHit-- ){ - const int index = fTracker->TrackHit( tr.FirstHitRef() + iHit ); - const int hId = fTracker->Hit( index ).ID(); - fSeedHits.push_back((StvHit*)(*fStvHits)[hId]); - } - const THelixTrack *ht = Approx(); - if (ht) return ht; - } - return 0; - -} -//________________________________________________________________________________ -int StvCASeedFinder::padp(int pad, int row) { - int p = 0; - p = (int)(pad - NumberOfPadsAtRow[row]/2); - if(row<13) - p = (int)p/2; - return p; -} -#endif diff --git a/StRoot/StvSeed/StvCASeedFinder.h b/StRoot/StvSeed/StvCASeedFinder.h deleted file mode 100644 index 54239c0899e..00000000000 --- a/StRoot/StvSeed/StvCASeedFinder.h +++ /dev/null @@ -1,55 +0,0 @@ -/// \File StvCASeedFinder.h -/// \author Victorb Perev 01/2010 -#ifndef StvCASeedFinder_HH -#define StvCASeedFinder_HH -#include "Stv/StvSeedFinder.h" -#include -#include -/// \class StvCASeedFinder - -class StvHit; -class AliHLTTPCCAParam; -class AliHLTTPCCAParamVector; -class AliHLTTPCCAGBHit; -class AliHLTTPCCAGBHitVector; -class IdTruthVector; -class AliHLTTPCCAGBTracker; -class StVoidArr; - -class StvCASeedFinder : public StvSeedFinder -{ -public: - StvCASeedFinder(const char *name="TpcCaSeedFinder"); - ~StvCASeedFinder(){;} - const THelixTrack* NextSeed(); - void Clear(const char *opt=""); - void Reset(); - void Print(const char *opt="") const {;} - -protected: - -private: - void Run(); - void MakeSettings(); - void MakeHits(); - -static Int_t padp(Int_t pad, Int_t row); -private: -char mBeg[1]; -int fNTracks; -int fITrack; -StVoidArr *fStvHits; -char mMed[1]; -AliHLTTPCCAGBTracker *fTracker; -AliHLTTPCCAParamVector *fCaParam; // settings for all sectors to give CATracker -AliHLTTPCCAGBHitVector *fCaHits; // hits to give CATracker -IdTruthVector *fIdTruth; // id of the Track, which has created CaHit - - - -char mEnd[1]; -KlassDef(StvCASeedFinder,0);//K instead of C to avoid dictionary creation -}; - - -#endif diff --git a/StRoot/StvSeed/StvConeRejector.cxx b/StRoot/StvSeed/StvConeRejector.cxx deleted file mode 100644 index feba9b20f18..00000000000 --- a/StRoot/StvSeed/StvConeRejector.cxx +++ /dev/null @@ -1,187 +0,0 @@ -#include -#include -#include -#include -#include "TVector3.h" -#include "StvConeRejector.h" -#include "StvSeedConst.h" - - -//VP ??? enum {kFstAng=88,kMinLen=3,kMaxLen=50,kDivLen=5}; -enum {kFstAng=88,kMinLen=3,kMaxLen=50,kDivLen=1}; -static const double kFstCos = cos(kFstAng*M_PI/180); - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -inline static float Dot(const float A[3],const float B[3]) -{ - return A[0]*B[0]+A[1]*B[1]+A[2]*B[2]; -} -//_____________________________________________________________________________ -inline static void Cop(float A[3],const float B[3]) -{ - A[0]=B[0];A[1]=B[1];A[2]=B[2]; -} -//_____________________________________________________________________________ -inline static void Mul(float A[3],float F,const float B[3]) -{ - A[0]=B[0]*F; A[1]=B[1]*F; A[2]=B[2]*F; -} -//_____________________________________________________________________________ -inline static void Sub(float A[3],const float B[3],const float C[3]) -{ - A[0]=B[0]-C[0]; A[1]=B[1]-C[1]; A[2]=B[2]-C[2]; -} -//_____________________________________________________________________________ -inline static void Add(float A[3],const float B[3],const float C[3]) -{ - A[0]=B[0]+C[0]; A[1]=B[1]+C[1]; A[2]=B[2]+C[2]; -} -//_____________________________________________________________________________ -inline static void Cro(float A[3],const float B[3],const float C[3]) -{ -// TVector3(fY*p.fZ-p.fY*fZ, fZ*p.fX-p.fZ*fX, fX*p.fY-p.fX*fY); - A[0] = B[1]*C[2]-C[1]*B[2]; - A[1] = B[2]*C[0]-C[2]*B[0]; - A[2] = B[0]*C[1]-C[0]*B[1]; - -} -//_____________________________________________________________________________ -StvConeRejector::StvConeRejector() -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//_____________________________________________________________________________ -void StvConeRejector::Reset(const float pos[3],const float dir[3] - ,float rad,float theta,float err) -/// Definition of start position, direction and radius of cone sector -/// if direction,radius,angle or error are not defined, then -/// they are calculated automatically. -{ - Cop(mPos,pos); - mRxy2 = mPos[0]*mPos[0]+mPos[1]*mPos[1]; - mR2 = mRxy2 + mPos[2]*mPos[2]; - mRxy = sqrt(mRxy2); - mErr = SEED_ERR(mRxy); - double norL=0,norR=0; - - if (dir) { //Direction defined - Cop(mDir[0],dir); - mThet = (theta) ? theta : kFstAng*M_PI/180; - } else { //Estimate dir as median direction to (0,0,-kZRange) and (0,0,kZRange) - - norL = sqrt(mRxy2+pow(mPos[2]-kZRange,2)); - norR = sqrt(mRxy2+pow(mPos[2]+kZRange,2)); - double norQ = (1./norL+1./norR); - - mDir[0][0]= mPos[0]*norQ; - mDir[0][1]= mPos[1]*norQ; - mDir[0][2]= mPos[2]*norQ +kZRange*(1./norR-1./norL); - norQ = 1./sqrt(Dot(mDir[0],mDir[0])); - Mul(mDir[0],-norQ,mDir[0]); - mThet = (mR2 -(kZRange*kZRange))/(norL*norR); - mThet = 0.5*acos(mThet); - - assert(mThet< M_PI/2); - } - if (rad ) { mOutRad = rad;} //rad is defined, use it - else { //rad is no defined, estimate it - mOutRad = (norL>norR) ? norL:norR; - mOutRad/= kDivLen; - if (mOutRadlim) mLim[0][i] = lim; - lim = qwe + asd + mErr; - if (mLim[1][i] mCos) {mLim[1][i] = mOutRad;} - else if (mDir[0][i]<-mCos) {mLim[0][i] = -mOutRad;} - - // Move to global system - mLim[0][i]+= mPos[i]; - mLim[1][i]+= mPos[i]; - } -static int mytimes = 20; - if (mytimes >0) { - TestIt(); - mytimes--; - double fullVol = M_PI*200*200*400/100; - double vol1=1/fullVol; for (int i=0;i<3;i++) { vol1*=mLim[1][i]-mLim[0][i];} - printf (" vol1 = %g \n",vol1); - } -} -//_____________________________________________________________________________ -int StvConeRejector::Reject(const float x[3]) const -{ - float xx[3]; - Sub(xx,x,mPos); - float r2 = xx[0]*xx[0]+xx[1]*xx[1]+xx[2]*xx[2]; - if (r2>mOutRad2) return 1; - float myX = Dot(xx,mDir[0]); - if (myX <0) return 2; - - float myY2 = (r2-myX*myX); - if (myY2 >myX*myX*mTan2) return 3; - return 0; -} -#include "TRandom.h" -//_____________________________________________________________________________ -int StvConeRejector::TestIt() const -{ - float x[3]; - - for (int i=0;i<20;i++) { - - int ifail = 0; - double r = (mOutRad*1.5)*gRandom->Rndm(); - if (r >mOutRad) ifail+=1; - double sThet = mSin*1.1; if(sThet>=0.99) sThet=0.99; - sThet = sThet*gRandom->Rndm(); - if (sThet>mSin) ifail+=2; - double cThet = sqrt(1.-sThet*sThet); - double alfa = M_PI*2*gRandom->Rndm(); - for (int j = 0;j<3;j++) { - x[j] = r*(mDir[0][j]*cThet + sThet*(mDir[1][j]*cos(alfa)+mDir[2][j]*sin(alfa))); - } - if (Dot(x,x)>mOutRad*mOutRad) ifail+=4; - Add(x,x,mPos); - int irej = Reject(x); - assert((!!irej) == (!!ifail)); - } - return 0; -} diff --git a/StRoot/StvSeed/StvConeRejector.h b/StRoot/StvSeed/StvConeRejector.h deleted file mode 100644 index de11fe27853..00000000000 --- a/StRoot/StvSeed/StvConeRejector.h +++ /dev/null @@ -1,43 +0,0 @@ -/// \File StvConeRejector.h -/// \author Victorb Perev 01/2010 -/// \class StvConeRejector - -#ifndef StvConeRejector_HH -#define StvConeRejector_HH -#include "StvSeed/StvSeedConst.h" - -class StvConeRejector -{ -public: - StvConeRejector (); - ~StvConeRejector (){;} -void Reset(const float pos[3],const float dir[3]=0 - ,float len=0,float theta=0,float err=0); -void Prepare(); -const Mtx33F_t &GetDir() const { return mDir;} - -// 0=accepted -int Reject(const float x[3]) const; -int TestIt() const; -private: - -public: -// Input data -char mBeg[1]; -float mPos[3]; // start position -float mDir[3][3]; // track direction + orthogonal axises -float mOutRad; // cone radius of limitation (similar to height) -float mOutRad2; // mOutRad**2 -float mRxy; // Rxy ofstart position -float mRxy2; // Rxy**2 -float mR2; // R**2 -float mThet; // 1/2 of cone angle -float mCos; // cos(mThet) -float mSin; // sin(mThet) -float mTan2; // tan(mThet)**2 -float mErr; // 3d accuracy to be inside of cone -float mLim[2][3]; // xyz min and xyz max of cube around the cone -char mEnd[1]; -}; - -#endif diff --git a/StRoot/StvSeed/StvDefaultSeedFinder.cxx b/StRoot/StvSeed/StvDefaultSeedFinder.cxx deleted file mode 100644 index 58c2c4c2dc0..00000000000 --- a/StRoot/StvSeed/StvDefaultSeedFinder.cxx +++ /dev/null @@ -1,514 +0,0 @@ -#include -#include -#include -#include "TCernLib.h" -#include "TVector3.h" -#include "StvDefaultSeedFinder.h" -#include "StMultiKeyMap.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "Stv/StvHit.h" -#include "THelixTrack.h" -//#define APPROX_DEBUG -#ifdef APPROX_DEBUG -#include "TCanvas.h" -#include "TH1F.h" -#include "TProfile.h" -#endif //APPROX_DEBUG -#include "StvSeedConst.h" -#include "Stv/StvConst.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvDraw.h" - - -void myBreak(int); -enum {kFstAng=65,kErrFakt=4,kLenFakt=4,kMaxLen=300}; -enum {kPhi=0,kRxy=1,kTanL=2,kZ=3}; -static const double kFstTan = tan(kFstAng*M_PI/180); -static const double kMinTan = 0.01; - -ClassImp(StvDefaultSeedFinder) - -//_____________________________________________________________________________ -StvDefaultSeedFinder::StvDefaultSeedFinder(const char *name):StvSeedFinder(name) -{ - memset(mBeg,0,mEnd-mBeg+1); - fMultiHits = new StMultiKeyMap(kNKeys); - fMultiIter = new StMultiKeyMapIter(0); - f1stHitMap = new Stv1stHitMap; - f1stHitMapIter= new Stv1stHitMapIter; - fSgn = 1; -} -//_____________________________________________________________________________ -void StvDefaultSeedFinder::Clear(const char*) -{ - memset(mBeg,0,mMed-mBeg+1); - f1stHitMap->clear(); - fMultiHits->Clear(); - *f1stHitMapIter = f1stHitMap->end(); - StvSeedFinder::Clear(); -} -//_____________________________________________________________________________ -void StvDefaultSeedFinder::Reset() -{ - memset(mBeg,0,mMed-mBeg+1); - const StVoidArr *hitArr = StTGeoProxy::Inst()->GetSeedHits(); - int nHits = hitArr->size(); - for (int iHit=0;iHittimesUsed()) continue; - const float *x = stiHit->x(); - float r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - f1stHitMap->insert(std::pair(-fSgn*r2, stiHit)); - - fMultiHits->Add(stiHit,x); - } - fMultiHits->MakeTree(); - *f1stHitMapIter = f1stHitMap->begin(); -} -//_____________________________________________________________________________ -int StvDefaultSeedFinder::Again(int ) -{ - *f1stHitMapIter = f1stHitMap->begin(); - mNDejavu = 0; - return 1; -} -//_____________________________________________________________________________ -void StvDefaultSeedFinder::ShowIn() -{ - fDraw = StvDraw::Inst(); - if (mSel.mPnt) fDraw->Hits(mSel.mNPnt,mSel.mPnt); - StvSeedFinder::ShowIn(); -} -//_____________________________________________________________________________ -// Start of Local auxiliary routines -inline static void Lagrange3Int (float t,float T1,float T2,float coe[3]) -{ - coe[0]= (t-T1)*(t-T2)/(T1*(T2 )); - coe[1]= -(t )*(t-T2)/(T1*(T2-T1)); - coe[2]= (t )*(t-T1)/(T2*(T2-T1)); -} -//_____________________________________________________________________________ -inline static void ZLine3Int (float t,float T1,float T2,float coe[3]) -{ - float aT = (T1 +T2 )/3; - float aTT = (T1*T1+T2*T2)/3; - float det = aTT-aT*aT; - coe[0] = (1. + ( -aT)*(t-aT)/det)/3; - coe[1] = (1. + (T1-aT)*(t-aT)/det)/3; - coe[2] = (1. + (T2-aT)*(t-aT)/det)/3; -} - -//_____________________________________________________________________________ -inline static void Lagrange3Der (float t,float T1,float T2,float coe[3]) -{ - coe[0]= ((t-T1)+(t-T2))/(T1*(T2 )); - coe[1]= -((t )+(t-T2))/(T1*(T2-T1)); - coe[2]= ((t )+(t-T1))/(T2*(T2-T1)); -} -//_____________________________________________________________________________ -inline static void ZLine3Der (float T1,float T2,float coe[3]) -{ - float aT = (T1 +T2 )/3; - float aTT = (T1*T1+T2*T2)/3; - float det = aTT-aT*aT; - coe[0] = ( -aT)/det/3; - coe[1] = (T1-aT)/det/3; - coe[2] = (T2-aT)/det/3; -} -//_____________________________________________________________________________ -inline static float Dot(const float dir[3],const float pnt[3]) -{ - return dir[0]*pnt[0]+dir[1]*pnt[1]+dir[2]*pnt[2]; -} -//_____________________________________________________________________________ -inline static float Prj(const float dir[3],const float pnt[3],const float beg[3]) -{ - return dir[0]*(pnt[0]-beg[0])+dir[1]*(pnt[1]-beg[1])+dir[2]*(pnt[2]-beg[2]); -} -//_____________________________________________________________________________ -inline static void Mul(const float a[3],float scale,float b[3]) -{ - b[0]=a[0]*scale;b[1]=a[1]*scale;b[2]=a[2]*scale; -} -//_____________________________________________________________________________ -inline static float Dir(const float a[3],const double b[3],float dir[3]) -{ - - dir[0] = a[0];dir[1] = a[1];dir[2] = a[2]; - if (b[2]<1e11) {dir[0]-=b[0];dir[1]-=b[1];dir[2]-=b[2];} - double len = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]); - dir[0]/=len; dir[1]/=len;dir[2]/=len; - return len; -} -//_____________________________________________________________________________ -inline static float Impact2(const float dir[3],const float pnt[3]) -{ - float imp[3]; - imp[0] = dir[1]*pnt[2]-dir[2]*pnt[1]; - imp[1] = dir[2]*pnt[0]-dir[0]*pnt[2]; - imp[2] = dir[0]*pnt[1]-dir[1]*pnt[0]; - return imp[0]*imp[0]+imp[1]*imp[1]+imp[2]*imp[2]; -} -// End of Local auxiliary routines -//_____________________________________________________________________________ -const THelixTrack* StvDefaultSeedFinder::NextSeed() -{ -static int nCall = 0; nCall++; -std::vector mySeedObjs; - - StvHit *fstHit,*selHit=0; - - int nTally = 0; - while ((*f1stHitMapIter)!=f1stHitMap->end()) {//1st hit loop - fstHit = (*(*f1stHitMapIter)).second; - int fstIdTruth = fstHit->idTru(); - int notMine = 1; - do { - if (fIdTruth && !fstIdTruth) break; - if (fstHit->timesUsed() || mNDejavu>=kNDejavu) break; - } while((notMine=0)); - if (notMine) { //1st hit not useful - ++(*f1stHitMapIter); mNDejavu = 0; continue; - } - fSeedHits.clear(); - mSel.Reset(); - selHit = fstHit; - m1stHit = fstHit->x(); - mSel.SetErr(sqrt(fstHit->err2())*kErrFakt); - - while (1) { //Search next hit -// Add info from selected hit - nTally++; - fSeedHits.push_back(selHit); fNUsed[0]++; - if (fSeedHits.size()>=kMaxHits) break; -// Store second hit to skip it next time - if (fSeedHits.size()==2) mDejavu[mNDejavu++]=selHit; - const StHitPlane *hp = selHit->detector(); - const float *hd = hp->GetDir(selHit->x())[0]; - mSel.AddHit(selHit->x(),hd,hp->GetLayer()); - mSel.Prepare(); - - fMultiIter->Set(fMultiHits->GetTop(),mSel.mLim[0],mSel.mLim[1]); - - selHit=0; -// for (StMultiKeyNode *node=0;(node = *(*fMultiIter)) ;++(*fMultiIter)) - StMultiKeyNode *node=0; - StvHit *nexHit = 0; - while(1) { - node = *(*fMultiIter) ; if (!node) break; - nexHit = (StvHit*)node->GetObj() ;++(*fMultiIter); - - if (nexHit->isUsed()) continue; - if (fIdTruth && fstIdTruth!=nexHit->idTru()) continue; - const StHitPlane *hpNex = nexHit->detector(); - if (hpNex==hp) continue; - int dejavu = 0; - for (int j=0;jx(),hpNex); - if (ans>0) continue; //hit outside the cone - - // Selecting the best - selHit=nexHit; - if (!ans) continue; - // Decrease size of searching box - mSel.Update(); - fMultiIter->Update(mSel.mLim[0],mSel.mLim[1]); - } //endMultiIter loop - - if (!selHit) break; //No more hits - }// end NextHit loop -// If no hits found, go to next 1st hit - - if ((int)fSeedHits.size()<=1) {mNDejavu = 99; continue;} - if ((int)fSeedHits.size() < fMinHits) continue; - - - const THelixTrack *hel = Approx(); - -#if 0 - if (hel) { //print all seed hits - for (int it = 0;it<(int)fSeedHits.size(); ++it) { - auto *hit = fSeedHits[it]; - printf("%d *** StvDefaultSeedFinder::NextSeed %g %g %g %s ***\n",it - ,hit->x()[0],hit->x()[1],hit->x()[2] - ,hit->detector()->GetName()); - } } - - -#endif - - - - - if (hel) { fNSeeds[0]++;;return hel;} //Good boy - // Bad seed - fNUsed[0] -= fSeedHits.size(); - }// end 1st hit loop - fNSeeds[1]+=fNSeeds[0]; fNUsed[1]+= fNUsed[0]; - return 0; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StvConeSelector::StvConeSelector() -{ - memset(mBeg,0,mEnd-mBeg+1);mSgn=1; - mVtx[2] = 1e6; -} -//_____________________________________________________________________________ -void StvConeSelector::AddHit(const float *x,const float *dir,float layer) -{ - mMinPrj = 1.e11; mMinImp = 1.e11; mHp = 0; - mX[++mJst]=x; - mHit = x; - mLayer = layer; - mHitDir = dir; - assert(mJst<100); -} -//_____________________________________________________________________________ -void StvConeSelector::Prepare() -{ -static int nCall=0; nCall++; -StvDebug::Break(nCall); - - float Rxy = sqrt(mX[0][0]*mX[0][0]+mX[0][1]*mX[0][1]); - SetErr(SEED_ERR(Rxy)*kErrFakt); - float stp=0,myLen; - int kase = mJst; if (kase>2) kase = 2; - - switch(kase) { - - case 0: { - if (mVtx[2]>1e3) { - myLen = sqrt(Dot(mX[0],mX[0])); - Mul(mX[0] ,-mSgn/myLen,mDir); - } else { - float myX[3] = { mX[0][0]-mVtx[0],mX[0][1]-mVtx[1],mX[0][2]-mVtx[2]}; - myLen = sqrt(Dot(myX,myX)); - Mul(myX ,-mSgn/myLen,mDir); - } - float sgn = Dot(mHit,mDir); - assert(mSgn*sgn<0); - mS[0]=0; - mTan = (mVtx[2]>=1e3)? kFstTan: mErr/myLen; - }; break; - - case 1: { - stp=0; - for (int i=0;i<3;i++) {mDir[i]=mHit[i]-mX[mJst-1][i]; stp+=mDir[i]*mDir[i];} - stp = sqrt(stp ); - for (int i=0;i<3;i++) {mDir[i]/=stp;} - mS[1]=stp; - mTan = mErr/stp; - }; break; - - - case 2: { - stp=0; - for (int i=0;i<3;i++) {float qwe=mHit[i]-mX[mJst-1][i]; stp+=qwe*qwe;} - stp = sqrt(stp ); - mS[mJst]=stp; - mTan = mErr/(mS[mJst]+mS[mJst-1])/sqrt(3.); - float T1 = mS[mJst-1],T2 = mS[mJst]+T1; - float coe[3]; - Lagrange3Der (T2,T1,T2,coe); - - mDir[0] = coe[0]*mX[mJst-2][0]+coe[1]*mX[mJst-1][0]+coe[2]*mHit[0]; - mDir[1] = coe[0]*mX[mJst-2][1]+coe[1]*mX[mJst-1][1]+coe[2]*mHit[1]; - mDir[2] = coe[0]*mX[mJst-2][2]+coe[1]*mX[mJst-1][2]+coe[2]*mHit[2]; - stp=0; - for (int i=0;i<3;i++) {stp+=mDir[i]*mDir[i];} - stp = sqrt(stp ); - for (int i=0;i<3;i++) {mDir[i]/=stp;} - }; break; - - default: assert(0 && "Wrong case"); - } - mRxy2 = mHit[0]*mHit[0]+mHit[1]*mHit[1]; - mRxy = sqrt(mRxy2); - mDelta = SEED_ERR(mRxy); - mLen= mLayer*kLenFakt/(fabs(Dot(mHitDir,mDir))+1e-10); - if (mLen>kMaxLen) mLen = kMaxLen; - UpdateLims(); - -} -#ifndef MultiPhiZMap -//_____________________________________________________________________________ -void StvConeSelector::UpdateLims() -{ - mLim[2][0]=1e11; - for (int i=0;i<3;i++) { - float qwe = mLen*mDir[i]; - float asd = mLen*mTan*sqrt(fabs(1-mDir[i]*mDir[i])); - float lim = qwe - asd - mErr; - mLim[0][i] = (lim<0)? lim:-mErr; - lim = qwe + asd + mErr; - mLim[1][i] = (lim>0)? lim: mErr; -// Move to global system - mLim[0][i]+= mHit[i]; - mLim[1][i]+= mHit[i]; - } - -// // Account that all the hits inside of cylinder with Rxy -// for (int i=0;i<2;i++) { -// if (mLim[0][i]<-mRxy) mLim[0][i]=-mRxy; -// if (mLim[1][i]> mRxy) mLim[1][i]= mRxy; -// } - -} -#endif -#ifdef MultiPhiZMap -//_____________________________________________________________________________ -void StvConeSelector::UpdateLims() -{ -static int nCall=0; nCall++; -StvDebug::Break(nCall); -struct myLim_t {double Phi,Rxy,tanL,Z;}; -//static const StvConst *kons = StvConst::Inst(); -static const double kMyMax = 220; - TVector3 vHit(mHit); - TVector3 nT(mDir); - TVector3 nP(nT.Orthogonal()); - TVector3 nL(nT.Cross(nP)); - enum {kPNT = sizeof(mPnt)/sizeof(mPnt[0])}; - - for (int ix=0;ix<3;ix++) { - if (vHit[ix]+nT[ix]*mLen > kMyMax) {mLen = ( kMyMax-1-vHit[ix])/nT[ix];} - if (vHit[ix]+nT[ix]*mLen <-kMyMax) {mLen = (-kMyMax+1-vHit[ix])/nT[ix];} - } - TVector3 vBas(vHit+nT*mLen); - mNPnt=0; - mPnt[mNPnt++]=vHit; - double myRad = mLen*mTan*sqrt(2.)+mErr; - for (int i=-1;i<2;i+=2) { - mPnt[mNPnt++]=vBas+nP*(i*myRad); - mPnt[mNPnt++]=vBas+nL*(i*myRad); - assert(mNPnt<=kPNT); - } - -// account points out of volume. - int nPnt1st = mNPnt; - int ySign = (vHit[1]<0)? -1:1; - for (int ip=1;ip kMyMax) {lim = kMyMax-1;} - else if (P[ix] < -kMyMax) {lim = -kMyMax+1;} - if (!lim) continue; - for (int jHB=0;jHB<2;jHB++) { - alfa = (lim-(*vHB[jHB])[ix])/(P[ix]-(*vHB[jHB])[ix]); - if (alfa<0.01) alfa=0.01; - assert(alfa>=0 && alfa<1); - if (ALFA[jHB]>alfa) ALFA[jHB]=alfa; - } } //End ix loop - if (fabs(P[ix]) < kMyMax) continue; - double lim = (P[ix]<0)? -kMyMax: kMyMax; - double al = (lim-vHit[ix])/(P[ix]-vHit[ix]); - if (al<0.01) al=0.01; - assert(al>=0 && al<1); - if (alfa>al) alfa=al; - } //End ix loop - - if (alfa<1) {P = P*alfa + vHit*(1-alfa);} -// Now upp and down in Y (to avoid problems with Phi = +-Pi) - if (P[1]*ySign >0) continue; - alfa = -vHit.y()/(P.y()-vHit.y()); - mPnt[mNPnt++] = P*alfa*0.99 + vHit*(1-alfa*0.99); - mPnt[mNPnt++] = P*alfa*1.01 + vHit*(1-alfa*1.01); - }// end of point loop - - myLim_t Dow[2]={{ 1e11, 1e11, 1e11, 1e11},{ 1e11, 1e11, 1e11, 1e11}}; - myLim_t Upp[2]={{-1e11,-1e11,-1e11,-1e11},{-1e11,-1e11,-1e11,-1e11}}; - for (int ip=0;ipphi) dow.Phi=phi; - if (upp.Phirxy) dow.Rxy=rxy; - if (upp.Rxyz) dow.Z=z; - if (upp.ZtanL) dow.tanL=tanL; - if (upp.tanL -M_PI/2) kase |=2; - if (Dow[1].Phi < M_PI/2) kase |=4; - if (Upp[1].Phi > M_PI/2) kase |=8; - - mLim[2][0] = 1e11; - if ((kase&(1|8))!=(1|8)) { // Np ambiguity - mLim[0][kPhi ] = MIN(Dow[0].Phi ,Dow[1].Phi ); - mLim[0][kRxy ] = MIN(Dow[0].Rxy ,Dow[1].Rxy ); - mLim[0][kTanL] = MIN(Dow[0].tanL,Dow[1].tanL); - mLim[0][kZ ] = MIN(Dow[0].Z ,Dow[1].Z ); - mLim[1][kPhi ] = MAX(Upp[0].Phi ,Upp[1].Phi ); - mLim[1][kRxy ] = MAX(Upp[0].Rxy ,Upp[1].Rxy ); - mLim[1][kTanL] = MAX(Upp[0].tanL,Upp[1].tanL); - mLim[1][kZ ] = MAX(Upp[0].Z ,Upp[1].Z ); - } else { - for (int li=0,du=0;li<=2;li+=2,du++) { - mLim[li+0][kPhi ] = Dow[du].Phi ; - mLim[li+0][kRxy ] = Dow[du].Rxy-mErr ; - mLim[li+0][kTanL] = Dow[du].tanL; - mLim[li+0][kZ ] = Dow[du].Z -mErr ; - - mLim[li+1][kPhi ] = Upp[du].Phi ; - mLim[li+1][kRxy ] = Upp[du].Rxy +mErr; - mLim[li+1][kTanL] = Upp[du].tanL; - mLim[li+1][kZ ] = Upp[du].Z +mErr; - } - } -} -#endif //MultiPhiZMap -//_____________________________________________________________________________ -int StvConeSelector::Reject(const float x[3],const void* hp) -{ - if (x[0]*x[0]+x[1]*x[1]>mRxy2) return 1; - - float xx[3] = {x[0]-mHit[0],x[1]-mHit[1],x[2]-mHit[2]}; - - float r2xy = xx[0]*xx[0]+xx[1]*xx[1]; - float z2 = xx[2]*xx[2]; - if (r2xy < (kMinTan*kMinTan)*z2) return 3; - mHitLen = (r2xy+z2); - if (mHitLen < 1e-8) return 4; - mHitPrj = Dot(xx,mDir); - if (mHitPrj < 1e-8) return 4; - if (mHitPrj>mLen) return 6; //Outside of cone along - float imp =mHitLen-mHitPrj*mHitPrj; if (imp<=0) imp = 0; - float lim = (mErr) + mHitPrj*mTan; - if (imp > lim*lim) return 7; //Outside of cone aside - int ans = 99; - if (mHp != hp) { //different layers, only prj is important - if (mHitPrj>mMinPrj) return 8; //more far than best,along - ans = -1; - } else { //same layer, only impact is important - if (imp>mMinImp) return 9; //same plane but impact bigger - ans = 0; - } - if (hp) {mMinPrj= mHitPrj; mMinImp=imp; mHp = hp;} - return ans; //impact best but cone the same -} -//_____________________________________________________________________________ -void StvConeSelector::Update() -{ - if (mLen<=mHitPrj) return; - mLen = mHitPrj; - UpdateLims(); -} - - diff --git a/StRoot/StvSeed/StvDefaultSeedFinder.h b/StRoot/StvSeed/StvDefaultSeedFinder.h deleted file mode 100644 index a435756d1e3..00000000000 --- a/StRoot/StvSeed/StvDefaultSeedFinder.h +++ /dev/null @@ -1,109 +0,0 @@ -/// \File StvDefaultSeedFinder.h -/// \author Victor Perev 01/2010 -#ifndef StvDefaultSeedFinder_HH -#define StvDefaultSeedFinder_HH -#include "TVector3.h" -#include "Stv/StvSeedFinder.h" -#include -#include -enum {kNKeys = 3}; - - -class StvHit; -class StMultiKeyMap; -typedef std::multimap Stv1stHitMap; -typedef Stv1stHitMap::iterator Stv1stHitMapIter; -class StMultiKeyMapIter; - -class StvConeSelector -{ -public: - StvConeSelector(); - ~StvConeSelector(){;} - -void Reset() {mJst=-1;} -void Prepare(); -void Update(); -void AddHit(const float *x,const float *dir,float layer); -void SetErr(float err) {mErr=err;} -void SetSgn(int dir=1) { mSgn = dir; } -void SetVtx(const float vtx[3]) { memcpy(mVtx,vtx,sizeof(mVtx));} - -int Reject(const float x[3],const void* hp); // 0 :x accepted - // >0 :x rejected - //-1 =x accepted and lims updated -private: -void UpdateLims(); //Update limits - -public: -// Input data -char mBeg[1]; -int mJst; -const void* mHp; -float mVtx[3]; -float mErr; -float mRxy2; -float mRxy; -float mDelta; -float mZ2; -float mDir[3]; // track direction -float mLayer; -const float *mHitDir; // hit plane direction -float mLen; // cone length (height) -// Calculated data - -float mTan; // (tan(cone angle/2) -float mLim[4][kNKeys]; -// Output data -float mHitLen; -float mHitPrj; -float mMinPrj; -float mMinImp; - -const float *mX[100]; -const float *mHit; -float mS[100]; -int mNPnt; -char mEnd[1]; -int mSgn; -TVector3 mPnt[100]; -}; - -class StvDefaultSeedFinder : public StvSeedFinder -{ -enum { kNDejavu=4 }; -public: - StvDefaultSeedFinder(const char *name="Default"); - ~StvDefaultSeedFinder(){;} - const THelixTrack* NextSeed(); - void Clear(const char *opt=""); - int Again(int repeat); - void Reset(); - void Print(const char *opt="") const {;} - void ShowIn(); - int Reject(const float x[3]) {return mSel.Reject(x,0)>0;} -void SetSgn(int dir=1) { fSgn = dir; mSel.SetSgn(dir);} -void SetVtx(const float vtx[3]) { StvSeedFinder::SetVtx(vtx); mSel.SetVtx(fVtx);} - -protected: - -private: -char mBeg[1]; -int fIPass,fNSeeds[2],fNUsed[2]; -char mMed[1]; -int mNDejavu; -const StvHit *mDejavu[kNDejavu]; - -StMultiKeyMap *fMultiHits; -StMultiKeyMapIter *fMultiIter; -Stv1stHitMap *f1stHitMap; -Stv1stHitMapIter *f1stHitMapIter; -float const *m1stHit; -float m1stDir[3]; // first track direction -char mEnd[1]; -StvConeSelector mSel; -ClassDef(StvDefaultSeedFinder,0); -}; - - -#endif diff --git a/StRoot/StvSeed/StvKNSeedFinder.cxx b/StRoot/StvSeed/StvKNSeedFinder.cxx deleted file mode 100644 index 7e9a7a62a1a..00000000000 --- a/StRoot/StvSeed/StvKNSeedFinder.cxx +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include "TCernLib.h" -#include "TSystem.h" -#include "TVector3.h" -#include "StMultiKeyMap.h" -#include "THelixTrack.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StvSeed/StvSeedConst.h" - -#ifndef __NOSTV__ -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -#include "StvKNSeedFinder.h" -#include "Stv/StvHit.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvDraw.h" -#endif - -#ifdef APPROX_DEBUG -#include "TCanvas.h" -#include "TH1F.h" -#include "TProfile.h" -#endif //APPROX_DEBUG -void myBreak(int); - -#ifndef __NOSTV__ -ClassImp(StvKNSeedFinder) -#endif - -enum {kMinRxy = 1}; - - -//_____________________________________________________________________________ -StvKNSeedFinder::StvKNSeedFinder(const char *name):StvSeedFinder(name) -{ - memset(mBeg,0,mEnd-mBeg+1); - mSel.Set(fMinHits); - fMultiHits = new StMultiKeyMap(3); - fMultiIter = new StMultiKeyMapIter(0); - f1stHitMap = new Stv1stHitMap; - f1stHitMapIter= new Stv1stHitMapIter; -} -//_____________________________________________________________________________ -void StvKNSeedFinder::Clear(const char*) -{ - memset(mBeg,0,mMed-mBeg+1); - f1stHitMap->clear(); - fMultiHits->Clear(); - *f1stHitMapIter = f1stHitMap->end(); - StvSeedFinder::Clear(); -} -//_____________________________________________________________________________ -void StvKNSeedFinder::Reset() -{ - memset(mBeg,0,mMed-mBeg+1); -#ifndef __NOSTV__ -static const float kSqrHlf = sqrt(0.5); - assert(!f1stHitMap->size()); - const StVoidArr *hitArr = StTGeoProxy::Inst()->GetSeedHits(); - int nHits = hitArr->size(); - for (int iHit=0;iHittimesUsed()) continue; - const float *x = hit->x(); - float r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - f1stHitMap->insert(std::pair(-r2, hit)); - float xx[5] = {x[0],x[1],x[2],(x[0]+x[1])*kSqrHlf,(-x[0]+x[1])*kSqrHlf}; - fMultiHits->Add(hit,xx); - } - - fMultiHits->MakeTree(); - *f1stHitMapIter = f1stHitMap->begin(); -#endif -} -//_____________________________________________________________________________ -int StvKNSeedFinder::Again(int) -{ - *f1stHitMapIter = f1stHitMap->begin(); - return 1; -} -//_____________________________________________________________________________ -const THelixTrack* StvKNSeedFinder::NextSeed() -{ -static int nCall=0; nCall++; - int nTotHits=0,nAccHits=0; - - if (fstHit) ++(*f1stHitMapIter); //Next seed if success - for (;(*f1stHitMapIter)!=f1stHitMap->end();++(*f1stHitMapIter)) {//1st hit loop - - fstHit = (*(*f1stHitMapIter)).second; - assert(fstHit); - if (fstHit->timesUsed()) continue; - fSeedHits.clear(); - const float *fstPos = fstHit->x(); - const StHitPlane *fstHp = fstHit->detector(); - mRej.Reset(fstPos); - mRej.Prepare(); - fMultiIter->Set(fMultiHits->GetTop(),mRej.mLim[0],mRej.mLim[1]); - mSel.Reset(fstHit->x(),&(mRej.GetDir()),fstHit); - nTotHits=0;nAccHits=0; - -// Add all near hits - for (StMultiKeyNode *node=0;(node = *(*fMultiIter)) ;++(*fMultiIter)) - { -// Search next hit - StvHit *nexHit = (StvHit*)node->GetObj(); - - if (nexHit->isUsed()) continue; - if (nexHit->detector()==fstHp) continue; - nTotHits++; - int ans = mRej.Reject(nexHit->x()); - if (ans) StvDebug::Count("KNNRej",10+ans); - if (ans) continue; - nAccHits++; - - mSel.Add(nexHit->x(),nexHit,nexHit->detector()); - - } //endMultiIter loop - if (nAccHitsGetNode(StvTrack::kFirstPoint); - double P[3]; - node->GetFP().getMom(P); - - double eta = TVector3(P).Eta(); - int nHits = tk->GetNHits(kPxlId); - nHits += tk->GetNHits(kIstId); - nHits += tk->GetNHits(kSstId); - StvDebug::Count("GoodEta",eta); - if (nHits>=2) StvDebug::Count("HftEta",eta); -#endif -} - diff --git a/StRoot/StvSeed/StvKNSeedFinder.h b/StRoot/StvSeed/StvKNSeedFinder.h deleted file mode 100644 index 9d8beef5ad9..00000000000 --- a/StRoot/StvSeed/StvKNSeedFinder.h +++ /dev/null @@ -1,56 +0,0 @@ -/// \File StvKNSeedFinder.h -/// \author Victorb Perev 01/2010 -#ifndef StvKNSeedFinder_HH -#define StvKNSeedFinder_HH -#ifndef __NOSTV__ -#include "Stv/StvSeedFinder.h" -#endif -#include "StvSeedConst.h" -#include "StvConeRejector.h" -#include "StvKNSeedSelector.h" -#include -#include -/// \class StvKNSeedFinder - -class StvHit; -class StvHits; -class StvTrack; -class StMultiKeyMap; -typedef std::multimap Stv1stHitMap; -typedef Stv1stHitMap::iterator Stv1stHitMapIter; -class StMultiKeyMapIter; - - -class StvKNSeedFinder : public StvSeedFinder -{ -public: - StvKNSeedFinder(const char *name="KN"); - ~StvKNSeedFinder(){;} - const THelixTrack* NextSeed(); - void Clear(const char *opt=""); - int Again(int repeat); - void Reset(); - void FeedBack(const StvTrack *tk); - void Print(const char *opt="") const {;} - const StvHits *GetHits() const; - const float *Eigen(){return mSel.Eigen();} - virtual void Show(); -protected: - -protected: -char mBeg[1]; -int fNSeeds[2],fNUsed[2]; -StvHit *fstHit; -char mMed[1]; -StMultiKeyMap *fMultiHits; -StMultiKeyMapIter *fMultiIter; -Stv1stHitMap *f1stHitMap; -Stv1stHitMapIter *f1stHitMapIter; -char mEnd[1]; -StvConeRejector mRej; -StvKNSeedSelector mSel; -ClassDef(StvKNSeedFinder,0); -}; - - -#endif diff --git a/StRoot/StvSeed/StvKNSeedSelector.cxx b/StRoot/StvSeed/StvKNSeedSelector.cxx deleted file mode 100644 index 027a627e220..00000000000 --- a/StRoot/StvSeed/StvKNSeedSelector.cxx +++ /dev/null @@ -1,570 +0,0 @@ -#include -#include -#include -#include -#include "StvUtil/StvDebug.h" -#include "StvKNSeedSelector.h" -#include "Stv/StvHit.h" - -#include "TStopwatch.h" - - -#include "StvSeedConst.h" -//static const float kMaxDis = 9*3.14/180; //???Maximal angle allowed for connected hits -//static const float kMaxDis = 15*3.14/180; //???Maximal angle allowed for connected hits -static const float kMaxDis = 30*3.14/180; //???Maximal angle allowed for connected hits -static const float kMaxLam = (M_PI-kMaxDis)/2; -static const float kSinDis = sin(kMaxDis/2); - -//static const float kMinDis = 1*3.14/180;; //KN angle allowed -//static const float kMinDis = 2*3.14/180;; //KN angle allowed -//static const float kMinDis = 9*3.14/180;; //KN angle allowed -static const float kMinDis = 5*3.14/180;; //KN angle allowed -//static const float kMinDis = 3*3.14/180;; //KN angle allowed -//static const float kMinDis = 12*3.14/180;; //KN angle allowed - -//static const float kDisRatio= 1.0; //ratio for KNN distance -//static const float kDisRatio= 0.7; //ratio for KNN distance -//static const float kDisRatio= 0.6; //ratio for KNN distance -//static const float kDisRatio= 0.8; //ratio for KNN distance -//static const float kDisRatio= 0.9; //ratio for KNN distance -//static const float kDisRatio= 1.5; //ratio for KNN distance -static const float kDisRatio= 3.; //ratio for KNN distance - -static const float kErrFact= 1./3; //bigErr/kErrFact/len is angle error - -//enum { kNumTheDiv = 20 }; //number of divisions in theta -enum { kNumTheDiv = 40 }; //number of divisions in theta -static float kStpTheDiv = M_PI/kNumTheDiv; //step in theta map - -TStopwatch SW; - - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -static void Eigen2(const double err[3], float lam[2], float eig[2][2]) -{ - - double spur = err[0]+err[2]; - double det = err[0]*err[2]-err[1]*err[1]; - double dis = spur*spur-4*det; - if (dis<0) dis = 0; - dis = sqrt(dis); - lam[0] = 0.5*(spur+dis); - lam[1] = 0.5*(spur-dis); - if (!eig) return; - eig[0][0] = 1; eig[0][1]=0; - if (dis>1e-6*spur) {// eigenvalues are different - if (fabs(err[0]-lam[0])>fabs(err[2]-lam[0])) { - eig[0][1] = 1; eig[0][0]= -err[1]/(err[0]-lam[0]); - } else { - eig[0][0] = 1; eig[0][1]= -err[1]/(err[2]-lam[0]); - } - double tmp = sqrt(eig[0][0]*eig[0][0]+eig[0][1]*eig[0][1]); - eig[0][0]/=tmp; eig[0][1]/=tmp; - } - eig[1][0]=-eig[0][1]; eig[1][1]= eig[0][0]; -} - - -//_____________________________________________________________________________ -static inline double Ang( const float A[3],const float B[3]) -{ - double cang = ((A[0]-B[0])*A[0]+(A[1]-B[1])*A[1]+(A[2]-B[2])*A[2]); -assert(cang>-0.01); - if (cang<0) cang = 0; - double ang = 2*sqrt(cang/2); - if (ang>1.99) { ang = M_PI;} - else if (ang>1.0 ) { ang = 2.*asin(ang/2); } - return ang; -} -//_____________________________________________________________________________ -static inline void Ave( float A[3],const float B[3]) -{ - float nor = 0; - for (int i=0;i<3;i++) { A[i] += 0.2*B[i]; nor += A[i]*A[i];} - nor = sqrt(nor); - for (int i=0;i<3;i++) { A[i]/=nor;} -} -//_____________________________________________________________________________ -static inline void Add( float A[3],const float B[3],float len) -{ -float wt=len*len; - A[0] += B[0]*wt; A[1] += B[1]*wt; A[2] += B[2]*wt; -} -//_____________________________________________________________________________ -static inline void Sub( float A[3],const float B[3],float C[3]) -{ - A[0] = B[0]-C[0]; A[1] = B[1]-C[1]; A[2] = B[2]-C[2]; -} -//_____________________________________________________________________________ -static inline void Zer( float A[3]) -{ - A[0] =0; A[1] = 0; A[2] =0; -} -//_____________________________________________________________________________ -static inline double Nor(float A[3]) -{ - double sum = A[0]*A[0] + A[1]*A[1] + A[2]*A[2]; - sum = sqrt(sum); - A[0]/=sum;A[1]/=sum;A[2]/=sum; - return sum; -} -//_____________________________________________________________________________ -static inline void Fil(float *A,float F,int nA) -{ - for (int i=0;i0 && mLen <1000 && "mLen is wrong"); - double dot = D0t(mDir,mDir); - assert (fabs(dot-1)<1e-4 && "mDir is wrong"); - for (int i=0;i=0 && mDist[i]< 100 )); - assert( mNbor[i]>=0 || (mDist[i]>=1e10 && mDist[i]<=1e11)); - } - assert(mPhi>= -M_PI*2 && mPhi<=M_PI*2 ); - assert(mThe>= -M_PI/2 && mThe<=M_PI/2); - return 0; -} -//_____________________________________________________________________________ -void StvKNSeedSelector::Insert( int iA,int iB,float dis) -{ - float *a = mAux[iA].mDist; - if (dis >= a[kKNumber-1]) return; - int *n = mAux[iA].mNbor; - auto *detB = mAux[iB].mDet; - for (int jk=0;jka[jk]); - if (n[jk]<0){ - kase|=2; - } else { - auto *detJ = mAux[n[jk]].mDet; - if (detB == detJ) kase|=2; - } - switch (kase) { - case 1: continue; //Bigger only, goto next - case 3: return; //Bigger & same, Get out - case 0: //Insert - for (int j=kKNumber-2;j>=jk;j--) {a[j+1]=a[j]; n[j+1]=n[j];} //Insert - default: a[jk]=dis; n[jk]=iB; //end of list. Replace - } - break; - } - for (int jKNN = kKNumber-1; jKNN>=kKNminber; jKNN--) { - if (mKNNDist[jKNN] < a[jKNN]) continue; - mKNNDist[jKNN] = a[jKNN]; - mMinIdx[jKNN] = iA; - } -} -//_____________________________________________________________________________ -StvKNSeedSelector::StvKNSeedSelector() -{ - mStartHit = 0; - mAux.reserve(100); -} -//_____________________________________________________________________________ -/// Reset first hit position -/// @param float startPos[3] - position of starting hit -/// @param void *startHit - addres of hit. Format of hit is not used there - -void StvKNSeedSelector::Reset(const float startPos[3],const Mtx33F_t *dir, void *startHit) -{ - mState = 0; - mAux.clear(); - mSel.clear(); - mTheDiv.clear(); -#ifdef KNNMAP2 - mTheMap.clear(); -#endif - mDir = dir; - mStartHit = startHit; - memcpy(mStartPos,startPos,sizeof(mStartPos)); - for (int jk = kKNminber; jk(aux.mPhi,last)); - - float myMaxPhi = 2*kSinDis/aux.mCosThe; - if (myMaxPhi>=2*0.99) {myMaxPhi = M_PI;} - else if (myMaxPhi> 2*0.50) {myMaxPhi = 2*asin(myMaxPhi/2);} - - if (aux.mPhi-myMaxPhi<-M_PI) { - last = mAux.size(); mAux.resize(last+1); mAux.back() = aux; - mAux.back().mPhi = aux.mPhi+2*M_PI; - mTheDiv[iThe].insert(std::pair(mAux.back().mPhi,last)); - } - if (aux.mPhi+myMaxPhi> M_PI) { - last = mAux.size(); mAux.resize(last+1); mAux.back() = aux; - mAux.back().mPhi = aux.mPhi-2*M_PI; - mTheDiv[iThe].insert(std::pair(mAux.back().mPhi,last)); - } -#endif -#ifdef KNNMAP2 - mTheMap.insert(std::pair(aux.mThe,last)); -#endif -} -#ifdef KNNMAP0 -//_____________________________________________________________________________ -void StvKNSeedSelector::Relink() -{ - Fil(mMinIdx , -1,kKNumber); - Fil(mKNNDist,kMaxDis,kKNumber); - for (int i1=0;i1<(int)mAux.size();i1++) { -// if ( mAux[i1].mSel) continue; - assert(fabs(mAux[i1].mThe)<= M_PI ); - assert(fabs(mAux[i1].mPhi)<= M_PI*2); - mAux[i1].Reset(); - for (int i2=0;i2KMaxDis) continue; - float dang = fabs(mAux[i1].mPhi-mAux[i2].mPhi); - if (dang > M_PI) dang -= 2*M_PI; - if (fabs(dang)*mAux[i1].mCosThe>KMaxDis) continue; - Update(i1,i2); - } } -} -#endif -#ifdef KNNMAP1 -//_____________________________________________________________________________ -void StvKNSeedSelector::Relink() -{ - Fil(mMinIdx , -1,kKNumber); - Fil(mKNNDist,kMaxDis,kKNumber); - MyTheDiv::iterator it2The = mTheDiv.begin(); - for (MyTheDiv::iterator it1The = mTheDiv.begin(); - it1The != mTheDiv.end();++it1The) //Main loop over theta - { - float the1 = (*it1The).first; - for (;it2The!=mTheDiv.end();++it2The) { - float the2 = (*it2The).first; - if (the2>=the1-kMaxDis) break; - } - if (it2The==mTheDiv.end()) continue; - - - MyPhiDiv &my1PhiDiv = (*it1The).second; //Main phi loop - for (MyPhiDiv::iterator it1Phi=my1PhiDiv.begin(); - it1Phi != my1PhiDiv.end(); - ++it1Phi) {//Main loop over phi - int i1 = (*it1Phi).second; - StvKNAux &aux1 = mAux[i1]; - void* hit1 = aux1.mHit; -// if (aux1.mSel) continue; - // Secondary theta loop - for (MyTheDiv::iterator it3The=it2The;it3The!=mTheDiv.end();++it3The) - { - float the3 = (*it3The).first; - if (the3>aux1.mThe) break; - MyPhiDiv &my3PhiDiv = (*it3The).second; - - float myMaxPhi = 2*kSinDis/aux1.mCosThe; - if (myMaxPhi>=2) {myMaxPhi = M_PI;} - else if (myMaxPhi> 0.5) {myMaxPhi = 2*asin(myMaxPhi/2);} - int n = my3PhiDiv.size(); - MyPhiDiv::iterator it3Phi = (myMaxPhi5)? my3PhiDiv.lower_bound(aux1.mPhi-myMaxPhi) - : my3PhiDiv.begin(); - - for (;it3Phi !=my3PhiDiv.end(); ++it3Phi) { //loop over Phi partner - if ((*it3Phi).first > aux1.mPhi) break; - int i3 = (*it3Phi).second; - if (i3==i1) continue; - StvKNAux & aux3 = mAux[i3]; -// if ( aux3.mSel) continue; - if ( aux3.mHit==hit1) continue; - if (fabs(aux1.mThe-aux3.mThe) > kMaxDis) continue; - float dang = fabs(aux1.mPhi-aux3.mPhi); - if (dang > M_PI) dang -= 2*M_PI; - if (fabs(dang)*aux1.mCosThe>kMaxDis) continue; - Update(i1,i3); - }//end of it3Phi loop - }// end of it3The loop - }//End of main Phi loop - - }//End of main theta loop -} -#endif -#ifdef KNNMAP2 -//_____________________________________________________________________________ -void StvKNSeedSelector::Relink() -{ - Fil(mMinIdx , -1,kKNumber); - Fil(mKNNDist,kMaxDis,kKNumber); - auto it2The = mTheMap.begin(); - for (auto it1The = mTheMap.begin(); - it1The != mTheMap.end();++it1The) //Main loop over theta - { - float the1 = (*it1The).first; - int i1 = (*it1The).second; - auto &aux1 = mAux[i1]; -// if ( aux1.mSel) continue; - for (;it2The!=mTheMap.end();++it2The) { - float the2 = (*it2The).first; - if (the2>=the1-kMaxDis) break; - } - if (it2The==mTheMap.end()) continue; - for (auto it3The=it2The;it3The!=mTheMap.end();++it3The) - { - float the3 = (*it3The).first; - if (the3>the1) break; - int i3 = (*it3The).second; - if (i1 == i3) continue; - if (fabs(the3-the1)>kMaxDis) continue; - auto &aux3 = mAux[i3]; -// if ( aux3.mSel) continue; - float dang = fabs(aux1.mPhi-aux3.mPhi); - if (dang > M_PI) dang -= 2*M_PI; - if (fabs(dang)*aux1.mCosThe>kMaxDis) continue; - Update(i1,i3); - }// end of it3The loop - - }//End of main theta loop -} -#endif - - -//_____________________________________________________________________________ -int StvKNSeedSelector::Select() -{ -static int nCall=0; nCall++; - while (1) { - mSel.clear(); - mMapLen.clear(); - for (int i=0;i<(int)mAux.size();i++) { mAux[i].Test(i); } - - Relink(); - if (!mMinIdx) return 0; - for (int i=0;i<(int)mAux.size();i++) { mAux[i].Test(i); } - - - - for (mIKnn = kKNumber-1;mIKnn>=kKNminber; mIKnn--) - { - if (mMinIdx[mIKnn]<0) continue; -/// define the best direction - mMapLen.clear(); - memcpy(mAveDir,mAux[mMinIdx[mIKnn]].mDir,sizeof(mAveDir)); - assert(fabs(mAveDir[0])+fabs(mAveDir[1])+fabs(mAveDir[2])>0.1); - mNHits=0; - Pass(mMinIdx[mIKnn],mKNNDist[mIKnn]*kDisRatio); - double wid = Width(); - if (wid>90) continue; -if ((mKNNDist[mIKnn]*wid > kMinDis)) { - StvDebug::Count("BadDistWid",sqrt(mKNNDist[mIKnn]*wid)); - StvDebug::Count("BadDist_vs_Wid",sqrt(wid),sqrt(mKNNDist[mIKnn])); -} - if (mKNNDist[mIKnn]*wid > kMinDis) continue; -{ - StvDebug::Count("GooDistWid",sqrt(mKNNDist[mIKnn]*wid)); - StvDebug::Count("GooDist_vs_Wid",sqrt(wid),sqrt(mKNNDist[mIKnn])); -} - - const void *hpPre = 0; - mSel.push_back(mStartHit); - std::map::iterator myIt; - int iPre = 0; - mSel.clear(); - for (myIt = mMapLen.begin(); myIt !=mMapLen.end(); ++myIt) - { - int i = (*myIt).second; - const void *hp = ((StvHit*)(mAux[i].mHit))->detector(); - if (hpPre != hp ) { - mSel.push_back(mAux[i].mHit); - iPre = i;hpPre = hp; - continue; - } - //Hit from the same detector - float ang0 = Ang(mAveDir, mAux[iPre].mDir); - float ang1 = Ang(mAveDir, mAux[i ].mDir); - if (ang0accuAng) break; // the rest even bigger - int idx = aux.mNbor[ifan]; - if (mAux[idx].mSel==mIKnn) continue; - Pass(idx,accuAng); - } -} -//_____________________________________________________________________________ -void StvKNSeedSelector::Update(int ia,int ib) -{ - - if (mAux[ia].mDet == mAux[ib].mDet) return; - float *aDir = mAux[ia].mDir; - float *bDir = mAux[ib].mDir; - - double dis = Ang(aDir,bDir); - if (dis>kMaxDis) return; -// if (dis>mKNNDist) return; - Insert(ia,ib,dis); - Insert(ib,ia,dis); -} -#include "TVector3.h" -//_____________________________________________________________________________ -double StvKNSeedSelector::Width() -{ -static int nCall = 0; nCall++; - if (mMapLen.size()<3) return 1e11; - - TVector3 myX(mAveDir),myZ(myX.Orthogonal()),myY(myZ.Cross(myX)); - double G[3]={0},uv[2]={0}; - std::map::iterator myIt; - - for( myIt=mMapLen.begin(); myIt!=mMapLen.end();++myIt) - { - int i = (*myIt).second; - TVector3 dir(mAux[i].mDir); - double u = myY.Dot(dir); - double v = myZ.Dot(dir); - uv[0]+=u;uv[1]+=v; - G[0]+=u*u;G[1]+=u*v;G[2]+=v*v; - } - double dN = mMapLen.size(); - G[0]/=dN;G[1]/=dN;G[2]/=dN; uv[0]/=dN;uv[1]/=dN; - G[0]-=uv[0]*uv[0];G[1]-=uv[0]*uv[1];G[2]-=uv[1]*uv[1]; - Eigen2(G,mEigen,0); - return sqrt(mEigen[1]/(mEigen[0]+1e-11)); - -} - -#if 1 -#include "TSystem.h" -#include "TCanvas.h" -#include "TGraph.h" -#include "Stv/StvDraw.h" -class StvHit; -//______________________________________________________________________________ -void StvKNSeedSelector::Show() const -{ -static TCanvas *myCanvas = 0; -static TGraph *szGraph = 0; -static TGraph *ptGraph = 0; -static TGraph *slGraph = 0; - int startIdTru = GetIdTru(mStartHit); - std::vector X[3],Y[3]; - double reg[2][2]={{999,-999},{999,-999}}; - - TVector3 mainDir(mStartPos);mainDir*=(-1.); - mainDir = mainDir.Unit(); - TVector3 myX(mainDir),myY(myX.Orthogonal()),myZ(myX.Cross(myY)); - - int nPts = mAux.size(); - for (int ia =0;iau) reg[0][0]=u;if (reg[0][1]v) reg[1][0]=v;if (reg[1][1]Clear(); - delete szGraph; szGraph=0; - delete ptGraph; ptGraph=0; - delete slGraph; slGraph=0; - -// Define the scene - szGraph = new TGraph(2, reg[0], reg[1]); - szGraph->SetMarkerColor(kYellow); - szGraph->SetMarkerSize(5); - szGraph->Draw("AP"); - int color[3]={kGreen,kRed,kMagenta}; - for (int k=0;k<3;k++) { - if (!X[k].size()) continue; - ptGraph = new TGraph(X[k].size(), &X[k][0], &Y[k][0]); - ptGraph->SetMarkerColor(color[k]); - ptGraph->SetMarkerSize(1); - ptGraph->Draw("Same *"); - } - - myCanvas->Modified(); - myCanvas->Update(); - while(!gSystem->ProcessEvents()){gSystem->Sleep(200);}; - -} -#endif //Show -#include "Stv/StvHit.h" -//______________________________________________________________________________ -int StvKNSeedSelector::GetIdTru(const void *hit) const -{ - return ((StvHit*)hit)->idTru(); -} diff --git a/StRoot/StvSeed/StvKNSeedSelector.h b/StRoot/StvSeed/StvKNSeedSelector.h deleted file mode 100644 index 19b81e9111b..00000000000 --- a/StRoot/StvSeed/StvKNSeedSelector.h +++ /dev/null @@ -1,93 +0,0 @@ -/// \File StvKNSeedSelector.h -/// \author Victor Perev 01/2010 -#ifndef StvKNSeedSelector_HH -#define StvKNSeedSelector_HH -#include -#include -#include -#include "StvSeed/StvSeedConst.h" -typedef std::multimap MyPhiDiv; - -typedef std::map MyTheDiv; - - - -#include "TNamed.h" -/// \class StvKNSeedSelector - - -typedef std::vector VoidVec; -enum {kKNumber=5,kKNminber=2}; - -class StvKNAux { -public: - StvKNAux(); - void Reset(); - int Test(int idx) const; -public: - void *mHit; //void pointer to hit - const void *mDet; //void pointer to detector plane - float mLen; //distance from the 1st hit - float mDir[3]; //direction from the 1st hit - float mDist[kKNumber]; //sorted angles to nearest hits - float mPhi; - float mThe; - float mCosThe; - int mNbor[kKNumber]; //indices in Aux array to nearest hits - int mSel; //hit selected -}; - -class StvKNSeedSelector -{ -friend class StvKNSeedFinder; -public: - - StvKNSeedSelector(); - virtual ~StvKNSeedSelector(){;} -virtual int GetIdTru(const void *hit) const; - void Set(int minHits) { mMinHits = minHits;} - void Reset(const float startPos[3],const Mtx33F_t *dir,void *voidHit); - void Add (const float pos[3],void *voidHit, const void *voidDet); - int Select(); -const VoidVec &Get() const { return mSel;} - int GetNHits() const{ return mSel.size();} - void Show() const; -private: - void Relink(); - void Update(int ia,int ib); - void Insert(int ia,int ib,float dis); - void Pass(int iux,double accuAng); - double Width(); -const float *Eigen() const {return mEigen;} -protected: - int mMinHits; - int mState; //Status, &1 =narrow trace - int mIKnn; -const Mtx33F_t *mDir; -void *mStartHit; -float mStartPos[3]; -float mAveDir[3]; -float mStartRad; -float mKNNDist[kKNumber]; //minimal KN distance -int mMinIdx [kKNumber]; //index of aux with minimal KN distance -float mEigen[2];//Eigen numbers of uu,uv,vv matrix in most dense place -float mMaxSel; //Max angle deviation between hits -float mMaxAccu; //Max accumulated angle between hit & bestHit in Pass() -float mMaxNear; //Max angle between hits in Pass() -float mErr; //Estimated space error -int mNHits; //number of selected hits -VoidVec mSel; -std::vector mAux; -std::map mMapLen; -MyTheDiv mTheDiv; -}; -inline StvKNAux::StvKNAux() -{ - memset(this,0,sizeof(*this)); - Reset(); -} -inline void StvKNAux::Reset() -{ - for (int i=0;i -#include -#include -#include -#include -#include -#include "TROOT.h" -#include "TClass.h" -#include "TH1F.h" -#include "TBrowser.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TCanvas.h" -#include "TSystem.h" -#include "TString.h" -#include "StvDebug.h" -#include "StvGrappa.h" - -typedef std::map myTallyMap_t; -typedef myTallyMap_t::const_iterator myTallyIter_t; -static myTallyMap_t mgTally; - -int StvDebug::mgDebug=1; //0=no debug, 1=Normal, 2=count is on -StvGrappa *StvDebug::mgGrappa = 0; -StvGrappa *StvDebug::mgGrappaTmp= 0; - -typedef std::map myDebMap_t; -typedef myDebMap_t::const_iterator myDebIter_t; -static myDebMap_t myDebMap; - -typedef std::map myCanMap_t; -typedef myCanMap_t::const_iterator myCanIter_t; -myCanMap_t myCanMap; - -//______________________________________________________________________________ -int StvDebug::Break(int key) -{ static int kto=-20102017; - if (kto != key) return 0; - printf ("BOT OHO %d\n",key); - return 1; -} -//______________________________________________________________________________ -int StvDebug::Break(double x,double y,double z) -{ static double myX=-9999,myY=-9999,myZ=-9999; - if (fabs(x-myX)>0.2) return 0; - if (fabs(y-myY)>0.2) return 0; - if (fabs(z-myZ)>0.5) return 0; - printf ("BOT OHO %g==%g %g==%g %g==%g\n",x,myX,y,myY,z,myZ); - return 1; -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,double val) -{ - if (mgDebug<2) return; - TH1 *&h = (TH1*&)myDebMap[key]; - if (!h) { h = new TH1F(key,key,100,0.,0.);} - h->Fill(val); -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,const char *val) -{ - if (mgDebug<2) return; - TH1 *&h = (TH1*&)myDebMap[key]; - if (!h) { h = new TH1F(key,key,0,0.,0.);} - h->Fill(val,1.); -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,double val,double left,double rite) -{ - if (mgDebug<2) return; - TH1 *&h = (TH1*&)myDebMap[key]; - if (!h) { h = new TH1F(key,key,100,left,rite);} - h->Fill(val); -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,double valx, double valy - ,double leftx,double ritex - ,double lefty,double ritey) -{ - if (mgDebug<2) return; - TH1 *&h = (TH1*&)myDebMap[key]; - if (!h) { h = new TH2F(key,key,100,leftx,ritex,100,lefty,ritey);} - h->Fill(valx,valy); -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,double valx,double valy) -{ - if (mgDebug<2) return; - TH1 *&h = (TH1*&)myDebMap[key]; - if (!h) { h = new TH2F(key,key,100,0.,0.,100,0,0);} - h->Fill(valx,valy); -} -//______________________________________________________________________________ -void StvDebug::Count(const char *key,const char *valx,double valy) -{ - if (mgDebug<2) return; - TH2 *&h = (TH2*&)myDebMap[key]; - if (!h) { h = new TH2F(key,key,100,0.,0.,100,0,0);} - h->Fill(valx,valy,1.); -} -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -#if 0 -//______________________________________________________________________________ -void StvDebug::Sumary(int) -{ - printf("StvDebug::Sumary()\n"); - TH1 *H[4]; - int nH = 0,n=0; - for (myDebIter_t iter = myDebMap.begin();iter != myDebMap.end();++iter) { - TH1 *h = (*iter).second; n++; - if (h->IsA()->InheritsFrom("TH2")) continue; - - int nEnt = h->GetEntries(); - double mean = h->GetMean(); - double rms = h->GetRMS(); - printf("TH1 %2d - %12s:\t %5d %g(+-%g)\n",n,h->GetName(),nEnt,mean,rms); - if (rms<=0) continue; - if (nH==4) {Draw(nH,H);nH=0;} - H[nH++] = h; - } - if (nH) Draw(nH,H); - - for (myDebIter_t iter = myDebMap.begin();iter != myDebMap.end();++iter) { - TH1 *h = (*iter).second; n++; - if (!h->IsA()->InheritsFrom("TH2")) continue; - int nEnt = h->GetEntries(); - double mean = h->GetMean(); - double rms = h->GetRMS(); - printf("TH2 %2d - %12s:\t %5d %g(+-%g)\n",n,h->GetName(),nEnt,mean,rms); - if (rms<=0) continue; - H[0]=h;Draw(1,H); - } - - if (!n) return; - while(!gSystem->ProcessEvents()){}; - -} -#endif -#if 1 -//______________________________________________________________________________ -void StvDebug::Sumary(int nHist) -{ - if (!nHist) nHist=4; - printf("StvDebug::Sumary()\n"); - - int nH = 0,n=0; - for (myTallyIter_t iter = mgTally.begin();iter != mgTally.end();++iter) { - int nn = (*iter).second; n++; - const char *kto = (*iter).first.c_str(); - printf("%3d - Tally.%s = %d\n",n,kto,nn); - } - - - - - TH1 *H[10]; - for (int numCha = 0; numCha<2; numCha++) { - nH = 0;n=0; - for (myDebIter_t iter = myDebMap.begin();iter != myDebMap.end();++iter) { - TH1 *h = (*iter).second; n++; - if (!h->IsA()->InheritsFrom("TH1")) continue; - if ( h->IsA()->InheritsFrom("TH2")) continue; - - int nEnt = h->GetEntries(); - if (!nEnt) continue; - if ((h->GetXaxis()->GetLabels()==0) != (numCha == 0)) continue; - double mean = h->GetMean(); - double rms = h->GetRMS(); - printf("TH1 %2d - %12s:\t %5d %g(+-%g)\n",n,h->GetName(),nEnt,mean,rms); - if (nH==nHist) {Draw(nH,H);nH=0;} - if (numCha) h->LabelsOption(">V","X"); - H[nH++] = h; - } - if (nH) Draw(nH,H); - } - for (myDebIter_t iter = myDebMap.begin();iter != myDebMap.end();++iter) { - TH1 *h = (*iter).second; n++; - if (!h->IsA()->InheritsFrom("TH2")) continue; - int nEnt = h->GetEntries(); - if (!nEnt) continue; - double mean = h->GetMean(); - double rms = h->GetRMS(); - printf("TH2 %2d - %12s:\t %5d %g(+-%g)\n",n,h->GetName(),nEnt,mean,rms); - H[0]=h;//Draw(1,H); - TString ts(h->GetName()); ts+="_pfx"; - H[1] = ((TH2*)h)->ProfileX(ts.Data()); - Draw(2,H); - } - - if (!n) return; - while(!gSystem->ProcessEvents()){}; - -} -#endif -//______________________________________________________________________________ -void StvDebug::Reset() -{ - for (myDebIter_t iter = myDebMap.begin();iter != myDebMap.end();++iter) { - ((*iter).second)->Clear(); - } - for (myCanIter_t iter = myCanMap.begin();iter != myCanMap.end();++iter) { - ((*iter).second)->Clear(); - } -} -//______________________________________________________________________________ -void StvDebug::Draw(int nH,TH1** H) -{ -static int nCall=0; nCall++; - - TString ts("C_"); ts += H[0]->GetName(); - TCanvas *&C = myCanMap[ts.Data()]; - if (!C) C = new TCanvas(ts.Data(),ts.Data(),600,800); - C->Clear();C->Divide(1,nH); - for (int i=0;icd(i+1); H[i]->Draw(); } - - C->Modified();C->Update(); -} -//______________________________________________________________________________ -const char *StvDebug::Env(const char *key) -{ - return gSystem->Getenv(key); -} -//______________________________________________________________________________ -int StvDebug::Inv(const char *key) -{ - return atoi(Env(key)); -} -//______________________________________________________________________________ -int StvDebug::iFlag(const char *flagName,int dflt) -{ - const char *val = gSystem->Getenv(flagName); - if (!val) return dflt; - printf("\nStvDebug::iFlag: %s = %s\n\n",flagName,val); - - return atoi(val); -} - -//______________________________________________________________________________ -double StvDebug::dFlag(const char *flagName, double dflt) -{ - const char *val = gSystem->Getenv(flagName); - if (!val) return dflt; - printf("\nStvDebug::dFlag: %s = %s\n\n",flagName,val); - - return atof(val); -} -//______________________________________________________________________________ -void StvDebug::Browse(const char *name, TObject *obj) -{ - auto *br = new TBrowser(name,obj); - if (br){}; - return; -} -//______________________________________________________________________________ -void StvDebug::AddGra(double x, double y,double z, int iObj) -{ - if (mgDebug<2) return; - if (!mgGrappa)mgGrappa = new StvGrappa("StvDebug"); - mgGrappa->Add(x,y,z,iObj); -} -//______________________________________________________________________________ -void StvDebug::ClearGra() -{ - if (!mgGrappa) return; - mgGrappa->Clear(); -} -//______________________________________________________________________________ -void StvDebug::ShowGra() -{ - if (!mgGrappa) return; - mgGrappa->Show(); -} -//______________________________________________________________________________ -void StvDebug::SetActGra(int akt) -{ - mgGrappa->SetActive(akt); -} -//______________________________________________________________________________ -void StvDebug::Show(const StvTrack* tk) -{ - delete mgGrappaTmp; - mgGrappaTmp = new StvGrappa("BOT OH"); - mgGrappaTmp->Show(tk); -} -//______________________________________________________________________________ -void StvDebug::SaveAll() -{ - TIter nextCanv(gROOT->GetListOfCanvases()); - TCanvas *obj=0; - while((obj=(TCanvas*)nextCanv())) {// loop over Canvas - if (!obj->InheritsFrom("TCanvas")) continue; - TString ts(obj->GetName());ts+=".ps"; - obj->SaveAs(ts); - ts = obj->GetName(); ts+=".png"; - obj->SaveAs(ts); - - } -// while(!gSystem->ProcessEvents()){}; - -} diff --git a/StRoot/StvUtil/StvDebug.h b/StRoot/StvUtil/StvDebug.h deleted file mode 100644 index 54fb9fceacc..00000000000 --- a/StRoot/StvUtil/StvDebug.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __STVDEBUG_h_ -#define __STVDEBUG_h_ -#include "TObject.h" -//------------------------------------------------------------------------------ -class TObject; -class TH1; -class StvGrappa; -class StvTrack; -class StvDebug -{ -public: - StvDebug(){} -static int Break(int kount); -static int Break(double x,double y,double z); -static int Debug() {return mgDebug;}; -static void SetDebug(int idb) {mgDebug=idb;}; -static void Count(const char *key,double val); -static void Count(const char *key,const char *val); -static void Count(const char *key,const char *val,double valy); -static void Count(const char *key,double val,double left,double rite); -static void Count(const char *key,double valx,double valy); -static void Count(const char *key,double valx, double valy - ,double leftx,double ritex - ,double lefty,double ritey); -static void SaveAll(); -static void Sumary(int inPage=4); -static void Reset(); -static const char *Env(const char *key); -static int Inv(const char *key); -static int iFlag(const char *flagName, int dflt=0); -static double dFlag(const char *flagName, double dflt=0); -static void Browse(const char *name, TObject *obj); -// StvGrappa -static void AddGra(double x,double y,double z,int iObj); -static void ClearGra(); -static void ShowGra(); -static void Show(const StvTrack*); -static void SetActGra(int akt = 1); - -private: -static void Draw(int nH,TH1** H); -public: -static int mgDebug; -static StvGrappa *mgGrappa; -static StvGrappa *mgGrappaTmp; - - -#if 0 -ClassDef(StvDebug,0) -#endif -}; -#endif diff --git a/StRoot/StvUtil/StvELossTrak.cxx b/StRoot/StvUtil/StvELossTrak.cxx deleted file mode 100644 index 744e9cd1f06..00000000000 --- a/StRoot/StvUtil/StvELossTrak.cxx +++ /dev/null @@ -1,755 +0,0 @@ -// $Id: StvELossTrak.cxx,v 1.17 2015/06/18 23:31:26 perev Exp $ -// -// -// Class StvELossTrak -// ------------------ -#include -#include -#include -#include -#include "TGeoMaterial.h" -#include "StvUtil/StvDebug.h" -#include "StvELossTrak.h" -static int gNoEloss = 0; - -//SUBROUTINE G3DRELX(A,Z,DENS,T,HMASS,DEDX) - -static double gsigma2(double ZoverA,double DENS,double CHARGE2 - ,double AMASS ,double BET2,double STEP ); -//static double gdrelx (double A ,double Z ,double DENS ,double T,double HMASS); - -static const double kPiMass=0.13956995; -static const double kMinP = 0.01,kMinE = sqrt(kMinP*kMinP+kPiMass*kPiMass); -static const double kMaxP = 1000,kMaxE = sqrt(kMaxP*kMaxP+kPiMass*kPiMass); -static const double kMaxFak=1,kMaxTheta2=1,kMaxPartOfE = 0.1; -static const double kMomTol=1e-2; - -ClassImp(StvELossTrak) - -//_____________________________________________________________________________ -StvELossTrak::StvELossTrak() -{ - gNoEloss = StvDebug::iFlag("NOELOSS"); - memset(fBeg,0,fEnd-fBeg+1); -} -//______________________________________________________________________________ -void StvELossTrak::reset() -{ - fMats.clear(); - memset(fBeg,0,fEnd-fBeg+1); -} -//______________________________________________________________________________ -void StvELossTrak::unset() -{ - fMats.clear(); -} -//_____________________________________________________________________________ -void StvELossTrak::Reset(int dir,double mass, double charge) -{ - memset(fBeg,0,fEnd-fBeg+1); - fMats.clear(); - fDir = dir; fM=mass; fCharge=charge; - -} -//_____________________________________________________________________________ -void StvELossTrak::Clear(const char*) -{ - memset(fMed,0,fEnd-fMed+1); -} -//_____________________________________________________________________________ -void StvELossTrak::Set(double A, double Z, double dens, double x0, double p,const TGeoMaterial *mate) -{ - fdEdX=0; - if (p<=0) p = fP[1]; - if (pkMaxP) p=kMaxP; - if (A<=0) x0 = 1e+11; - if (!Same(A,Z,dens,x0,p)) { - // Normal, non update mode. Save material data - fMats.resize(fMats.size()+1); - Aux &M = fMats.back(); - M.fLen=0; - M.fA=A; - M.fZ=Z; - M.fDens=dens; - M.fX0=x0; - M.fP = p; -assert(mate); - M.fMat = mate; - } - if (fP[0]<=0) fP[0] = p; - fP[1] = p; - fdEdX=0;fdEdXErr2=0; - double p2 = fP[1]*fP[1],m2 = fM*fM; - fE = sqrt(p2+m2); - fFak = (14.1*14.1)*(p2+m2)/(p2*p2*1e6); - if (fFak>kMaxFak) fFak = kMaxFak; - double T = fE-fM; - if (A>0) { - double charge2 = fCharge*fCharge; - if (!mate || !mate->IsMixture()) { //it is not mixture - fdEdX = gdrelx(A,Z,dens,T,fM)*dens*charge2; - - } else { //Mixture case - - fdEdX = 0; - const TGeoMixture *mix = (const TGeoMixture*)mate; - int nMix = mix->GetNelements(); - const double *wt = mix->GetWmixt(); - const double *zz = mix->GetZmixt(); - const double *aa = mix->GetAmixt(); - for (int iMix=0;iMix kAccu*M.fA) return 0; - if (fabs(M.fZ-Z)> kAccu*M.fZ) return 0; - if (fabs(M.fDens-dens)> 1e-5+kAccu*M.fDens) return 0; - if (fabs(M.fP-p)> 1e-3*M.fP) return 0; - return 1; -} -//_____________________________________________________________________________ -void StvELossTrak::Set(const TGeoMaterial *mate,double p) -{ - Set(mate->GetA(),mate->GetZ(),mate->GetDensity(),mate->GetRadLen(),p,mate); -} -//______________________________________________________________________________ -//_____________________________________________________________________________ -void StvELossTrak::Add(double len) -{ -// fMCS[0] = Thet2*L1*( L1*L1/3+L0*(L1+L0) ); -// fMCS[1] = Thet2*L1*( -L1-2*L0); -// fMCS[2] = Thet2*L1; -// return fMCS[0]+L*(fMCS[1]+L*fMCS[2]); -static int nCall=0; nCall++; -StvDebug::Break(nCall); - double myLen = len; - while (1) { - double dP = fP[1]*kMomTol; - double dE = dP*fP[1]/fE; - double dL = dE/(fdEdX+1e-11); - if (fDir && fP[1]-dPmyLen) dL=myLen; - Aux &aux = fMats.back(); - aux.fLen+=dL; - double QQ = fFak/fMats.back().fX0; - double theta2 = QQ*dL; - if (theta2 >kMaxTheta2) theta2 = kMaxTheta2; - if (fMCS[2]+theta2>kMaxTheta2) theta2 = kMaxTheta2-fMCS[2]; - fMCS[2] += theta2; - fMCS[1] += theta2*(-2*fTotLen - dL); - fMCS[0] += theta2*(dL*dL/3+fTotLen*(fTotLen+dL)); -assert(fMCS[2]< kMaxTheta2*1.1); - double ELoss = fdEdX *dL; - if ( ELoss > kMaxPartOfE*fE) ELoss = kMaxPartOfE*fE; - fTotELoss += ELoss; - if (fTotELoss > kMaxPartOfE*fE) fTotELoss = kMaxPartOfE*fE; - - fTotELossErr2 += fdEdXErr2*dL; - dP = ELoss*fE/fP[1]; - if (fDir) { fP[1]-=dP; if (fP[1]0.1) dP = log(1.+dP); - - double dE = (eNow-eBef)/eBef; - if (fabs(dE)>0.1) dE = log(1.+dE); - fdLogEdLogP = dE/dP; - - -} -//_____________________________________________________________________________ -void StvELossTrak::Update() const -{ - double dP = fP[0]*0.01; - StvELossTrak elt = *this; - elt.Update(fDir,fP[0]+dP); - fdLogEdLogP = elt.fdLogEdLogP; -} -//_____________________________________________________________________________ -void StvELossTrak::Print(const char *opt) const -{ - printf("ELossTrak: dir=%d q=%d mass=%g p=%g %g totLen=%g totELoss=%g\n" - ,int(fDir),int(fCharge),fM,fP[0],fP[1],fTotLen,fTotELoss); - double totLen = 0,totE=0; - for (int i=0;i<(int)fMats.size();i++) { - const Aux &M = fMats[i]; - double dE = M.fLen*M.fdEdX; - double T = sqrt(M.fP*M.fP+fM*fM)-fM; - printf("%6.3f totE=%g T=%g dL=%g dens=%g dE=%g dEdX=%g\n" - ,totLen,totE,T,M.fLen,M.fDens,dE,M.fdEdX); - totLen+=M.fLen; totE+=dE; - } -} -//_____________________________________________________________________________ -class AofZ_t { -public: -int mZ; -double mA; -char mName[8]; -char mTitle[20]; -}; -#if 1 -//______________________________________________________________________________ -//* Revision 1.1.1.1 1995/10/24 10:21:24 cernlib -//* Geant -//* -//* -//#include "geant321/pilot.h" -//*CMZ : 3.21/03 06/10/94 18.22.43 by S.Giani -//*-- Author : -//______________________________________________________________________________ -// SUBROUTINE GDRELX(A,Z,DENS,T,HMASS,dedx) -double StvELossTrak::gdrelx(double A1,double Z1,double DENS1,double T1,double HMASS1) -{ -// -// ****************************************************************** -// * * -// * Calculates the mean 1/DENS*dE/dx of a particle with kinetic * -// * energy T in an element of atomic number Z, atomic weight A * -// * and density DENS ( the density is just used for the * -// * calculation of the density effect in the case of high T). * -// * The routine reproduces the experimental and/or tabulated * -// * energy losses rather well down to T -> 0. * -// * Simple parametrization is used for T .le. T2L=2 MeV (see * -// * H.H.Andersen,J.F.Ziegler:Hydrogen stopping powers and * -// * ranges in all element,Pergamon Press,1977.). * -// * For T .gt. T2L=2 MeV the corrected Bethe-Bloch stopping * -// * power / restricted energy loss formula is used. * -// * * -// * * -// * ==>Called by : GDRELA * -// * Author L.Urban ********* * -// * * -// ****************************************************************** -// -//#include "geant321/gconsp.inc" -//#include "geant321/gccuts.inc" -//#include "geant321/gcunit.inc" -#define double float -float A=A1,Z=Z1,DENS=DENS1,T=T1,HMASS=HMASS1; - - - -static const double AMUKEV=931494.32,AMUKEV50=pow(AMUKEV,0.50),AMUKEV45=pow(AMUKEV,0.45); -static const double D=0.000153537,T1L=0.00001,T2L=0.002; -static const double AVO=0.60221367,EMPROT=0.9382723,EMASS=0.0005109990615; -static const double DCUTM=0.001; -//DIMENSION B(6,92),C(6,92),CECOF[6] -//* -static const double B[93][6]={ - {0.}, - {1.262 ,1.44 ,242.6 ,12000. ,0.1159 ,18.8}, - {1.229 ,1.397 ,484.5 ,5873. ,0.05225 ,41.7}, - {1.411 ,1.6 ,725.6 ,3013. ,0.04578 ,47.6}, - {2.248 ,2.59 ,966. ,153.8 ,0.03475 ,62.7}, - {2.474 ,2.815 ,1206. ,1060. ,0.02855 ,76.0}, - {2.631 ,2.989 ,1445. ,957.2 ,0.02819 ,77.3}, - {2.954 ,3.35 ,1683. ,1900. ,0.02513 ,86.7}, - {2.652 ,3. ,1920. ,2000. ,0.0223 ,97.7}, - {2.085 ,2.352 ,2157. ,2634. ,0.01816 ,120.}, - {1.951 ,2.199 ,2393. ,2699. ,0.01568 ,139.}, - {2.542 ,2.869 ,2628. ,1854. ,0.01472 ,148.}, - {3.792 ,4.293 ,2862. ,1009. ,0.01397 ,156.}, - {4.154 ,4.739 ,2766. ,164.5 ,0.02023 ,162.}, - {4.15 ,4.7 ,3329. ,550. ,0.01321 ,165.}, - {3.232 ,3.647 ,3561. ,1560. ,0.01267 ,172.}, - {3.447 ,3.891 ,3792. ,1219. ,0.01211 ,180.}, - {5.047 ,5.714 ,4023. ,878.6 ,0.01178 ,185.}, - {5.731 ,6.5 ,4253. ,530. ,0.01123 ,194.}, - {5.151 ,5.833 ,4482. ,545.7 ,0.01129 ,193.}, - {5.521 ,6.252 ,4710. ,553.3 ,0.01112 ,196.}, - {5.201 ,5.884 ,4938. ,560.9 ,0.009995 ,218.}, - {4.862 ,5.496 ,5165. ,568.5 ,0.009474 ,230.}, - {4.48 ,5.055 ,5391. ,952.3 ,0.009117 ,239.}, - {3.983 ,4.489 ,5616. ,1336. ,0.008413 ,259.}, - {3.469 ,3.907 ,5725. ,1461. ,0.008829 ,270.}, - {3.519 ,3.963 ,6065. ,1243. ,0.007782 ,280.}, - {3.14 ,3.535 ,6288. ,1372. ,0.007361 ,296.}, - {3.553 ,4.004 ,6205. ,555.1 ,0.008763 ,310.}, - {3.696 ,4.175 ,4673. ,387.8 ,0.02188 ,322.}, - {4.21 ,4.75 ,6953. ,295.2 ,0.006809 ,320.}, - {5.041 ,5.697 ,7173. ,202.6 ,0.006725 ,324.}, - {5.554 ,6.3 ,6496. ,110. ,0.009689 ,330.}, - {5.323 ,6.012 ,7611. ,292.5 ,0.006447 ,338.}, - {5.874 ,6.656 ,7395. ,117.5 ,0.007684 ,340.}, - {5.611 ,6.335 ,8046. ,365.2 ,0.006244 ,349.}, - {6.411 ,7.25 ,8262. ,220. ,0.006087 ,358.}, - {5.694 ,6.429 ,8478. ,292.9 ,0.006087 ,358.}, - {6.339 ,7.159 ,8693. ,330.3 ,0.006003 ,363.}, - {6.407 ,7.234 ,8907. ,367.8 ,0.005889 ,370.}, - {6.734 ,7.603 ,9120. ,405.2 ,0.005765 ,378.}, - {6.902 ,7.791 ,9333. ,442.7 ,0.005587 ,390.}, - {6.425 ,7.248 ,9545. ,480.2 ,0.005367 ,406.}, - {6.799 ,7.671 ,9756. ,517.6 ,0.005315 ,410.}, - {6.108 ,6.887 ,9966. ,555.1 ,0.005151 ,423.}, - {5.924 ,6.677 ,10180. ,592.5 ,0.004919 ,443.}, - {5.238 ,5.9 ,10380. ,630. ,0.004758 ,458.}, - {5.623 ,6.354 ,7160. ,337.6 ,0.01394 ,466.}, - {5.814 ,6.554 ,10800. ,355.5 ,0.004626 ,471.}, - {6.23 ,7.024 ,11010. ,370.9 ,0.00454 ,480.}, - {6.41 ,7.227 ,11210. ,386.4 ,0.004474 ,487.}, - {7.5 ,8.48 ,8608. ,348. ,0.009074 ,494.}, - {6.979 ,7.871 ,11620. ,392.4 ,0.004402 ,495.}, - {7.725 ,8.716 ,11830. ,394.8 ,0.004376 ,498.}, - {8.231 ,9.289 ,12030. ,397.3 ,0.004384 ,497.}, - {7.287 ,8.218 ,12230. ,399.7 ,0.004447 ,490.}, - {7.899 ,8.911 ,12430. ,402.1 ,0.004511 ,483.}, - {8.041 ,9.071 ,12630. ,404.5 ,0.00454 ,480.}, - {7.489 ,8.444 ,12830. ,406.9 ,0.00442 ,493.}, - {7.291 ,8.219 ,13030. ,409.3 ,0.004298 ,507.}, - {7.098 ,8. ,13230. ,411.8 ,0.004182 ,521.}, - {6.91 ,7.786 ,13430. ,414.2 ,0.004058 ,537.}, - {6.728 ,7.58 ,13620. ,416.6 ,0.003976 ,548.}, - {6.551 ,7.38 ,13820. ,419. ,0.003877 ,562.}, - {6.739 ,7.592 ,14020. ,421.4 ,0.003863 ,564.}, - {6.212 ,6.996 ,14210. ,423.9 ,0.003725 ,585.}, - {5.517 ,6.21 ,14400. ,426.3 ,0.003632 ,600.}, - {5.219 ,5.874 ,14600. ,428.7 ,0.003498 ,623.}, - {5.071 ,5.706 ,14790. ,433. ,0.003405 ,640.}, - {4.926 ,5.542 ,14980. ,433.5 ,0.003342 ,652.}, - {4.787 ,5.386 ,15170. ,435.9 ,0.003292 ,662.}, - {4.893 ,5.505 ,15360. ,438.4 ,0.003243 ,672.}, - {5.028 ,5.657 ,15550. ,440.8 ,0.003195 ,682.}, - {4.738 ,5.329 ,15740. ,443.2 ,0.003186 ,684.}, - {4.574 ,5.144 ,15930. ,442.4 ,0.003144 ,693.}, - {5.2 ,5.851 ,16120. ,441.6 ,0.003122 ,698.}, - {5.07 ,5.704 ,16300. ,440.9 ,0.003082 ,707.}, - {4.945 ,5.563 ,16490. ,440.1 ,0.002965 ,735.}, - {4.476 ,5.034 ,16670. ,439.3 ,0.002871 ,759.}, - {4.856 ,5.46 ,18320. ,438.5 ,0.002542 ,755.}, - {4.308 ,4.843 ,17040. ,487.8 ,0.002882 ,756.}, - {4.723 ,5.311 ,17220. ,537. ,0.002913 ,748.}, - {5.319 ,5.982 ,17400. ,586.3 ,0.002871 ,759.}, - {5.956 ,6.7 ,17800. ,677. ,0.00266 ,765.}, - {6.158 ,6.928 ,17770. ,586.3 ,0.002812 ,775.}, - {6.204 ,6.979 ,17950. ,586.3 ,0.002776 ,785.}, - {6.181 ,6.954 ,18120. ,586.3 ,0.002748 ,793.}, - {6.949 ,7.82 ,18300. ,586.3 ,0.002737 ,796.}, - {7.506 ,8.448 ,18480. ,586.3 ,0.002727 ,799.}, - {7.649 ,8.609 ,18660. ,586.3 ,0.002697 ,808.}, - {7.71 ,8.679 ,18830. ,586.3 ,0.002641 ,825.}, - {7.407 ,8.336 ,19010. ,586.3 ,0.002603 ,837.}, - {7.29 ,8.204 ,19180. ,586.3 ,0.002573 ,847.}}; - -static const double CECOF[7]={0.,0.42237,0.0304,-0.00038,3.858,-0.1668,0.00158}; -static double C[6]={0}; -enum {kNAW=118}; -AofZ_t AW[kNAW]={ -{1,1.0079, "H", "Hydrogen" }, -{2,4.0026, "He", "Helium" }, -{3,6.941, "Li", "Lithium" }, -{4,9.0122, "Be", "Beryllium" }, -{5,10.811, "B", "Boron" }, -{6,12.0107, "C", "Carbon" }, -{7,14.0067, "N", "Nitrogen" }, -{8,15.9994, "O", "Oxygen" }, -{9,18.9984, "F", "Fluorine" }, -{10,20.1797, "Ne", "Neon" }, -{11,22.9897, "Na", "Sodium" }, -{12,24.305, "Mg", "Magnesium" }, -{13,26.9815, "Al", "Aluminum" }, -{14,28.0855, "Si", "Silicon" }, -{15,30.9738, "P", "Phosphorus" }, -{16,32.065, "S", "Sulfur" }, -{17,35.453, "Cl", "Chlorine" }, -{18,39.948, "Ar", "Argon" }, -{19,39.0983, "K", "Potassium" }, -{20,40.078, "Ca", "Calcium" }, -{21,44.9559, "Sc", "Scandium" }, -{22,47.867, "Ti", "Titanium" }, -{23,50.9415, "V", "Vanadium" }, -{24,51.9961, "Cr", "Chromium" }, -{25,54.938, "Mn", "Manganese" }, -{26,55.845, "Fe", "Iron" }, -{27,58.9332, "Co", "Cobalt" }, -{28,58.6934, "Ni", "Nickel" }, -{29,63.546, "Cu", "Copper" }, -{30,65.39, "Zn", "Zinc" }, -{31,69.723, "Ga", "Gallium" }, -{32,72.64, "Ge", "Germanium" }, -{33,74.9216, "As", "Arsenic" }, -{34,78.96, "Se", "Selenium" }, -{35,79.904, "Br", "Bromine" }, -{36,83.8, "Kr", "Krypton" }, -{37,85.4678, "Rb", "Rubidium" }, -{38,87.62, "Sr", "Strontium" }, -{39,88.9059, "Y", "Yttrium" }, -{40,91.224, "Zr", "Zirconium" }, -{41,92.9064, "Nb", "Niobium" }, -{42,95.94, "Mo", "Molybdenum" }, -{43,98, "Tc", "Technetium" }, -{44,101.07, "Ru", "Ruthenium" }, -{45,102.906, "Rh", "Rhodium" }, -{46,106.42, "Pd", "Palladium" }, -{47,107.868, "Ag", "Silver" }, -{48,112.411, "Cd", "Cadmium" }, -{49,114.818, "In", "Indium" }, -{50,118.71, "Sn", "Tin" }, -{51,121.76, "Sb", "Antimony" }, -{52,127.6, "Te", "Tellurium" }, -{53,126.904, "I", "Iodine" }, -{54,131.293, "Xe", "Xenon" }, -{55,132.905, "Cs", "Cesium" }, -{56,137.327, "Ba", "Barium" }, -{57,138.905, "La", "Lanthanum" }, -{58,140.116, "Ce", "Cerium" }, -{59,140.908, "Pr", "Praseodymium" }, -{60,144.24, "Nd", "Neodymium" }, -{61,145, "Pm", "Promethium" }, -{62,150.36, "Sm", "Samarium" }, -{63,151.964, "Eu", "Europium" }, -{64,157.25, "Gd", "Gadolinium" }, -{65,158.925, "Tb", "Terbium" }, -{66,162.5, "Dy", "Dysprosium" }, -{67,164.93, "Ho", "Holmium" }, -{68,167.259, "Er", "Erbium" }, -{69,168.934, "Tm", "Thulium" }, -{70,173.04, "Yb", "Ytterbium" }, -{71,174.967, "Lu", "Lutetium" }, -{72,178.49, "Hf", "Hafnium" }, -{73,180.948, "Ta", "Tantalum" }, -{74,183.84, "W", "Tungsten" }, -{75,186.207, "Re", "Rhenium" }, -{76,190.23, "Os", "Osmium" }, -{77,192.217, "Ir", "Iridium" }, -{78,195.078, "Pt", "Platinum" }, -{79,196.966, "Au", "Gold" }, -{80,200.59, "Hg", "Mercury" }, -{81,204.383, "Tl", "Thallium" }, -{82,207.2, "Pb", "Lead" }, -{83,208.98, "Bi", "Bismuth" }, -{84,209, "Po", "Polonium" }, -{85,210, "At", "Astatine" }, -{86,222, "Rn", "Radon" }, -{87,223, "Fr", "Francium" }, -{88,226, "Ra", "Radium" }, -{89,227, "Ac", "Actinium" }, -{90,232.038, "Th", "Thorium" }, -{91,231.036, "Pa", "Protactinium" }, -{92,238.029, "U", "Uranium" }, -{93,237, "Np", "Neptunium" }, -{94,244, "Pu", "Plutonium" }, -{95,243, "Am", "Americium" }, -{96,247, "Cm", "Curium" }, -{97,247, "Bk", "Berkelium" }, -{98,251, "Cf", "Californium" }, -{99,252, "Es", "Einsteinium" }, -{100,257, "Fm", "Fermium" }, -{101,258, "Md", "Mendelevium" }, -{102,259, "No", "Nobelium" }, -{103,262, "Lr", "Lawrencium" }, -{104,261, "Rf", "Rutherfordium" }, -{105,262, "Db", "Dubnium" }, -{106,266, "Sg", "Seaborgium" }, -{107,264, "Bh", "Bohrium" }, -{108,277, "Hs", "Hassium" }, -{109,268, "Mt", "Meitnerium" }, -{110,0, "Ds", "Darmstadtium" }, -{111,272, "Rg", "Roentgenium" }, -{112,0, "Uub", "Ununbium" }, -{113,0, "Uut", "Ununtrium" }, -{114,0, "Uuq", "Ununquadium" }, -{115,0, "Uup", "Ununpentium" }, -{116,0, "Uuh", "Ununhexium" }, -{117,0, "Uus", "Ununseptium" }, -{118,0, "Uuo", "Ununoctium" }}; - -double poti,p,e,beta,bet2,tau,sl,sh,eta,eta2,b2g2,tmax,cc,x0,x1,xa,xm,delta; -double f1,f2,f3,f4,f5,tupp,ce,st,sbb,dedx; -//* ------------------------------------------------------------------ -//* in the case of non-integer Z the low energy parameters -//* and the ionization potential are taken at INT(Z) ! -//* - int iz=(int)(Z+1e-8); if (iz == 92) iz = 91; - double wt1=Z-iz,wt0 = 1-wt1; - assert((iz>0)&&(iz<92)); -//* -//* Calculate coefficients C(I,J) if it has not been done already -//* - double fac0=AVO/AW[iz ].mA; - double fac1=AVO/AW[iz+1].mA; - C[0]=AMUKEV50*(B[iz][0]*wt0*fac0+B[iz+1][0]*wt1*fac1); - C[1]=AMUKEV45*(B[iz][1]*wt0*fac0+B[iz+1][1]*wt1*fac1); - C[2]= (B[iz][2]*wt0*fac0+B[iz+1][2]*wt1*fac1)/AMUKEV; - C[3]= (B[iz][3]*wt0 +B[iz+1][3]*wt1 )/AMUKEV; - C[4]=AMUKEV* (B[iz][4]*wt0 +B[iz+1][4]*wt1 ); -//* poti=16.E-9*Z**0.9 - C[5]= (B[iz][5]*wt0+B[iz+1][5]*wt1)*1.E-9; -//* -//* ---------------------------------------------------------------- - double hmass2 = HMASS*HMASS; - double T1LIM=HMASS*T1L/EMPROT; - double T2LIM=HMASS*T2L/EMPROT; -//* -//* Calculate dE/dx -//* ---> for T .le. T1LIM (very low energy) -//* - if (gNoEloss) return 0; - if(T<=T1LIM) { - tau=T/HMASS; - dedx=C[0]*pow(tau,0.5); - } else { -//* -//* ---> for T1LIM .lt. T and T .le. T2LIM (low energy) -//* - if(T<=T2LIM) { - tau=T/HMASS; - sl=C[1]*pow(tau,0.45); - sh=C[2]*log(1.+C[3]/tau+C[4]*tau)/tau; - dedx=sl*sh/(sl+sh); -//* -//* ---> for T .gt. T2LIM ( "high " energy , Bethe-Bloch formula) -//* - } else { - p=sqrt(T*(T+2.*HMASS)); - e=T+HMASS; - beta=p/e; - bet2=beta*beta; - eta=p/HMASS; - eta2=eta*eta; -//*+++ new line follows..... - b2g2=eta*eta; -//*+++ end of correction - tmax=2.*EMASS*T*(T+2.*HMASS); -//*+++ correction of the next line -//* tmax=tmax/(HMASS**2+EMASS**2+EMASS*(T+HMASS)); - tmax=tmax/(hmass2+EMASS*(EMASS+2.*e)); -//*+++ end of correction -//* -//* density correction -//* - poti=C[5]; - cc=1.+2.*log(poti/(28.8E-9*sqrt(DENS*Z/A))); -//* condensed material ? ( dens .gt. 0.05 ? ) - if(DENS>0.05) { - if(poti < 1.E-7) { - if(cc < 3.681) { - x0=0.2; - } else { - x0=0.326*cc-1.; - } - x1=2.; - } else { - if(cc < 5.215) { - x0=0.2; - } else { - x0=0.326*cc-1.5; - } - x1=3.; - } -//* gas ? ( dens . le . 0.05 ? ) - } else { - if(cc<=12.25) { - int ip=(int)((cc-10.)/0.5)+1; - if(ip < 0) ip=0; - if(ip>4) ip=4; - x0=1.6+0.1*ip; - x1=4.; - } else { - if(cc<=13.804) { - x0=2.; - x1=5.; - } else { - x0=0.326*cc-2.5; - x1=5.; - } - } - } -//* - xa=cc/4.606; - xm=3.; - double aa=4.606*(xa-x0)/pow(x1-x0,xm); -//* - double x=log10(eta); - delta=0.; - if(x>x0) { - delta=4.606*x-cc; - if(x < x1) delta=delta+aa*pow(x1-x,xm); - } -//* -//* calculate shell correction -//* - double potsq=poti*poti; - if(eta>0.13) { - f1=1./eta2; - f2=f1*f1; - f3=f1*f2; - f4=(f1*CECOF[1]+f2*CECOF[2]+f3*CECOF[3])*1.E+12; - f5=(f1*CECOF[4]+f2*CECOF[5]+f3*CECOF[6])*1.E+18; - ce=f4*potsq+f5*potsq*poti; - } else { - eta2=0.0169; - f1=1./eta2; - f2=f1*f1; - f3=f1*f2; - f4=(f1*CECOF[1]+f2*CECOF[2]+f3*CECOF[3])*1.E+12; - f5=(f1*CECOF[4]+f2*CECOF[5]+f3*CECOF[6])*1.E+18; - ce=f4*potsq+f5*potsq*poti; - ce=ce*log(T/T2LIM)/log(0.0079/T2LIM); - } -//* - f1=D*Z/(A*bet2); -//* -//* stopping power or restricted dE/dx ? -//* -//*+++ correction of the next few lines -//* if(DCUTM.GE.tmax) { -//* f2=2.*(log(tmax/poti)-bet2) -//* } else { -//* f2=log(tmax*DCUTM/potsq)-bet2*(1.+DCUTM/tmax) -//* } - tupp=DCUTM; - if(tmax < DCUTM) tupp=tmax; - f2=log(2.*EMASS*b2g2/poti)+log(tupp/poti)-bet2*(1.+tupp/tmax); -//*+++ end of correction - dedx=f1*(f2-delta-2.*ce/Z); -//* -//* - tau=T2LIM/HMASS; - sl=C[1]*pow(tau,0.45); - sh=C[2]*log(1.+C[3]/tau+C[4]*tau)/tau; - st=sl*sh/(sl+sh); -//* - tmax=2.*EMASS*T2LIM*(T2LIM+2.*HMASS); -//*+++ correction of the next line -//* tmax=tmax/(HMASS**2+EMASS**2+EMASS*(T2LIM+HMASS)); - tmax=tmax/(HMASS*HMASS+EMASS*EMASS+2.*EMASS*(T2LIM+HMASS)); -//*+++ end of correction - bet2=T2LIM*(T2LIM+2.*HMASS)/pow(T2LIM+HMASS,2); - sbb=2.*(log(tmax/poti)-bet2); - sbb=D*Z*sbb/(A*bet2); - double corbb=(st/sbb-1.)*T2LIM; -//* - dedx=dedx*(1.+corbb/T); -//* - } - } - return dedx; -} -#endif //0 -// -#undef double - -//*CMZ : 3.21/02 29/03/94 15.41.21 by S.Giani -//-- Author : -//______________________________________________________________________________ -double gsigma2(double ZoverA,double DENS,double CHARGE2 - ,double AMASS ,double BET2,double STEP ) -{ -// SUBROUTINE GFLUCT(DEMEAN,DE) - -static const double DGEV=0.153536E-3,EMASS=0.0005109990615; -// - double gamm2 = 1./(1.-BET2); - double gamma = sqrt(gamm2); -// -// *** low energy transfer - double xi = DGEV*CHARGE2*STEP*DENS*ZoverA/(BET2); -// -// Energy straggling using Gaussian -// STEP = current step-length (cm) -// Author : G.N. Patrick -// -// -// Maximum energy transfer to atomic electron (GeV). - double eta2 = BET2*gamm2; - double ratio = EMASS/AMASS; - double emax =(2*EMASS*eta2)/(1+2*ratio*gamma+ratio*ratio); -// -// +-----------------------------------+ -// I Sample from Gaussian distribution I -// +-----------------------------------+ - double sigma2 = xi*(1.-0.5*BET2)*emax; - return sigma2; -} diff --git a/StRoot/StvUtil/StvELossTrak.h b/StRoot/StvUtil/StvELossTrak.h deleted file mode 100644 index ce220bb050a..00000000000 --- a/StRoot/StvUtil/StvELossTrak.h +++ /dev/null @@ -1,78 +0,0 @@ -// $Id: StvELossTrak.h,v 1.11 2015/06/18 02:10:39 perev Exp $ -// -// -// Class StvELossTrak -// ------------------ - - -#ifndef STIELOSSTRAK_H -#define STIELOSSTRAK_H -#include "TObject.h" -#include "vector" -class TGeoMaterial; -static const double PiMASS=0.13956995; - -class StvELossTrak : public TObject -{ -public: -class Aux { -public: -Aux(){memset(this,0,sizeof(*this));} - -const TGeoMaterial* fMat; -float fLen,fP,fdEdX,fA,fZ,fDens,fX0; -}; -typedef std::vector AuxVect; -public: - StvELossTrak(); - ~StvELossTrak(){;} - void Reset(int dir,double mass=PiMASS, double charge=1); - void Clear(const char *opt=""); - int Same(double A, double Z, double dens, double x0, double p) const; - void Set (double A, double Z, double Dens, double x0, double p,const TGeoMaterial *mate); - void Set (const TGeoMaterial *mate, double p); - void Set (double p); - void Add(double len); - void Update(int dir,double Pmom); - void Update() const; - double GetTheta2() const; - double GetOrt2() const; - - double dEdX () const {return fTotELoss/fTotLen;} - double ELoss() const {return fTotELoss;} - double ELossErr2() const {return fTotELossErr2;} - double PLoss(double p) const; - double dPLossdP0(double p) const; - double TotLen() const {return fTotLen;} - double P() const {return fP[0];} - double M() const {return fM;} - int GetNMats() const {return fMats.size();} - const Aux &GetMate(int idx); - void reset(); - void unset(); - void Print(const char *opt) const; -static double gdrelx(double A,double Z,double DENS,double T,double HMASS); - - -private: -char fBeg[1]; -char fDir; -char fCharge; //particle charge -double fM; //mass -double fdEdX,fdEdXErr2; -double fP[2]; //momentum start & end -double fE; //energy -double fFak; -// -char fMed[1]; -double fTotELoss; ///accumulated energy loss -double fTotELossErr2; ///accumulated error of energy loss -double fTotLen; ///accumulated track length -double fMCS[3]; /// -mutable double fdLogEdLogP; /// d(log(dEdx)/dLog(p) -char fEnd[1]; -AuxVect fMats; -ClassDef(StvELossTrak,0) -}; -#endif //STIELOSSTRAK_H - diff --git a/StRoot/StvUtil/StvFtsHitErrCalculator.cxx b/StRoot/StvUtil/StvFtsHitErrCalculator.cxx deleted file mode 100644 index 298c759af5a..00000000000 --- a/StRoot/StvUtil/StvFtsHitErrCalculator.cxx +++ /dev/null @@ -1,4 +0,0 @@ -#include "StvFtsHitErrCalculator.h" -ClassImp(StvFtsHitErrCalculator) - - diff --git a/StRoot/StvUtil/StvFtsHitErrCalculator.cxx.C b/StRoot/StvUtil/StvFtsHitErrCalculator.cxx.C deleted file mode 100644 index 13648b37658..00000000000 --- a/StRoot/StvUtil/StvFtsHitErrCalculator.cxx.C +++ /dev/null @@ -1,114 +0,0 @@ -#include -#include -#include -#include -#include "StEvent/StEnumerations.h" -#include "StvFtsHitErrCalculator.h" -#include "StvUtil/StvDebug.h" -#include "StThreeVectorF.hh" -#include - -ClassImp(StvFtsHitErrCalculator) -double StvFtsHitErrCalculator::mgRPhiErrs[2]={0,0}; //these errors are used only for CalcDetErrs - -//______________________________________________________________________________ -int StvFtsHitErrCalculator::CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRr[3]) -{ -// X = R*cos(Fi), Y=R*sin(Fi), Z = z -// dX/dR = ( cos(Fi) ,sin(Fi),0) -// dX/dFi = (-R*sin(Fi), R*cos(Fi),0) -// U & V coordinate in detector plane -// U = hiDir[1][0]*X+hiDir[1][1]*Y + hiDir[1][2]*Z -// V = hiDir[2][0]*X+hiDir[2][1]*Y + hiDir[2][2]*Z -// -// dU/dR = hiDir[1][0]*cos(Fi)+hiDir[1][1]*sin(Fi) -// dV/dR = hiDir[2][0]*cos(Fi)+hiDir[2][1]*sin(Fi) -// dU/dFi =(-hiDir[1][0]*sin(Fi)+hiDir[1][1]*cos(Fi))*R -// dV/dFi =(-hiDir[2][0]*sin(Fi)+hiDir[2][1]*cos(Fi))*R -// But our case is more simple: -// hiDir {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}} - -// dU/dR = -sin(Fi) -// dV/dR = cos(Fi) -// dU/dFi =-cos(Fi)*R -// dV/dFi =-sin(Fi)*R - -// UU = sin(Fi)**2*dR**2 + cos(Fi)**2*R**2*dFi**2 -// VV = cos(Fi)**2*dR**2 + sin(Fi)**2*R**2*dFi**2 -// UV = -sin(Fi)*cos(Fi)*dR**2 + cos(Fi)*sin(Fi)*(R*dFi)**2 -// UV = sin(Fi)*cos(Fi)*(-dR**2 + (R*dFi)**2) - if (mPar[kZErr]<1e-11) { hRr[0]=1;hRr[1]=0;hRr[2]=1; return 0;} - - double Rxy2 = (hiPos[0]*hiPos[0]+hiPos[1]*hiPos[1]); - mPar[kPhiErr] = mgRPhiErrs[kPhiErr]; - mPar[kRxyErr] = mgRPhiErrs[kRxyErr]; - double myRxyErr2 = mPar[kRxyErr]*mPar[kRxyErr]; - double myPhiErr2 = mPar[kPhiErr]*mPar[kPhiErr]; - double cosFi2 = hiPos[0]*hiPos[0]/Rxy2; - double sinFi2 = hiPos[1]*hiPos[1]/Rxy2; - double sicoFi = hiPos[0]*hiPos[1]/Rxy2; - memset(mDRr,0,sizeof(mDRr)); - mDRr[kYY] = sinFi2*myRxyErr2+cosFi2*myPhiErr2*Rxy2; - mDRr[kZZ] = cosFi2*myRxyErr2+sinFi2*myPhiErr2*Rxy2; - mDRr[kZY] = sicoFi*(-myRxyErr2+myPhiErr2*Rxy2); - if (!hRr) return 0; - hRr[0] = mDRr[kYY]; - hRr[1] = mDRr[kYZ]; - hRr[2] = mDRr[kZZ]; - - assert(hRr[0]*hRr[2]>hRr[1]*hRr[1]); - -// double tst[4] = {-hiPos[1],hiPos[0],tst[1],-tst[0]}; -// double nor = sqrt(hiPos[0]*hiPos[0]+hiPos[1]*hiPos[1]); -// for (int i=0;i<4;i++) {tst[i]/=nor;} -// double dR2 = hRr[0]*tst[0]*tst[0]+2*hRr[1]*tst[0]*tst[1]+hRr[2]*tst[1]*tst[1]; -// double dF2 = hRr[0]*tst[2]*tst[2]+2*hRr[1]*tst[2]*tst[3]+hRr[2]*tst[3]*tst[3]; -// assert(fabs(dR2-pow(mPar[kRxyErr],2))/dR2 <1e-3); -// assert(fabs(dF2-pow(mPar[kPhiErr],2)*Rxy2)/dF2 <1e-3); - - return 0; -} -//______________________________________________________________________________ - - -#include "StHit.h" -#include "Stv/StvHit.h" -#include "StarVMC/GeoTestMaker/StTGeoProxy.h" -//______________________________________________________________________________ -int StvFtsHitErrCalculator::CalcDcaErrs(const StvHit *hit,double hRr[3]) -{ - StHit *stHit = (StHit*)hit->stHit(); - StThreeVectorF dRdPdZ = stHit->positionError(); - float const *fx = hit->x(); - mPar[kRxyErr] = dRdPdZ[0]; - mPar[kPhiErr] = dRdPdZ[1]; - - if (mgRPhiErrs[kRxyErr]detector(); - const Mtx33F_t &hD = hp->GetDir(fx); - int ians = CalcDcaErrs(fx,hD,hRr); - -// double Rxy2 = (fx[0]*fx[0]+fx[1]*fx[1]); -// double tst[4] = {-fx[1],fx[0],tst[1],-tst[0]}; -// double nor = sqrt(fx[0]*fx[0]+fx[1]*fx[1]); -// for (int i=0;i<4;i++) {tst[i]/=nor;} -// double dR2 = mDRr[0]*tst[0]*tst[0]+2*mDRr[1]*tst[0]*tst[1]+mDRr[2]*tst[1]*tst[1]; -// double dF2 = mDRr[0]*tst[2]*tst[2]+2*mDRr[1]*tst[2]*tst[3]+mDRr[2]*tst[3]*tst[3]; -// assert(fabs(dR2-pow(mPar[kRxyErr],2))/dR2 <1e-3); -// assert(fabs(dF2-pow(mPar[kPhiErr],2)*Rxy2)/dF2 <1e-3); -// -// tst[0] = fx[0]*mTG[1][0]+fx[1]*mTG[1][1]; -// tst[1] = fx[0]*mTG[2][0]+fx[1]*mTG[2][1]; -// nor = sqrt(tst[0]*tst[0]+tst[1]*tst[1]); -// tst[0]/=nor; tst[1]/=nor; -// tst[2] = -tst[1]; tst[3] = tst[0]; -// double ddR2 = mTRr[0]*tst[0]*tst[0]+2*mTRr[1]*tst[0]*tst[1]+mTRr[2]*tst[1]*tst[1]; -// double ddF2 = mTRr[0]*tst[2]*tst[2]+2*mTRr[1]*tst[2]*tst[3]+mTRr[2]*tst[3]*tst[3]; -// assert(fabs(ddR2-pow(mPar[kRxyErr],2))/ddR2 <1e-1); -// assert(fabs(ddF2-pow(mPar[kPhiErr],2)*Rxy2)/ddF2 <1e-1); - - return ians; -} - diff --git a/StRoot/StvUtil/StvFtsHitErrCalculator.h b/StRoot/StvUtil/StvFtsHitErrCalculator.h deleted file mode 100644 index fea1f5aaf2c..00000000000 --- a/StRoot/StvUtil/StvFtsHitErrCalculator.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __StvFtsHitErrCalculatorulator_h_ -#define __StvFtsHitErrCalculatorulator_h_ -#include "StEvent/StEnumerations.h" -#include "StvUtil/StvHitErrCalculator.h" - -class StvHit; - -class StvFtsHitErrCalculator : public StvHitRrCalculator { - -public: - StvFtsHitErrCalculator(const char *name="FtsHitErrs"):StvHitRrCalculator(name){}; - -protected: -ClassDef(StvFtsHitErrCalculator,0) -}; - -#endif diff --git a/StRoot/StvUtil/StvFtsHitErrCalculator.h.C b/StRoot/StvUtil/StvFtsHitErrCalculator.h.C deleted file mode 100644 index 735e6d0d0f7..00000000000 --- a/StRoot/StvUtil/StvFtsHitErrCalculator.h.C +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __StvFtsHitErrCalculatorulator_h_ -#define __StvFtsHitErrCalculatorulator_h_ -#include "StEvent/StEnumerations.h" -#include "StvUtil/StvHitErrCalculator.h" - -class StvHit; - -class StvFtsHitErrCalculator : public StvHitErrCalculator { - -public: - StvFtsHitErrCalculator(const char *name="FtsHitErr"):StvHitErrCalculator(name,2){}; -int CalcDcaErrs(const StvHit* hit,double hRR[3]); -int CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); -int CalcDcaErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]) - {return StvHitErrCalculator::CalcDcaErrs(hiPos,hiDir,hRR);} - -protected: -enum { -kRxyErr =0, /* Intrinsic resolution, padrow or rxy direction */ -kPhiErr =1}; /* Intrinsic resolution, Phi direction */ - -static double mgRPhiErrs[2]; //these errors are used only for CalcDetErrs - //when the concrete hit is not defined - - -ClassDef(StvFtsHitErrCalculator,0) -}; - -#endif diff --git a/StRoot/StvUtil/StvGrappa.cxx b/StRoot/StvUtil/StvGrappa.cxx deleted file mode 100644 index f8d780033d0..00000000000 --- a/StRoot/StvUtil/StvGrappa.cxx +++ /dev/null @@ -1,184 +0,0 @@ - -#include "TMath.h" -#include "StvGrappa.h" -#include "TCanvas.h" -#include "TGraph.h" - -#include "Stv/StvHit.h" -#include "Stv/StvNode.h" -#include "Stv/StvTrack.h" - -ClassImp(StvGrappa) -enum StvGrappa2_e {kX,kY,kZ,kR}; - -//______________________________________________________________________________ -StvGrappa::StvGrappa(const char* name) -{ -static int nCall=0; nCall++; - if (name && *name) { SetName(name);} - else { TString ts("Grappa_"); ts+=nCall; SetName(ts.Data());} - memset(mBeg,0,mEnd-mBeg+1); - mActive = 1; -} -//______________________________________________________________________________ -void StvGrappa::Add(double x,double y,double z,int iObj) -{ - if (!mActive) return; - float r = sqrt(x*x+y*y); - mPts[iObj][kX].push_back(x); - mPts[iObj][kY].push_back(y); - mPts[iObj][kZ].push_back(z); - mPts[iObj][kR].push_back(r); -} -//______________________________________________________________________________ -void StvGrappa::Clear(const char *) -{ - if (!mActive) return; - delete mCanvas;mCanvas=0; - for (int i=0;i<(int)mKeep.size();i++) { delete mKeep[i];} - mKeep.clear(); - MyClear(); -} - -//______________________________________________________________________________ -void StvGrappa::MyClear() -{ - for (int i=0;iDivide(1,kNVal); -} -//______________________________________________________________________________ -void StvGrappa::MySize (int iPad, int iX,int iY) -{ - if (iPad==0) { - for (int i=0;ival) mMiMax[iVal][0]=val; - if (mMiMax[iVal][1]cd(iPad+1); - gra->Draw("AP"); - mKeep.push_back(gra); -} -//______________________________________________________________________________ -void StvGrappa::Show() -{ -static const int iXY[kNPad][2] = {{0,1},{2,0},{2,1},{2,3}}; - if (!NObj()) return; - if (!mActive) return; - MySort(); - MakeCanvas(); - - for (int iPad=0;iPadModified(); - mCanvas->Update(); - while(!gSystem->ProcessEvents()){}; - MyClear(); -} - -//______________________________________________________________________________ -void StvGrappa::MyShow(int iPad,int iObj, int iX,int iY) -{ - - int n = mPts[iObj][iX].size(); - if (!n) return; - auto *myGra = new TGraph(n,&mPts[iObj][iX][0],&mPts[iObj][iY][0]); - - myGra->SetMarkerStyle(mMarkerStyle); - myGra->SetMarkerSize (mMarkerSize ); - myGra->SetMarkerColor(mMarkerColor); - mCanvas->cd(iPad+1); - myGra->Draw(mOpt); - mKeep.push_back(myGra); -} -//______________________________________________________________________________ -void StvGrappa::MySort() -{ -std::vector Idx; -std::vector Buf; - for (int iObj=0;iObjbegin();it!=tk->end();++it) { - const StvNode *node = (*it); - const StvHit *hit = node->GetHit(); - const double *Xd = node->GetFP().pos(); - Add(Xd[0],Xd[1],Xd[2],kNode); - if (!hit) continue; - const float *Xf = hit->x(); - Add(Xf[0],Xf[1],Xf[2],kHit); - } - Show(); -} diff --git a/StRoot/StvUtil/StvGrappa.h b/StRoot/StvUtil/StvGrappa.h deleted file mode 100644 index 94913b77a1a..00000000000 --- a/StRoot/StvUtil/StvGrappa.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef STVGRAPPA_H -#define STVGRAPPA_H - -#include -#include "TSystem.h" -#include "TNamed.h" - -class TCanvas; -class TGraph; -class StvTrack; - -class StvGrappa: public TNamed -{ -public: -enum StvGrappa_e {kNode,kHit,kHIT,kHelx,kPont,kNObj,kNPad=4,kNVal=4}; - -StvGrappa(const char* name=""); -~StvGrappa(){ Clear();} -void Add(double x,double y,double z,int iObj); -void Show(); -void Clear(const char* opt=0); - int NObj() const; -void SetActive(int akt=1) {mActive = akt;} -void Show(const StvTrack *tk); -private: -void MakeCanvas(); -void MyShow(int iPad,int iObj,int iX,int iY ); -void MySize(int iPad,int iX,int iY); -void MyClear(); -void MySort(); - - -protected: -char mBeg[1]; -int mMarkerColor; -int mMarkerStyle; -int mMarkerSize; -float mMiMax[kNVal][2]; -const char *mOpt; -TCanvas *mCanvas; -char mEnd[1]; -int mActive; -std::vector mPts[kNObj][kNVal]; //[iObj][x,y,z,rxy] -std::vector mKeep; // -ClassDef(StvGrappa,0) -}; -#endif diff --git a/StRoot/StvUtil/StvHitErrCalculator.cxx b/StRoot/StvUtil/StvHitErrCalculator.cxx deleted file mode 100644 index b31ef99e4e4..00000000000 --- a/StRoot/StvUtil/StvHitErrCalculator.cxx +++ /dev/null @@ -1,680 +0,0 @@ -#include -#include -#include -#include -#include "TCernLib.h" -#include "StvHitErrCalculator.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvHit.h" -#include -#include - -static std::map calcMap; -enum {kMaxLam = 85,kMaxPsi=85}; -static const double kMinCosLam = cos(M_PI/180*kMaxLam),k2MinCosLam=kMinCosLam*kMinCosLam; -static const double kMinCosPsi = cos(M_PI/180*kMaxPsi),k2MinCosPsi=kMinCosPsi*kMinCosPsi; -static const double kMinCpCl = 0.1; - - -// //______________________________________________________________________________ -// double Det33(double T[3][3]) -// { -// // 00 01 02 -// // 10 11 12 -// // 20 21 22 -// T[0][0]*T[1][1]*T[2][2]+T[0][1]*T[1][2]*T[2][0]+T[1][0]*T[2][2]*T[0][2] -// -T[2][0]*T[1][1]*T[0][2] - -ClassImp(StvHitErrCalculator) -ClassImp(StvTpcHitErrCalculator) -//______________________________________________________________________________ -StvHitErrCalculator::StvHitErrCalculator(const char *name,int nPar):TNamed(name,"") -{ - memset(mBeg,0,mEnd-mBeg+1); - mNPar = nPar; - if (!*GetName()) return; - StvHitErrCalculator *&calc = calcMap[GetName()]; - assert(!calc && "Name clash"); - calc = this; -} -//______________________________________________________________________________ -StvHitErrCalculator *StvHitErrCalculator::Inst(const char *name) -{ - StvHitErrCalculator *calc = calcMap[name]; - assert(calc); - return calc; -} -//______________________________________________________________________________ -void StvHitErrCalculator::SetPars(const double *par) -{ - memcpy(mPar,par, GetNPars()*sizeof(*mPar)); -} -//______________________________________________________________________________ -void StvHitErrCalculator::SetTrack(const float tkDir[3]) -{ - double d[3]={tkDir[0],tkDir[1],tkDir[2]}; - SetTrack(d); -} -//______________________________________________________________________________ -void StvHitErrCalculator::SetTrack(const double tkDir[3]) -{ - double nor = (tkDir[0]*tkDir[0]+tkDir[1]*tkDir[1]+tkDir[2]*tkDir[2]); - nor = (fabs(nor-1)< 1e-2)? (nor+1)*0.5 : sqrt(nor); - TCL::vscale(tkDir,1./nor,mTG[0],3); - - nor = (1.-mTG[0][2])*(1+mTG[0][2]); - if (nor <1e-6) { - mTG[1][0]=1; mTG[1][1]=0; mTG[1][2]=0; - mTG[2][0]=0; mTG[2][1]=1; mTG[2][2]=0; - } else { - nor = sqrt(nor); - mTG[1][0] = -mTG[0][1]/nor; mTG[1][1] = mTG[0][0]/nor;mTG[1][2] = 0; - - mTG[2][0] = /*mTG[0][1]*mTG[1][2]*/-mTG[1][1]*mTG[0][2] ; - mTG[2][1] = mTG[0][2]*mTG[1][0]/*-mTG[1][2]*mTG[0][0]*/; - mTG[2][2] = mTG[0][0]*mTG[1][1] -mTG[1][0]*mTG[0][1] ; - } - -} -//______________________________________________________________________________ -int StvHitErrCalculator::CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRr[3]) -{ -/// Calculate hit error matrix in local detector system. In this system -/// detector plane is x = const -// Nt = (cos(Lam)*cos(Phi),cos(Lam)*sin(Phi),sin(Lam)) - memset(mDD[0],0,mNPar*sizeof(mDD[0])); - memset(mDRr,0,sizeof(mDRr)); - mDD[kYErr][kYY] = 1; - mDD[kZErr][kZZ] = 1; - mDRr[kXX] = 0.; - mDRr[kYY] = mDD[kYErr][kYY]*mPar[kYErr]; - mDRr[kZZ] = mDD[kZErr][kZZ]*mPar[kZErr]; - mDRr[kZY] = 0; - if (!hRr) return 0; - hRr[kXX] = mDRr[kYY]; - hRr[kYX] = mDRr[kZY]; - hRr[kYY] = mDRr[kZZ]; - return 0; -} -//______________________________________________________________________________ -int StvHitErrCalculator::CalcLocals(const float hiDir[3][3]) -{ -/// Calculate hit error matrix in DCA system. In this system -/// track is along x axis, Y axis comes thru hit point -static const double s15 = sin(3.14/180*15); -static const double c15 = cos(3.14/180*15); -static const double s45 = sin(3.14/180*45); -static const double c45 = cos(3.14/180*45); - - if (!hiDir) { - mSp = s15 ; mCp = c15 ; mSl = s45 ; mCl = c45 ; - mSp2 = s15*s15; mCp2 = c15*c15; mSl2 = s45*s45; mCl2 = c45*c45; - mCpCl = mCp*mCl; - return 0; - } - for (int j=0;j<3;j++) { - mTL[j] = (hiDir[j][0]*mTG[0][0]+hiDir[j][1]*mTG[0][1]+hiDir[j][2]*mTG[0][2]);} - - -// mTL = (cos(Lam)*cos(Phi),cos(Lam)*sin(Phi),sin(Lam)) - mSl = mTL[2],mCl2 = ((1-mSl)*(1+mSl)); - if (mCl20); - assert(hRr[kYY]>0); - assert(hRr[kYY]*hRr[kXX]>hRr[kYX]*hRr[kYX]); - return 0; -} -//______________________________________________________________________________ -void StvHitErrCalculator::CalcDcaDers(double dRr[kMaxPars][3]) -{ -// Calculate deriavatives of err matrix. -// must be called after CalcDcaErrs(...) - double myDRr[6]; - for (int iPar=0;iParerrMtx(),mDRr,6); - TCL::trasat(mTG[0],mDRr,mTRr,3,3); - hRr[kXX] = mTRr[kYY]; - hRr[kXY] = mTRr[kYZ]; - hRr[kYY] = mTRr[kZZ]; - return 0; -} -//______________________________________________________________________________ -int StvHitRrCalculator::CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRr[3]) -{ - assert(hiPos && hiDir && hRr); - assert(0 && "Not implemented"); - return 0; -} - -//______________________________________________________________________________ -int StvTpcHitErrCalculator::CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRr[3]) -{ -/// Calculate hit error matrix in local detector system. In this system -/// detector plane is x = const -// = DD/12 -// -// = tP* DD/12 -// = tP2*DD/12 +WWy/cP2 -// -// = tL/cP*(DD/12) -// = (tP*tL)/cP*((DD/12 + WWy)) -// = tL2/cP2*(DD/12 + WWy) +WWz - - double Rxy = sqrt(hiPos[0]*hiPos[0]+hiPos[1]*hiPos[1]); - if ( Rxy < 100 ) {assert( strstr(GetName(),"Inner"));} - - int ans = CalcLocals(hiDir); - if (ans) return ans; - - memset(mDD[0],0,mNPar*sizeof(mDD[0])); - memset(mDRr,0,sizeof(mDRr)); - - double myTp = mSp/mCp, myTp2 = myTp*myTp; - double myTl = mSl/mCl, myTl2 = myTl*myTl; - mZSpan = fabs(fabs(hiPos[2])-210)/100; - double WWyy = mPar[kYYDiff]*mZSpan; - double WWzz = mPar[kZZDiff]*mZSpan; - double DD = mPar[kThkDet]/12; - - double qCpCl = sqrt(mCpCl); - double yF = mPar[kYFact ]*qCpCl; - double zF = mPar[kZFact ]*qCpCl; - -// = DD/12 -// -// = tP * DD/12 *sqrt(yFact) -// = tP2*(DD/12) +WWy/cP2 -// -// = tL/cP*(DD/12) -// = (tP*tL)/cP*((DD/12 + WWy)) -// = tL2/cP2*(DD/12 + WWy) +WWz +AB/cP2 - -// mDRr[kXX] = DD; -// -// mDRr[kYX] = myTp*DD*yF; -// mDRr[kZX] = myTl/mCp*DD*zF; -// - mDRr[kYY] =(myTp2*DD + WWyy/mCp2)*yF*yF + mPar[kYErr]; - mDRr[kZY] = myTp*myTl/mCp*(DD + WWyy)*yF*zF; - mDRr[kZZ] = (myTl2/mCp2*(DD +WWyy) + WWzz + mPar[kZAB2]/180/mCp2)*zF*zF + mPar[kZErr]; - -// NOW DERIVATIVEs - -// = DD/12 -// - -// mDRr[kYX] = myTp*DD*yF; -// mDD[kYFact ][kYX] = myTp*DD*qCpCl; - - -// mDRr[kZX] = myTl/mCp*DD*zF; -// mDD[kZFact ][kZX] = myTl/mCp*DD*qCpCl; - -// mDRr[kYY] =(myTp2*DD + WWyy/mCp2)*yF*yF + mPar[kYErr]; - mDD[kYErr ][kYY] = 1;; - mDD[kYFact ][kYY] = (myTp2*DD + WWyy/mCp2)*yF*2*qCpCl; - mDD[kYYDiff][kYY] = mZSpan/mCp2*yF*yF; - -// mDRr[kZY] = myTp*myTl/mCp*(DD + WWyy)*yF*zF; - mDD[kYFact ][kZY] = myTp*myTl/mCp*(DD + WWyy)*zF*qCpCl; - mDD[kZFact ][kZY] = myTp*myTl/mCp*(DD + WWyy)*yF*qCpCl; - mDD[kYYDiff][kZY] = mZSpan*myTp*myTl/mCp*yF*zF; - -// mDRr[kZZ] = (myTl2/mCp2*(DD +WWyy) + WWzz + mPar[kZAB2]/180/mCp2)*zF*zF + mPar[kZErr]; - mDD[kZErr ][kZZ] = 1;; - mDD[kZFact ][kZZ] = (myTl2/mCp2*(DD +WWyy) + WWzz + mPar[kZAB2]/180/mCp2)*zF*2*qCpCl; - mDD[kYYDiff][kZZ] = mZSpan*myTl2/mCp2*zF*zF; - mDD[kZZDiff][kZZ] = mZSpan*zF*zF; - mDD[kZAB2 ][kZZ] = 1./180/mCp2*zF*zF; - - - assert(mDRr[kYY]>0); - assert(mDRr[kZZ]>0); - assert(mDRr[kYY]*mDRr[kZZ]>mDRr[kZY]*mDRr[kZY]); - - if (!hRr) return 0; - hRr[kXX] = mDRr[kYY]; - hRr[kYY] = mDRr[kZZ]; - hRr[kYX] = mDRr[kZY]; - - return 0; - -} -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -int StvTpcGeoErrCalculator::CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRr[3]) -{ -// = DD/12 -// -// = tP*DD/12 -// = tP2*(DD/12) +WWy/cP2 -// -// = tL/cP*(DD/12) -// = (tP*tL)/cP*((DD/12 + WWy)) -// = tL2/cP2*(DD/12 + WWy) +WWz - -/// Calculate hit error matrix in local detector system. In this system -/// detector plane is x = const - - int ans =CalcLocals(hiDir); - if (ans) return ans; - - memset(mDD[0],0,mNPar*sizeof(mDD[0])); - double myTp = mSp/mCp, myTp2 = myTp*myTp; - double myTl = mSl/mCl, myTl2 = myTl*myTl; - - mZSpan = fabs(fabs(hiPos[2])-210)/100; - mDD[kYThkDet][kXX] = 0.5/12; - mDD[kZThkDet][kXX] = 0.5/12; - - mDD[kYThkDet][kYX] = myTp /12; - - mDD[kYThkDet][kYY] = myTp2/12; - mDD[kYDiff ][kYY] = mZSpan/mCp2; - - mDD[kZThkDet][kZX] = myTl/mCp/12; - - mDD[kYThkDet][kZY] = myTl*myTp/mCp/12 *0.5; - mDD[kZThkDet][kZY] = myTl*myTp/mCp/12 *0.5; - mDD[kYDiff ][kZY] = mZSpan*myTl*myTp/mCp; - - mDD[kZThkDet][kZZ] = myTl2/mCp2/12; - mDD[kYDiff ][kZZ] = mZSpan*myTl2/mCp2; - mDD[kZDiff ][kZZ] = mZSpan; - TCL::vscale(mDD[0],mCpCl,mDD[0],6*mNPar); - - for (int ig=0;ig<6;ig++) { - double s = 0; - for (int ip=0;ip = DD/12 -// - int ans = CalcLocals(hiDir); - if (ans) return ans; - mZSpan = fabs(fabs(hiPos[2])-210)/100; - mCpCl = 1; - double myTp = mSp/mCp, myTp2 = myTp*myTp; - double myTl = mSl/mCl, myTl2 = myTl*myTl; - - double DDy = mPar[kYThkDet]; - double DDz = mPar[kZThkDet]; - double WWy = mPar[kYDiff]*mZSpan; - double WWz = mPar[kZDiff]*mZSpan; - - memset(mDD[0],0,mNPar*sizeof(mDD[0])); -// Sti code -// ecross=Coeff[0]+Coeff[1]*dz/(cosCA*cosCA) +Coeff[2]*tanCA* tanCA; -// edip =Coeff[3]+Coeff[4]*dz*cosDipInv2 +Coeff[5]*tanDip*tanDip; - - - mDRr[kXX] = 1e-6; - mDRr[kYY] = myTp2*DDy +WWy/mCp2+mPar[kYErr]; - mDRr[kZZ] = myTl2*DDz +WWz/mCl2+mPar[kZErr]; - - if (!hRr) return 0; - hRr[kXX] = mDRr[kYY]; - hRr[kYY] = mDRr[kZZ]; - hRr[kYX] = mDRr[kZY]; - - return 0; - -} - - -#include "TRandom.h" -#include "TVector3.h" -//______________________________________________________________________________ -void StvTpcHitErrCalculator::Dest(double phiG,double lamG) -{ - double par[10]={0}; -static const char *titPa[9]={"YErr ","ZErr ","ThkDet","YYDiff","ZZDiff" - ,"YZDiff","YFact","ZFact ","ZAB2 "}; - -static const char *titYZ [3] = {"YY","ZY","ZZ"}; -static const char *titXYZ[6] = {"XX","YX","YY","ZX","ZY","XX"}; - -// kYErr =0, /* Intrinsic resolution, padrow or Y direction */ -// kZErr =1, /* Intrinsic resolution, z direction */ -// kThkDet =2, /* detector thickness**2 , not fitted */ -// kYYDiff =3, /* Diffusion in XY direction *yFactor */ -// kZZDiff =4, /* Diffusion in Z direction *ZFactor */ -// kYFact =5, /* Error factor in Y-direction */ -// kZFact =6, /* Error factor in Z-direction */ -// kZAB2 =7}; /* Constant member in Z direction (a*b)**2 */ - - par[kYErr]=0.03*0.03; - par[kZErr]=0.07*0.07; - par[kThkDet]=1.; - par[kYYDiff]=0.11; - par[kZZDiff]=0.12; - par[kYFact ]=0.9; - par[kZFact ]=0.8; - par[kZAB2 ]=1; - - double Lam = lamG/180*M_PI; - double Phi = phiG/180*M_PI; - double cL = cos(Lam); - double sL = sin(Lam); - double cP = cos(Phi); - double sP = sin(Phi); - double Nt[3]={cL*cP,cL*sP,sL}; - float hiPos[3] = {100,0,55}; - float hiDir[3][3]={{1,0,0},{0,1,0},{0,0,1}}; - -// Randomize orientation - double LamH = (gRandom->Rndm()-0.5); - double PhiH = (gRandom->Rndm()-0.5); -// copy all info from arrays to TVector3 - TVector3 myV[4]; - for (int i=0;i<3;i++) { myV[i] = TVector3(hiDir[i]);} - myV[3] = TVector3(Nt); -// Rotate it - for (int i=0;i<4;i++) { myV[i].RotateZ(PhiH);myV[i].RotateX(LamH);} - -// copy all info back into arrays - for (int i=0;i<3;i++) { Nt[i] = myV[3][i]; - for (int j=0;j<3;j++) { hiDir[i][j] = myV[i][j]; }} - - StvTpcHitErrCalculator calc("TpcInnerHitErrs"); - int nPars = calc.GetNPars(); - calc.SetPars(par); - calc.SetTrack(Nt); - double hRR[6],dRR[10][3],dRRx[10][6]; - - StvTpcHitErrCalculator calk("TpcInnerHitErrs.tmp"); - for (int detDca = 0; detDca<3; detDca++) { -static const char *tit[3] = {"Test CalcDetDers()","Test CalcDcaDers()","Test internals" }; - printf("\n\n\n StvTpcHitErrCalculator::Dest(%s)\n\n",tit[detDca]); - switch(detDca) { - case 0: {calc.CalcDetErrs(hiPos,hiDir,hRR); calc.CalcDetDers(dRR); break;} - case 1: {calc.CalcDcaErrs(hiPos,hiDir,hRR); calc.CalcDcaDers(dRR); break;} - case 2: {calc.CalcDetErrs(hiPos,hiDir,hRR); calc.CalcDetDers(dRR); - memcpy(hRR ,calc.mDRr ,sizeof(hRR )); - memcpy(dRRx[0],calc.mDD[0],sizeof(dRRx)); break;} - }; - for (int j=0;j<3;j++) { - printf("hRR[%d]=%g Der = %g %g %g %g\n",j,hRR[j] - ,dRR[0][j],dRR[1][j],dRR[2][j],dRR[3][j]); - } - - for (int ider=0;iderRndm()-0.5)/2; -// double Phi = 3.14*(gRandom->Rndm()-0.5); - double Lam = lamG/180*M_PI; - double Phi = phiG/180*M_PI; - double W = 0; //Width of the track - double D = 0; //Thickness of detector plane - double cL = cos(Lam); - double sL = sin(Lam); - double tL = tan(Lam); - double cP = cos(Phi); - double sP = sin(Phi); - TVector3 Nt(cL*cP,cL*sP,sL); - TVector3 Np(-sP, cP, 0); - TVector3 Nl(-sL*cP,-sL*sP,cL); - - TVector3 V; - double YZ[3]={0},BG[3]={0}; - int nEl=100000,iEl=0; - while (1) { - double alfa = D/(Nt[0])*(gRandom->Rndm()-0.5)*10; - double beta = gRandom->Gaus()*W; - double gama = gRandom->Gaus()*W; - V = Nt*alfa + Np*beta + Nl*gama; - if (fabs((V[0]))>0.5*D) continue; - V[1]+= gRandom->Gaus()*sqrt(par[kYErr]); - V[2]+= gRandom->Gaus()*sqrt(par[kZErr]); - - if(++iEl>=nEl) break; - -// Project along X to X=0 - alfa = (V[0]); V[0] =0; - beta = (Np*V); - gama = (Nl*V); - BG[0]+=beta*beta; BG[1]+=beta*gama;BG[2]+=gama*gama; - - beta = (V[1]); - gama = (V[2]); - YZ[0] += beta*beta; YZ[1] += beta*gama;YZ[2] += gama*gama; - } - for (int j=0;j<3;j++){YZ[j]/=nEl; BG[j]/=nEl;} - - printf("Phi=%d Lam=%d: \tYY=%g \tYZ=%g \tZZ=%g \tTrace=%g\n" - , int(Phi/3.1415*180),int(Lam/3.1415*180),YZ[0],YZ[1],YZ[2],YZ[0]+YZ[2]); - - StvHitErrCalculator calc("",nPar); - calc.SetPars(par); - double np[3]={ cP, sP, tL}; - double hitErr[3]; - calc.SetTrack(np); - float hiDir[3][3]={{1,0,0} - ,{0,1,0} - ,{0,0,1}}; - calc.CalcDetErrs(0,hiDir,hitErr); - printf("Det Calc: \tYY=%g \tYZ=%g \tZZ=%g \tTrace=%g\n" - ,hitErr[0],hitErr[1],hitErr[2],hitErr[0]+hitErr[2]); - - printf("DCA : \tBB=%g \tBG=%g \tGG=%g \tTrace=%g\n",BG[0],BG[1],BG[2],BG[0]+BG[2]); - calc.CalcDcaErrs(0,hiDir,hitErr); - printf("DCA Calc : \tBB=%g \tBG=%g \tGG=%g \tTrace=%g\n" - ,hitErr[0],hitErr[1],hitErr[2],hitErr[0]+hitErr[2]); - - double LamH = (gRandom->Rndm()-0.5); - double PhiH = (gRandom->Rndm()-0.5); -// copy all info from arrays to TVector3 - TVector3 myV[4]; - for (int i=0;i<3;i++) { myV[i] = TVector3(hiDir[i]);} - myV[3] = TVector3(np); -// Rotate it - for (int i=0;i<4;i++) { myV[i].RotateZ(PhiH);myV[i].RotateX(LamH);} - -// copy all info back into arrays - for (int i=0;i<3;i++) { np[i] = myV[3][i]; - for (int j=0;j<3;j++) { hiDir[i][j] = myV[i][j]; }} -// Now try how life is here - calc.SetTrack(np); - calc.CalcDetErrs(0,hiDir,hitErr); - printf("Det Rot : \tYY=%g \tYZ=%g \tZZ=%g \tTrace=%g\n" - ,hitErr[0],hitErr[1],hitErr[2],hitErr[0]+hitErr[2]); - - double myHitErr[3]; - double myT[2][2]= {{cP,0},{-sL*sP,cL}}; - TCL::trasat(myT[0],hitErr,myHitErr,2,2); - printf("DCAtest : \tBB=%g \tBG=%g \tGG=%g \tTrace=%g\n" - ,myHitErr[0],myHitErr[1],myHitErr[2],myHitErr[0]+myHitErr[2]); - - - calc.CalcDcaErrs(0,hiDir,hitErr); - printf("DCA Rot : \tBB=%g \tBG=%g \tGG=%g \tTrace=%g\n" - ,hitErr[0],hitErr[1],hitErr[2],hitErr[0]+hitErr[2]); - - - -} -//______________________________________________________________________________ -void StvHitErrCalculator::Dest(double phiG,double lamG) -{ - int nPars = 2; - double par[6]={0}; - par[kYErr]=0.1*0.1; - par[kZErr]=0.2*0.2; - - double Lam = lamG/180*M_PI; - double Phi = phiG/180*M_PI; - double cL = cos(Lam); - double sL = sin(Lam); - double cP = cos(Phi); - double sP = sin(Phi); - double Nt[3]={cL*cP,cL*sP,sL}; - float hiPos[3] = {100,0,0}; - float hiDir[3][3]={{1,0,0},{0,1,0},{0,0,1}}; - - double LamH = (gRandom->Rndm()-0.5); - double PhiH = (gRandom->Rndm()-0.5); -// copy all info from arrays to TVector3 - TVector3 myV[4]; - for (int i=0;i<3;i++) { myV[i] = TVector3(hiDir[i]);} - myV[3] = TVector3(Nt); -// Rotate it - for (int i=0;i<4;i++) { myV[i].RotateZ(PhiH);myV[i].RotateX(LamH);} - -// copy all info back into arrays - for (int i=0;i<3;i++) { Nt[i] = myV[3][i]; - for (int j=0;j<3;j++) { hiDir[i][j] = myV[i][j]; }} - - - - StvHitErrCalculator calc("",nPars); - calc.SetPars(par); - calc.SetTrack(Nt); - double hRR[3],dRR[10][3]; - calc.CalcDcaErrs(hiPos,hiDir,hRR); - calc.CalcDcaDers(dRR); - for (int j=0;jdetector(); - const Mtx33F_t &hD = hp->GetDir(hit->x()); - return CalcDcaErrs(hit->x(),hD,hRr); -} - -#endif //0 diff --git a/StRoot/StvUtil/StvHitErrCalculator.h b/StRoot/StvUtil/StvHitErrCalculator.h deleted file mode 100644 index 0aa2e62c950..00000000000 --- a/StRoot/StvUtil/StvHitErrCalculator.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef __StvHitErrCalculatorulator_h_ -#define __StvHitErrCalculatorulator_h_ -#include "assert.h" -#include "TNamed.h" -class StvHit; -typedef float Mtx33F_t[3][3]; - -class StvHitErrCalculator : public TNamed { -public: -enum {kMaxPars=10}; - -StvHitErrCalculator(const char *name,int nPars=2); - void SetPars(const double *par); - void SetTrack(const double tkDir[3]); - void SetTrack(const float tkDir[3]); -virtual int CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); -virtual int CalcDcaErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); -virtual int CalcDcaErrs(const StvHit *hit,double hRR[3]); -virtual void CalcDetDers(double dRR[kMaxPars][3]); -virtual void CalcDcaDers(double dRR[kMaxPars][3]); -virtual double Trace(const float hiPos[3]); -virtual int GetNPars() const {return mNPar;} -const double *GetPars() const {return mPar ;} - double *GetPars() {return mPar ;} -static StvHitErrCalculator *Inst(const char *name); -static void Test(double phiG=33,double lamG=66); -static void Dest(double phiG=33,double lamG=66); -protected: -int CalcLocals(const float hiDir[3][3]); -protected: -enum {kYErr=0,kZErr=1}; -enum {kXX=0,kYX=1,kXY=1,kYY=2,kZX=3,kXZ=3,kZY=4,kYZ=4,kZZ=5}; - -char mBeg[1]; -int mFailed; -int mNPar; //Size of mPar -double mPar[kMaxPars]; // mPar -double mDRr[6]; // Full hitErr Matrix in detecor system -double mTRr[6]; // Full hitErr Matrix in track system -double mTG[3][3]; // track direction in global system -double mTL[3]; // track direction in local hit plane system -double mCp ,mSp ,mCl ,mSl; -double mCp2,mSp2,mCl2,mSl2,mCpCl; -double mTT[3][3]; //matrix converting from detector to track(dca) system -double mDD[kMaxPars][6]; -char mEnd[1]; -ClassDef(StvHitErrCalculator,0) -}; - -class StvHitRrCalculator : public StvHitErrCalculator { - -public: - StvHitRrCalculator(const char *name="HitRr"):StvHitErrCalculator(name,0){}; -virtual int CalcDcaErrs(const StvHit *stvHit,double hRR[3]); -virtual int CalcDcaErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]){assert(0); return 999;}; -virtual int CalcDetErrs(const float*, const float (*)[3], double*); -ClassDef(StvHitRrCalculator,0) -}; - - - -class StvTpcHitErrCalculator : public StvHitErrCalculator { - -public: - StvTpcHitErrCalculator(const char *name="TpcHitErr"):StvHitErrCalculator(name,8){}; -virtual int CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); -static void Dest(double phiG=33,double lamG=33); - -protected: -enum { -kYErr =0, /* Intrinsic resolution, padrow or Y direction */ -kZErr =1, /* Intrinsic resolution, z direction */ -kThkDet =2, /* detector thickness**2 , not fitted */ -kYYDiff =3, /* Diffusion in XY direction *yFactor */ -kZZDiff =4, /* Diffusion in Z direction *ZFactor */ -kYFact =5, /* Error factor in Y-direction */ -kZFact =6, /* Error factor in Z-direction */ -kZAB2 =7}; /* Constant member in Z direction (a*b)**2 */ -double mZSpan; -ClassDef(StvTpcHitErrCalculator,0) -}; - - -class StvTpcGeoErrCalculator : public StvHitErrCalculator { - -public: - StvTpcGeoErrCalculator(const char *name="TpcHitGeo"):StvHitErrCalculator(name,7){}; -virtual int CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); - -protected: -enum {kYDiff =2 //Diffusion in XY direction - ,kYThkDet=4 //Effective detectot thickness for Y err - ,kZDiff =3 //Diffusion in Z direction - ,kZThkDet=5 //Effective detectot thickness for Z err - ,kZAB2 =6 //Constant member in Z direction (a*b)**2 - }; -double mZSpan; -ClassDef(StvTpcGeoErrCalculator,0) -}; - -class StvTpcStiErrCalculator : public StvHitErrCalculator { - -public: - StvTpcStiErrCalculator(const char *name="StiHitErr"):StvHitErrCalculator(name,6){}; -virtual int CalcDetErrs(const float hiPos[3],const float hiDir[3][3],double hRR[3]); - -protected: -enum {kYErr =0 //Diffusion in XY direction - ,kYThkDet=1 //Effective detectot thickness**2/12 for Y err - ,kYDiff =2 //Diffusion in Z direction - ,kZErr =3 //electronics Z err - ,kZDiff =4 //Diffusion in Z direction - ,kZThkDet=5}; //Effective detectot thickness**2/12 for Z err -double mZSpan; -/*ClassDef(StvTpcStiErrCalculator,0)*/ -}; - -#endif diff --git a/StRoot/StvUtil/StvKNNUtil.cxx b/StRoot/StvUtil/StvKNNUtil.cxx deleted file mode 100644 index 1f1560e1c3a..00000000000 --- a/StRoot/StvUtil/StvKNNUtil.cxx +++ /dev/null @@ -1,176 +0,0 @@ -#include -#include -#include -#include -#include -#include "StvKNNUtil.h" -//_____________________________________________________________________________ - StvKNNUtil::StvKNNUtil(int nVr,int nGb): mNVars(nVr),mKNNgb(nGb) -{ -assert(nGb<=kKNNgbMax); -assert(nVr<=kKNNvrMax); - Reset(); -} -//_____________________________________________________________________________ -void StvKNNUtil::Reset() -{ -mIdxBestWost[0]=-1; mIdxBestWost[1]=-1; -mBestWost[0] =3e33; mBestWost[1] =-3e33; -mEnt.clear(); -} -//_____________________________________________________________________________ -int StvKNNUtil::Add(ULong_t id,const float *vars) -{ - int nWas = mEnt.size(); - mEnt.resize(nWas+1); - StvKNNAux &bk = mEnt.back(); - bk.mId = id; - memcpy(bk.mVar,vars,sizeof(bk.mVar[0])*mNVars); - for (int i=0;iq[0].qa) continue; - int before = 1; - for (;before=q[before].qa) break;} - if (before-1>0) {memcpy(q,q+1,(before-1)*sizeof(q[0]));} - q[before-1].qa = qa; q[before-1].ix = kogo; -// Now update min/max - if (mBestWost[0]>q[0].qa) {mBestWost[0]=q[0].qa;mIdxBestWost[0]=kuda;} - }//end neighbour loop - }//end ent loop - return mEnt.size(); - -} -//_____________________________________________________________________________ -double StvKNNUtil::Dist(const float *a,const float *b) const -{ double s=0; - for(int i=0;imaxDis) maxDis=s; - } - return sqrt(maxDis); -} - -//_____________________________________________________________________________ -StvKNNAux::StvKNNAux() -{ - memset(this,0,sizeof(*this)); -} - diff --git a/StRoot/StvUtil/StvKNNUtil.h b/StRoot/StvUtil/StvKNNUtil.h deleted file mode 100644 index 0ac98a43020..00000000000 --- a/StRoot/StvUtil/StvKNNUtil.h +++ /dev/null @@ -1,54 +0,0 @@ - -/// \File StvKNNUtil.h -/// \author Victor Perev 01/2013 -#ifndef StvKNNUtil_HH -#define StvKNNUtil_HH -#include -#include -#include "Rtypes.h" -/// \class StvKNNUtil - -enum { kKNNgbMax = 5, kKNNvrMax=3}; -class StvKNNAux -{ -friend class StvKNNUtil; -public: -class QaIx_t {public: int ix;float qa;}; -StvKNNAux(); -private: -ULong_t mId; -float mVar[kKNNvrMax]; -QaIx_t mQa[kKNNgbMax]; -}; - - -class StvKNNUtil -{ -public: - StvKNNUtil(int nVr,int nGb); - virtual ~StvKNNUtil(){;} - virtual double Dist(const float *a,const float *b) const; - void Reset(); - int Add(ULong_t id,const float *vars); -double GetBest(ULong_t *id=0,ULong_t *ngb=0) const; -double GetWost(ULong_t *id=0,ULong_t *ngb=0) const; -double GetBest(int &idx,int *ngb=0) const; -double GetWost(int &idx,int *ngb=0) const; -double GetByIdx(int idx,int *ngb=0)const; - -double BestPos(float *var =0) const; -double WostDis(const float *var) const; - -private: -const int mNVars; //number of variables -const int mKNNgb; //number of neighbours -mutable int mIdxBestWost[2]; -mutable double mBestWost[2]; //[0]=max density; [1]=min density - - -std::vector mEnt; //KNN entries - - -}; - -#endif diff --git a/StRoot/StvUtil/StvNodePars.cxx b/StRoot/StvUtil/StvNodePars.cxx deleted file mode 100644 index b0c2d105320..00000000000 --- a/StRoot/StvUtil/StvNodePars.cxx +++ /dev/null @@ -1,1854 +0,0 @@ -#include -#include -#include -#include "TCernLib.h" -#include "TMath.h" -#include "TMath.h" -#include "StvUtil/StvNodePars.h" -#include "StvUtil/StvELossTrak.h" -#include "StvUtil/StvDebug.h" -#include "Stv/StvToolkit.h" -#include "TString.h" - -static const double kMaxPti=200,kMaxCurv=(0.000299792458 * 4.98478)*kMaxPti,kMaxEta = 6; -static const double kMaxLamda = 3.14159265358/2-atan(exp(-kMaxEta))*2; -static const double kMaxTanL = tan(kMaxLamda); - -enum {kHf,kZf,kAf,kLf,kPf}; -enum {kHh,kAh,kCh,kZh,kLh}; - static const int idx66[6][6] = - {{ 0, 1, 3, 6,10,15},{ 1, 2, 4, 7,11,16},{ 3, 4, 5, 8,12,17} - ,{ 6, 7, 8, 9,13,18},{10,11,12,13,14,19},{15,16,17,18,19,20}}; -static const double recvCORRMAX = 0.99; -static const double chekCORRMAX = 0.9999; - -// x y z psi pti tan cur -static double MAXNODPARS[] ={555,555,555,6.66,kMaxPti+10, kMaxTanL+10, .1}; -// h z a l ptin -static const double MAXFITPARS[] ={1.0 ,1.0,0.5 ,0.5 ,kMaxPti }; -static const double BIGFITPARS[] ={0.1 ,0.1,0.1 ,0.1 ,0.01},BIGFITPART=0.01; -static const double kERRFACT = 3*3; -static const double kFitErrs[5] ={3,3 - ,10./180*M_PI - ,10./180*M_PI - ,kMaxPti}; -static const double kPiMass=0.13956995; -static const double kMinP = 0.01,kMinE = sqrt(kMinP*kMinP+kPiMass*kPiMass); -static const double kMaxCorr = 0.1; - - -//______________________________________________________________________________ -static void LinearCurv (double Rho,double dRho,double len, double &dT,double &dH) -{ - - - double X[2]={0},D[2]={1}; - double X0End[2]; - TCircle tc(X,D,Rho); - tc.Eval(len,X0End); - double step = 0.1/fabs(Rho)+1e-10; - int nStep = int(fabs(len)/step+0.5); - step = len/nStep; - for (int istep=0;istep0.5) return (sin(x)-x)/x2/x; - double nom = -1./6; - double sum = nom; - for (int it=4;1;it+=2) { - nom = -nom*x2/(it*(it+1)); - sum +=nom; - if (fabs(nom) <= 1e-10*fabs(sum)) break; - } - return sum; -} -//______________________________________________________________________________ -void StvTrackNode::mult6(double Rot[kNPars][kNPars],const double Pro[kNPars][kNPars]) -{ - double T[kNPars][kNPars]; - - if (!Rot[0][0]) {memcpy(Rot[0],Pro[0],sizeof(T)); return;} - - memcpy(T[0],Pro[0],sizeof(T)); - - for (int i=0;i=1e-5 && fabs(tmp)> 1e-3*fabs(_curv)) {ierr=1001; goto FAILED;} - for (int i=0;i<=kNPars;i++){if (fabs(P[i]) > MAXNODPARS[i]) {ierr = i+ 1; goto FAILED;}} - - for (int i=-2;i<0;i++) {if (fabs(P[i]) > 1.0001) {ierr = i+1010; goto FAILED;}} - tmp = fabs(cos(_psi)-_cosCA); - ierr = 1002; if (tmp>1e-4) goto FAILED; - tmp = fabs(sin(_psi)-_sinCA); - ierr = 1003; if (tmp>1e-4) goto FAILED; - return 0; -FAILED: - assert(ierr<1000); - if (!pri ) return ierr; - printf("StvNodePars::check(%s) == FAILED(%d)\n",pri,ierr); print(); - return ierr; -} -//______________________________________________________________________________ -StvNodePars &StvNodePars::merge(double wt,StvNodePars &other) -{ - assert(_hz); - double wt0 = 1.-wt; - for (int i=0;iPos(),3*sizeof(_x)); - assert(fabs(_x)<500); - assert(fabs(_y)<500); - _psi = atan2(th->Dir()[1],th->Dir()[0]); - double sinL = th->Dir()[2]; - double cosL = sqrt((1-sinL)*(1+sinL)); - _tanl = sinL/cosL; - - _cosCA = th->Dir()[0]/cosL; - _sinCA = th->Dir()[1]/cosL; - _curv = th->GetRho(); - _hz = Hz; - assert(_hz); - if (fabs(_curv) > fabs(1e-6*_hz)) {_ptin = _curv/_hz; } - else {_ptin = 1e-6; _curv = _ptin*_hz;} -} - -//______________________________________________________________________________ -void StvNodePars::get(THelixTrack *th) const -{ - assert(_hz); - double dir[3]={_cosCA,_sinCA,_tanl}; - th->Set(&_x,dir,_curv); -} -//______________________________________________________________________________ -void StvNodePars::move(double dLen) -{ - double dcCA,dsCA,dC,dS,dCR,dSR,dX,dY,dZ; - double dLxy = dLen*getCosL(); - double dPhi = _curv*dLxy; -assert(fabs(_cosCA)<1.001); -assert(fabs(_sinCA)<1.001); - - assert(_hz); - if (fabs(dPhi) < 0.1) { - dCR = dLxy*dPhi*(-1./2 + dPhi*dPhi/24); dSR = dLxy*(1-dPhi*dPhi/6); - dC = dCR*_curv; dS = dSR*_curv; - } else { - dC = cos(dPhi)-1; dS = sin(dPhi); - dCR = dC/_curv; dSR = dS/_curv; - } - dX = (_cosCA*dSR + _sinCA*dCR); - dY = (_sinCA*dSR - _cosCA*dCR); - dZ = dLxy*_tanl; - dcCA = _cosCA*dC - _sinCA*dS; - dsCA = _sinCA*dC + _cosCA*dS; - _cosCA+=dcCA; _sinCA+=dsCA; _x+=dX; _y+=dY; _z+=dZ; _psi+=dPhi; -assert(fabs(_cosCA)<1.01); - if (fabs(_cosCA)>1 || fabs(_sinCA)>1 ) ready(); - while(_psi> M_PI) { _psi-=2*M_PI;} - while(_psi<-M_PI) { _psi+=2*M_PI;} - assert(fabs(_psi)<=M_PI); -} -//______________________________________________________________________________ -double StvNodePars::move(const double v[3],double dPP, int dir) -{ -// move to dca point and return dca length -// dPP account energy loss dPP = deltaP/P/Len - -static int nCall=0; nCall++; -static const double kMomAccu = 1e-3; //momentum relative accuracy -static const double kAngAcc[2]={3.14/180, kAngAcc[0]*0.1}; -static const double kAngMax=0.1; -StvDebug::Break(nCall); - - double MOM[3]={_cosCA,_sinCA,_tanl}; - double cos2Li = (1+_tanl*_tanl),cosL = sqrt(1./cos2Li); - - double myLen = 0; - for (int jk=0;jk<2;jk++) {//jk=0=move without energy loss,=1 with - int converge = 0; - StvNodePars save = *this; - for (int it=0;it<5;it++) { - double mom[3]={_cosCA,_sinCA,_tanl}; - double vtx[3]={v[0]-_x,v[1]-_y,v[2]-_z}; - double tau = (vtx[0]*mom[0]+vtx[1]*mom[1]+vtx[2]*mom[2])*cosL; - double dang = tau*_curv*cosL; - if (fabs(dang)>kAngMax) break; - move(tau); myLen+=tau; - if (fabs(dang) < kAngAcc[jk]) {converge = 1; break;} - }// end iters - if (!converge) { //failed, try THelix - *this = save; - double mom[3]={_cosCA,_sinCA,_tanl}; - THelixTrack hlx(&_x,mom,_curv); - myLen = hlx.Path(v); - move(myLen); - } - -assert(fabs(_z)<999); - if (jk) return myLen; - double dRho = dPP*myLen,fak = 1+dRho; //accounts sign dP/P = -dRho/Rho & sign of len - if (fabs(dRho)0) ? mydRho:0; - } - if (_curv*fak > kMaxCurv) { - double mydRho = (kMaxCurv-_curv)/_curv; - dRho = (mydRho*dRho>0) ? mydRho:0; - } - double lxy=myLen*cosL; - - double ang = _curv*lxy,ang2=ang*ang; - double dH,dT,dA; - int jkFlag=1; - if (fabs(ang)<0.1) {//Small angle - dH = 1./3 ; dT = 1./4;} - else if ( fabs(ang)<0.5) {//Reasonable angle - double qqCos = ((cos(ang)-1)/ang2+1./2)/ang2; //~ 1/24 - double qqSin = (sin(ang)/(ang)-1)/ang2; //~-1/6 - dT = ((qqCos+qqSin)*2-qqCos*ang2+1./2); //~1/4 - dH = ((2*qqCos+qqSin)*ang2 -2*qqSin ); //~1/3 - } - else {//Big angle, approximation does NOT work - jkFlag=0; - LinearCurv(_curv,dRho*_curv,lxy,dT,dH ); - } - if (jkFlag) { - dH*= dRho*ang *lxy/2; - dT*=-dRho*ang2*lxy/2; - } - dA = dRho*ang/2; - - - - _x += MOM[0]*dT-MOM[1]*dH; - _y += MOM[1]*dT+MOM[0]*dH; - _psi += dA; - while (_psi<-M_PI) { _psi+=2*M_PI;} - while (_psi> M_PI) { _psi-=2*M_PI;} -assert(fabs(_psi)<=M_PI); - _curv += _curv*dRho; - _ptin =_curv/_hz; - if (fabs(dA)<1e-2) { - double cosCA = _cosCA; - _cosCA -= _sinCA*dA; - _sinCA += cosCA*dA;} - else { - _cosCA = cos(_psi); - _sinCA = sin(_psi); - } - - - }//end jk loop -assert((myLen>0) == (dir==1)); -assert(fabs(_z)<999); - return myLen; - -} -//______________________________________________________________________________ -void StvNodePars::moveToR(double R) -{ - double myR2 = _x*_x + _y*_y; - double myDot = _x*_cosCA + _y*_sinCA; - double dR2 = R*R-myR2; - double dis = myDot*myDot+dR2; - assert(_hz); - if (dis<0) dis = 0; - dis = sqrt(dis); - double dL = (dR2)/(dis+fabs(myDot)); - if (myDot<0) dL = -dL; - move(dL/getCosL()); -// assert(fabs(_x*_x+ _y*_y-R*R)/(2*R)<1e-2); -} - -//______________________________________________________________________________ -StvNodePars &StvNodePars::operator=(const StvNodePars& fr) -{ - if (&fr==this) return *this; - memcpy(this,&fr,sizeof(*this)); -assert(_hz); - return *this; -} -//______________________________________________________________________________ -const StvFitPars &StvNodePars::operator-(const StvNodePars& sub) const -{ -static StvFitPars fp; - - double cos2L = 1./(1+sub._tanl*sub._tanl); - double cosL = sqrt(cos2L); - double sinL = sub._tanl*cosL; - double dx = _x-sub._x; - double dy = _y-sub._y; - double dz = _z-sub._z; - - fp.mH = dx*( -sub._sinCA)+ dy*( sub._cosCA); - fp.mZ = dx*(-sinL*sub._cosCA)+ dy*(-sinL*sub._sinCA) +dz*cosL; - double a = (_psi -sub._psi ); - if (a < -M_PI) {a += M_PI*2;} - else if (a > M_PI) {a -= M_PI*2;} -assert(fabs(_psi) M_PI) _psi -= 2*M_PI; - assert(fabs(_psi)1e-5) ready(); - _ptin += fp.mP; - if (_ptin > kMaxPti) _ptin = kMaxPti; - if (_ptin < -kMaxPti) _ptin =-kMaxPti; - - double l = fp.mL,tL; - if (fabs(l) < 0.1) {tL = l*(1+l*l/3);} - else {tL = tan(l) ;} - _tanl = (_tanl+tL)/(1.-_tanl*tL); - - if (_tanl < -kMaxTanL) _tanl = -kMaxTanL; - if (_tanl > kMaxTanL) _tanl = kMaxTanL; - _curv = _hz *_ptin; - if (fabs( _cosCA)>1 || fabs( _sinCA)>1) ready(); - assert(!check("StvNodePars::operator+=") || 1); -} -//______________________________________________________________________________ -void StvNodePars::print() const -{ -static const char* tit[]={"cosCA","sinCA","X","Y","Z","Eta","Ptin","TanL","Curv",0}; - for (int i=-2;i1e-5) return 0; - if (fabs(_sinCA-sin(_psi))>1e-5) return 0; - if (fabs(_curv -_hz*_ptin)>1e-5) return 0; - return 1; -} -//_____________________________________________________________________________ -StvFitPars StvNodePars::delta() const -{ - double spaceR = 0.1+sqrt(_x*_x+_y*_y)/200; - double spaceZ = 0.1+fabs(_z)/200; - StvFitPars fp; - fp.mH = spaceR; fp.mZ = spaceZ; - fp.mA = fp.mL = 3.14/180*30; //ten degree - fp.mP = fabs(_ptin)*0.2; - if (fp.mP<0.1) fp.mP = 0.1; - return fp; -} -//_____________________________________________________________________________ -StvFitErrs StvNodePars::deltaErrs() const -{ - StvFitPars dlt = delta(); - StvFitErrs fe; - for (int i=0,li=0;i< 5;li+=++i) {fe[li+i] = kERRFACT*dlt[i]*dlt[i];} - fe.mHz = _hz; - return fe; -} -//_____________________________________________________________________________ -void StvFitErrs::Add(const StvELossTrak *el,const StvNodePars &pa, double len) -{ - if (!el) return; - - double fakLen = (len)? fabs(len/el->TotLen()):1.; - double p2 = pa.getP2(); - double e2 = p2+el->M()*el->M(); - double fakNrj = e2/p2*(pa._ptin*pa._ptin)/p2; - mAA+= el->GetTheta2() *fakLen; - mLL+= el->GetTheta2() *fakLen; - mHH+= el->GetOrt2() *fakLen; - mZZ+= el->GetOrt2() *fakLen; - mPP+= el->ELossErr2() *fakNrj *fakLen; - if (mHH<=0 || mHH>1e2 || mZZ<=0 || mZZ>1e2) Recov(); -} -//_____________________________________________________________________________ -double StvNodePars::diff(const StvNodePars &other) const -{ - StvFitPars fp = *this-other; - StvFitPars dlt = delta(); - double myMax=0; - for (int i=0;i<5;i++) { - double d = fabs(fp[i])/dlt[i]; - if (myMax _ptin - der[kHf][kPf]*=_hz; - der[kZf][kPf]*=_hz; - der[kAf][kPf]*=_hz; - - -} -//______________________________________________________________________________ -void StvNodePars::Deriv(double len, double dPdP0, StvFitDers &der) const -{ -// Update existing derivatives using energy loss info: -// len - new length -// dPdP0 - d(Ploss)/dP0 /len/ -// -// dP = dPdP0* dP0 -// d(Pt/cosL) = dPdP0* d(Pt0/cosL) -// dPt/cosL + Pt*sinL/cosL**2*dL = dPdP0* ( dPt0/cosL + Pt0*sinL/cosL**2*dL) - - - - double dPLossdP0 = -dPdP0*len; - double dPtidPti0 = dPLossdP0; - double dPtidLam0 =-dPLossdP0*_tanl*_ptin; - - der[kPf][kPf]+= dPtidPti0; // dPti/dRho ; - der[kPf][kLf]+= dPtidLam0; // dPti/dLam ; -} - -//______________________________________________________________________________ -//______________________________________________________________________________ -void StvHitErrs::rotate(double angle) -{ double t[2][2]; - t[0][0] = cos(angle); t[0][1] = -sin(angle); - t[1][0] = -t[0][1] ; t[1][1] = t[0][0]; - double r[3]; - TCL::trasat(t[0],&hXX,r,2,2); - TCL::ucopy(r,&hXX,3); -} - - -//______________________________________________________________________________ -//______________________________________________________________________________ -StvFitErrs::StvFitErrs(double hh,double hz,double zz) -{ - memset(this,0,sizeof(*this)); - mHH=hh;mHZ=hz;mZZ=zz;mHz = 3e33; - assert(&mPP-&mHH+1==15); -} -//______________________________________________________________________________ -double StvFitErrs::Sign() const {return EmxSign(5,Arr());} -//______________________________________________________________________________ -const StvFitErrs &StvFitErrs::operator*(const StvFitDers &how) const -{ -static StvFitErrs myFitErrs; - TCL::trasat(how[0],Arr(),myFitErrs.Arr(),5,5); - myFitErrs.mHz = mHz; - myFitErrs.Recov(); - assert(mHH>0); - assert(mZZ>0); - - return myFitErrs; -} -//______________________________________________________________________________ -StvFitErrs &StvFitErrs::operator=(const StvFitErrs &fr) -{ - assert(fr.mHH>0); - assert(fr.mZZ>0); - - if (&fr==this) return *this; - memcpy(this,&fr,sizeof(*this)); -assert(mHz); - return *this; -} -// //______________________________________________________________________________ -// void StvFitErrs::Reset(double hz) -// { -// memset(this,0,sizeof(*this)); -// mHH = kFitErrs[0]*kFitErrs[0]; -// mZZ = kFitErrs[1]*kFitErrs[1]; -// mAA = kFitErrs[2]*kFitErrs[2]; -// mLL = kFitErrs[3]*kFitErrs[3]; -// mPP = kFitErrs[4]*kFitErrs[4]; -// mHz = hz; -// } - -//______________________________________________________________________________ -void StvFitErrs::Set(const THelixTrack *he, double hz) -{ -mHz = hz;assert(hz); -const THEmx_t *emx = he->Emx(); -double cosL = he->GetCos(); -double sinL = he->GetSin(); -double rho = he->GetRho(); -//double dAdZ = -sinL*rho; - -mHH = emx->mHH; -mHZ = cosL*emx->mHZ; -mZZ = cosL*emx->mZZ*cosL; -mHA = cosL*emx->mHA + (-sinL*cosL*cosL*rho)*emx->mHZ; -mZA = (cosL*emx->mAZ + (-sinL*cosL*cosL*rho)*emx->mZZ)*cosL; -mAA = (cosL*emx->mAA + (-sinL*cosL*cosL*rho)*emx->mAZ)*cosL + (cosL*emx->mAZ + (-sinL*cosL*cosL*rho)*emx->mZZ)*(-sinL*cosL*cosL*rho); -mHL = emx->mHL; -mZL = emx->mZL*cosL; -mAL = emx->mAL*cosL + emx->mZL*(-sinL*cosL*cosL*rho); -mLL = emx->mLL; -mHP = (1/mHz)*emx->mHC; -mZP = (1/mHz)*emx->mCZ*cosL; -mAP = (1/mHz)*emx->mAC*cosL + (1/mHz)*emx->mCZ*(-sinL*cosL*cosL*rho); -mLP = (1/mHz)*emx->mCL; -mPP = (1/mHz)*emx->mCC*(1/mHz); - assert(mHH>0); - assert(mZZ>0); - - - Recov(); -} -//______________________________________________________________________________ -void StvFitErrs::Get(THelixTrack *he) const -{ - assert(mHz); - he->SetEmx(0); - THEmx_t *emx = he->Emx(); - double cosL = he->GetCos(); - double sinL = he->GetSin(); - double rho = he->GetRho(); - double dAdZeta = sinL*rho; - -emx->mHH = mHH; -emx->mHA = dAdZeta*mHZ + 1/cosL*mHA; -emx->mAA = dAdZeta*mZZ*dAdZeta + 2/cosL*(mZA*dAdZeta) + mAA/cosL/cosL; -emx->mHC = (mHz)*mHP; -emx->mAC = (mHz)*(mZP*dAdZeta + mAP/cosL); -emx->mCC = (mHz)*mPP*(mHz); -emx->mHZ = 1/cosL*mHZ; -emx->mAZ = 1/cosL*(mZZ*dAdZeta + mZA*1/cosL); -emx->mCZ = 1/cosL*mZP*(mHz); -emx->mZZ = 1/cosL*mZZ*1/cosL; -emx->mHL = mHL; -emx->mAL = mZL*dAdZeta + mAL*1/cosL; -emx->mCL = mLP*(mHz); -emx->mZL = mZL*1/cosL; -emx->mLL = mLL; - - -} -//_____________________________________________________________________________ -void StvFitErrs::Backward() -{ - mHA*=-1; mAP*=-1; mHZ*=-1; mZP*=-1; mAL*=-1; mZL*=-1; -} -//_____________________________________________________________________________ -int StvFitErrs::Check(const char *tit) const -{ - if (mHH+mZZ<=0) return 0; - ((StvFitErrs*)((void*)this))->Recov(); - int ierr=0; - double dia[5];const double *e=&mHH; - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=e[li+i]; -// if (dia[i]< 1e-8*kFitErrs[i]*kFitErrs[i]) {ierr = i+1; goto ERR;} - if (dia[i]> 1e+4*kFitErrs[i]*kFitErrs[i]) {ierr = i+6; goto ERR;} - for (int j=0;j=dia[i]*dia[j]){ierr = 100+10*i+j;goto ERR;} - } } - assert(mHz); - return 0; -ERR: if (!tit) return ierr; - printf("StvFitErrs::Check(%s)=%d\n",tit,ierr); - Print(); - return ierr; -} -//_____________________________________________________________________________ -double StvFitErrs::MaxCorr() const -{ - if (mHH+mZZ<=0) return 0; - double dia[5],maxCorr=0;const double *e=&mHH; - - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=e[li+i]; - for (int j=0;j=dia[i]*dia[j]) jerr++; - } } - if (jerr) { //Recovery - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j MAXFITPARS[i]+space) return i+1;}; - for (int i=2;i<4;i++) {if (fabs(Arr()[i]) > MAXFITPARS[i] ) return i+1;}; - - if (fabs(mP) > BIGFITPARS[4]+fabs(np._ptin)*BIGFITPART) return 4+1; - return 0; -} -//_____________________________________________________________________________ -int StvFitPars::Check(const char *tit) const -{ - int ifail = 0; - for (int i=0;i<5;i++) {if (fabs(Arr()[i]) > MAXFITPARS[i]){ifail=i+1;break;}}; - if (!ifail) return 0; - if (!tit || !tit[0]) return ifail; - TString ts(tit);ts +=" *** Check = "; ts+=ifail;ts +=" ***"; - Print(ts.Data()); - return 0; -} -//_____________________________________________________________________________ -void StvFitPars::Print(const char *tit) const -{ -static const char* Nams[]={"mH","mZ","mA","mL","mP",0}; - if (tit && tit[0]) printf("StvFitPars::Print(%s)\n",tit); - for (int i=0;Nams[i]; i++) {printf("%s=%g ",Nams[i],Arr()[i]);} - printf("\n"); -} -//_____________________________________________________________________________ - -//_____________________________________________________________________________ -/** - returns the node information - double x[6], : state, for a definition, in radial implementation - rad - radius at start (cm). See also comments - phi - azimuthal angle (in rad) - z - z-coord. (cm) - tanl - tan(dip) =pz/pt - psi - azimuthal angle of pT vector (in rads) - pti - signed invert Pt.// pti = curv/hz - double cc[15] : error matrix of the state "x" rad is fixed - code definition adopted here, where: - PhiPhi; - ZPhi ,ZZ; - TanlPhi ,TanlZ ,TanlTanl, - PhiPsi ,ZPsi ,TanlPsi , PsiPsi , - PhiPti ,ZPti ,TanlPti, PsiPti, PtiPti - -*/ -//_____________________________________________________________________________ -void StvNodePars::GetRadial(double radPar[6],double radErr[15],const StvFitErrs *fitErr) const -{ -//Remind StvFitPars: -//double mH; // direction perpendicular movement and Z -//double mZ; // Pseudo Z, direction perpendicular movement & H -//double mA; // Angle in XY. cos(A),sin(A),T moving direction -//double mL; // Angle lambda in Rxy/Z -//double mP; // 1/pt with curvature sign - - enum {jRad=0,jPhi,jZ,jTan,jPsi,jPti}; - enum {jRPhiRPhi=0 - ,jRPhiZ ,jZZ - ,jRPhiTan,jZTan,jTanTan - ,jRPhiPsi,jZPsi,jTanPsi,jPsiPsi - ,jRPhiPti,jZPti,jTanPti,jPsiPti,jPtiPti}; - double r2xy = _x*_x+_y*_y, rxy=sqrt(r2xy); - double cos2L = 1./(1+_tanl*_tanl); - double cosL = sqrt(cos2L); - double sinL = _tanl*cosL; - - radPar[jRad] = rxy; - radPar[jPhi] = atan2(_y,_x); - radPar[jZ ] = _z; - radPar[jTan] = _tanl; - radPar[jPsi] = _psi; - radPar[jPti] = _ptin; - if (!radErr) return; - - - double A[6][5]= -/* H Z A L P */ -/*--------------------------------------------------------*/ -/*x*/ {{ -_sinCA, -sinL*_cosCA, 0, 0, 0}, -/*y*/ { _cosCA, -sinL*_sinCA, 0, 0, 0}, -/*z*/ { 0, cosL, 0, 0, 0}, -/*A*/ { 0, 0, 1, 0, 0}, -/*L*/ { 0, 0, 0, 1, 0}, -/*P*/ { 0, 0, 0, 0, 1}}; - - double g[6][1]= - {{ cosL*_cosCA }, - { cosL*_sinCA }, - { sinL }, - { cosL*cosL*_curv}, - { 0 }, - { 0 }}; - - double myX[1][6] = {{_x,_y,0,0,0,0}}; - - TMatrixD MA(6,5,A[0]),Mg(6,1,g[0]),Mx(1,6,myX[0]); - double xg = -1./(Mx*Mg)[0][0]; - TMatrixD T1 = MA+(Mg*(Mx*MA))*xg; - -// -double dRad[5][6] = -/* x, y, z, A, L, P*/ -/*-----------------------------------------------------------*/ -/*jRPhi*/ {{- _y/rxy, _x/rxy, 0, 0, 0, 0} -/*jZ */ ,{ 0, 0, 1, 0, 0, 0} -/*jTan*/ ,{ 0, 0, 0, 0,1/cos2L, 0} -/*jPsi*/ ,{ 0, 0, 0, 1/cosL, 0, 0} -/*jPti*/ ,{ 0, 0, 0, 0, 0, 1}}; -/*-----------------------------------------------------------*/ - - TMatrixD T2=TMatrixD(5,6,dRad[0])*T1; - TCL::trasat(T2.GetMatrixArray(),fitErr->Arr(),radErr,5,5); - -} -//_____________________________________________________________________________ -void StvNodePars::GetPrimial(double radPar[6],double radErr[15],const StvFitErrs *fitErr) const -{ -/// This is GetRadial for primary track. Radial representation of errors -/// is senseless for primary. But our oldfashiond TPT format demanding it. -/// All space errors supposed to be zeros. - -//Remind StvFitPars: -//double mH; // direction perpendicular movement and Z -//double mZ; // Pseudo Z, direction perpendicular movement & H -//double mA; // Angle in XY. cos(A),sin(A),T moving direction -//double mL; // Angle lambda in Rxy/Z -//double mP; // 1/pt with curvature sign - - enum {jRad =0,jPhi ,jZ ,jTan,jPsi,jPti}; - - double r2xy = _x*_x+_y*_y, rxy=sqrt(r2xy); - double cos2L = 1./(1+_tanl*_tanl); - double cosL = sqrt(cos2L); - - radPar[jRad] = rxy; - radPar[jPhi] = atan2(_y,_x); - radPar[jZ ] = _z; - radPar[jTan] = _tanl; - radPar[jPsi] = _psi; - radPar[jPti] = _ptin; - if (!radErr) return; - -double T[5][5] = -/* H, Z, A, L, P*/ -/*----------------------------------------------------*/ -/*jRPhi*/ {{ 0, 0, 0, 0, 0} -/*jZ */ ,{ 0, 0, 0, 0, 0} -/*jTan*/ ,{ 0, 0, 0, 1/cos2L,0} -/*jPsi*/ ,{ 0, 0,1/cosL, 0, 0} -/*jPti*/ ,{ 0, 0, 0, 0, 1}}; -/*----------------------------------------------------*/ - - TCL::trasat(T[0],fitErr->Arr(),radErr,5,5); - -} -//______________________________________________________________________________ -const StvFitPars &StvFitPars::operator*(const StvFitDers &t) const -{ -static StvFitPars myPars; - TCL::vmatl(t[0],Arr(),myPars.Arr(),5,5); - return myPars; -} -//_____________________________________________________________________________ -void StvFitErrs::Get(const StvNodePars *np, StvNodeErrs *ne) const -{ - double cos2L = 1./(np->_tanl*np->_tanl+1); - double dTdL = 1./cos2L; - double cosL = sqrt(cos2L); - -// d/dH d/dZ d/dA d/dLam d/dPti - double T[6][5] = {{ np->_cosCA, 0, 0, 0, 0} //dX - ,{ np->_sinCA, 0, 0, 0, 0} //dY - ,{ 0, 1/cosL, 0, 0, 0} //dZ - ,{ 0, 0, 1, 0, 0} //dEta - ,{ 0, 0, 0, 0, 1} //dPti - ,{ 0, 0, 0, dTdL, 0}}; //dTan - - assert(0); - TCL::trasat(T[0],this->Arr(),*ne,5,6); - -} -//______________________________________________________________________________ -StvImpact::StvImpact() {memset(this,0,sizeof(*this));} - -//______________________________________________________________________________ -void StvImpact::Print(const char *opt) const -{ - if (!opt) opt = ""; - printf("StvImpact::Print(%s) ==\n",opt); - -static const char* tit[]={"Imp","Z ","Psi","Pti","Cur",0}; - const float* P=&mImp; - for (int i=0;i<5;i++) {printf("%s = %g, ",tit[i],P[i]);} - printf("\n"); - if (mImpImp<=0) return; - const float *e = &mImpImp; - for (int i=0,li=0;i< 5;li+=++i) { - printf("%s ",tit[i]); - for (int j=0;j<=i;j++) { - printf("%g\t",e[li+j]);} - printf("\n"); - } - - -} -#if 0 // -//____________________________________________________________ -double EmxSign(int n,const double *a) -{ - double ans=3e33; - double buf[55]; - double *B = (n<=10) ? buf : new double[n]; - double *b = B; - // trchlu.F -- translated by f2c (version 19970219). - // - //see original documentation of CERNLIB package F112 - - /* Local variables */ - int ipiv, kpiv, i__, j; - double r__, dc; - int id, kd; - double sum; - - - /* CERN PROGLIB# F112 TRCHLU .VERSION KERNFOR 4.16 870601 */ - /* ORIG. 18/12/74 W.HART */ - - - /* Parameter adjuTments */ - --b; --a; - - /* Function Body */ - ipiv = 0; - - i__ = 0; - - do { - ++i__; - ipiv += i__; - kpiv = ipiv; - r__ = a[ipiv]; - - for (j = i__; j <= n; ++j) { - sum = 0.; - if (i__ == 1) goto L40; - if (r__ == 0.) goto L42; - id = ipiv - i__ + 1; - kd = kpiv - i__ + 1; - - do { - sum += b[kd] * b[id]; - ++kd; ++id; - } while (id < ipiv); - -L40: - sum = a[kpiv] - sum; -L42: - if (j != i__) b[kpiv] = sum * r__; - else { - if (sum 0.) r__ = (double)1. / dc; - } - kpiv += j; - } - - } while (i__ < n); - -RETN: if (B!=buf) delete B; - return ans; -} /* trchlu_ */ -#endif //0 - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -#include "TRandom.h" -#include "TMatrixDSym.h" -#include "TMatrixD.h" -#include "TVectorD.h" -#include "TVector3.h" -#include "StarRoot/TRandomVector.h" -//_____________________________________________________________________________ -ClassImp(StvNodeParsTest); -void StvNodeParsTest::Test() -{ - double thPars[7+15],Hz=0.000299792458 * 4.98478; - for (int i=0;i<7+15;i++) {thPars[i]=gRandom->Rndm();} - THelixTrack th(thPars,thPars+3,thPars[6]),thh; - memcpy(thPars+3,th.Dir(),3*sizeof(double)); - th.SetEmx(thPars+7); - - StvNodePars pars; - StvFitErrs errs; - pars.set(&th,Hz); - errs.Set(&th,Hz); - pars.reverse(); - errs.Backward(); - pars.get(&thh); - errs.Get(&thh); - thh.Backward(); - - double thhPars[7+15]; - memcpy(thhPars,thh.Pos(),7*sizeof(double)); - memcpy(thhPars+7,thh.Emx()->Arr(),15*sizeof(double)); - int nerr=0; - for (int i=0;i<7+15;i++) { - if (fabs(thhPars[i]-thPars[i]) <1e-6) continue; - nerr++;printf("%d = %g %g \n",i,thPars[i],thhPars[i]);} - printf("nmErrs = %d\n",nerr); -} -//_____________________________________________________________________________ -void StvNodeParsTest::TestGetRadial(int nEv) -{ -StvFitErrs fE; - double f = 0.01; - TVectorD D(5); - D[0] = 1.0*1.0 *f; - D[1] = 2.0*2.0 *f; - D[2] = 0.03*0.03 *f; - D[3] = 0.04*0.04 *f; - D[4] = 0.07*0.07 *f; - TRandomVector RV(D); - - TMatrixD S(RV.GetMtx()); - S.Print(); - - double *e = &fE.mHH; - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - e[li+j]= S[i][j]; - } } - - - StvNodePars node; - node.reset(); - double myRad = 100; - double phi = gRandom->Rndm()*2*M_PI; - node._x = myRad*cos(phi); - node._y = myRad*sin(phi); - node._z = (gRandom->Rndm()-0.5)*200; - node._psi = phi + (gRandom->Rndm()-0.5); - node._tanl = gRandom->Rndm(); - node._ptin = (gRandom->Rndm()-0.5); - node._hz = 0.000299792458 * 4.98478; - node.ready(); - - double radPar[6],radErr[15]; - node.GetRadial(radPar,radErr,&fE); - TMatrixDSym SS(5); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - SS[i][j]=radErr[li+j]; SS[j][i]=radErr[li+j]; - } } - SS.Print(); - - double rE[15]={0}; - for (int ev=0;evqAmax) qAmax=dif; - } } - qA/=15; - printf("Quality %g < %g < 1\n",qA,qAmax); -} - -//_____________________________________________________________________________ -static void Add(THelixTrack &ht,const double add[5]) -{ -// add = H,A,C,Z,L - TVector3 pos(ht.Pos()),dir(ht.Dir()),ort(-dir[1],dir[0],0.); - ort = ort.Unit(); - double rho=ht.GetRho(); - pos+=ort*add[0]; pos[2]+=add[3]; - dir.SetMagThetaPhi(1.,dir.Theta()-add[4],dir.Phi()+add[1]); - double wk[7]={pos[0],pos[1],pos[2],dir[0],dir[1],dir[2],rho+add[2]}; - ht.Set(wk,wk+3,wk[6]); -} - - -//_____________________________________________________________________________ -void StvNodeParsTest::TestErrProp(int nEv) -{ - -StvNodePars iP,iPR,oP,oPR; -THelixTrack iH,iHR,oH,ht; -StvFitErrs iE,oE,oER; - -THEmx_t oHE,oHER; -double dia[5],*e,*er,*vtx; - iP._cosCA = 0.99999209770847208, iP._sinCA = 0.0039754899835676982, iP._x = 153.15599597873157, - iP._y = 61.139971243562862, iP._z = -165.47715347045698, iP._psi = 0.0039755004554277579, iP._ptin = 3.000133812200076, iP._tanl = 9, - iP._curv = 0.0044971007445879334, iP._hz = 0.0014989667215176954; - - iE.mHH = 0.008422599212098222, iE.mHZ = -0.0091916832962463078, iE.mZZ = 0.019038123366318632, iE.mHA = -0.00039625080910056564, - iE.mZA = 0.00027601715939822415, iE.mAA = 3.8654618686681686e-05, iE.mHL = 0.00029431818666556691, iE.mZL = -0.00060667408715620378, - iE.mAL = -1.2045956628097832e-05, iE.mLL = 2.6946791206097881e-05, iE.mHP = 0.013476203596402746, iE.mZP = -0.00058380596704562366, - iE.mAP = -0.0021487322180886877, iE.mLP = 0.00016358043963761329, iE.mPP = 0.17711658543201794, iE.mHz = 0.0014989667215176954; -#if 0 - iP._cosCA = 0.051522195951218416; iP._sinCA = -0.99867184876021664; iP._x = 56.80456301948584; - iP._y = -179.95090442478528; iP._z = 16.833129146428401; iP._psi = -1.5192513089402997; iP._ptin = -4.286089548109465; - iP._tanl = -0.71077992742240803; iP._curv = -0.0063779138641975935;iP._hz=(0.0014880496061989194); - iP.ready(); - - iE.mHH = 0.0025928369042255385; iE.mHZ = -4.9934860023454386e-11; iE.mZZ = 0.014598355970801268; iE.mHA = -0.00059887440419442305; - iE.mZA = 1.0958739205478152e-11; iE.mAA = 0.00026524379894739812; iE.mHL = 3.463001237863329e-12; iE.mZL = -0.0016525557966380938; - iE.mAL = 8.3669926017237923e-13; iE.mLL = 0.00041855110437868546; iE.mHP = 0.0043962440767417576; iE.mZP = -2.904206508909407e-11; - iE.mAP = -0.0041320793241820105; iE.mLP = -2.5031139398137018e-12; iE.mPP = 0.78568815092933286; iE.SetHz(0.0014880496061989194); -#endif - - oER*=0.; - oHER.Clear(); - -// Prepare error matrix for TRandomVector - TMatrixDSym S(5); - e = iE.Arr(); - for (int i=0,li=0;i< 5;li+=++i) {S[i][i] = e[li+i];} - TRandomVector::RandRotate(S); - - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++) { e[li+j] = S[i][j];}} -// - iE.Print("Input StvFitErrs"); - - iP.get(&iH); // nodePar => Helix - iE.Get(&iH); // fitErr => HelixErr - iE.Set(&iH,iP._hz); - iE.Print("Input StvFitErrs => THEmx_t => StvFitErrs"); - - - iH.Emx()->Print("Input Helix Errs"); - oH = iH; - double myDist = 33; - oH.Move(myDist); //Move helix to 100cm - oP.set(&oH,iP._hz); //helix100 => nodePar100 - oE.Set(&oH,iP._hz); //helixErr100 => fitErr100 - oE.Print("Output StvFitErrs"); - oH.Emx()->Print("Output Helix Errs"); - - vtx = oH.Pos(); - TVector3 Vtx(vtx); - TVector3 Dir(oH.Dir()); - TVector3 Nxy(-Dir[1],Dir[0],0.); Nxy = Nxy.Unit(); - -static int iHELIX=0; - -// Prepare error matrix for TRandomVector - e = (iHELIX) ? iH.Emx()->Arr() : iE.Arr(); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - S[i][j]=e[li+j]; S[j][i]=e[li+j]; - } } - TRandomVector RV(S); - -// Event loop - for (int ev=0;ev <= nEv;ev++) { - iPR = iP; - ht = iH; -// Randomize fit parameters - const TVectorD res = RV.Gaus(); - - if (iHELIX) { //Randomize helix directly - Add(ht,res.GetMatrixArray()); - } else { - StvFitPars fp(res.GetMatrixArray()); iPR+=fp; -// Create THelixTrack from StvNodePars - iPR.get(&ht); -// Set no error matrix to helix - ht.SetEmx(0); - } - -// // Change helix direction for fun -// ht.Backward(); -// Move random helix to DCA point of etalon vertex - double my100 = ht.Path(vtx); - assert(fabs(my100-myDist) <20); - ht.Move(my100); - oPR.set(&ht,iP._hz); - StvFitPars fp = (oPR-oP); - double *e = oER.Arr(); - double *d = fp.Arr(); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - e[li+j]+=d[i]*d[j]; - } } - double dS = ht.Path(vtx[0],vtx[1]); - ht.Move(dS); - double D[5]; - TVector3 VPos(ht.Pos()),VDir(ht.Dir()); - D[0] = (VPos-Vtx)*Nxy; - D[1] = VDir.DeltaPhi(Dir); - D[2] = ht.GetRho()-oH.GetRho(); - D[3] = VPos[2]-Vtx[2]; - D[4] = -(VDir.Theta()-Dir.Theta());// "-" due to theta)= Pi-Lambda - - e = oHER.Arr(); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - e[li+j]+=D[i]*D[j]; - } } - - - }//EndEvts - - oER *= (1./nEv); - oHER*= (1./nEv); - - printf("*** Check THelixTrack Error matrix ***\n"); - e = oH.Emx()->Arr(); - er = oHER.Arr(); - double qA=0,qAmax=0; - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=e[li+i]; - for (int j=0;j<=i;j++) { - double dif = (er[li+j]-e[li+j])/sqrt(dia[i]*dia[j]); - printf("(%d %d) \t%g = \t%g \t%g\n",i,j,er[li+j],e[li+j],dif); - dif = fabs(dif); - qA+= (dif); if (dif>qAmax) qAmax=dif; - } } - printf("Quality %g < %g < 1\n",qA,qAmax); - - - printf("*** Check StvFitErr Error matrix ***\n"); - e = oE.Arr(); - er = oER.Arr(); - qA=0;qAmax=0; - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=e[li+i]; - for (int j=0;j<=i;j++) { - double dif = (er[li+j]-e[li+j])/sqrt(dia[i]*dia[j]); - printf("(%d %d) \t%g = \t%g \t%g\n",i,j,er[li+j],e[li+j],dif); - dif = fabs(dif); - qA+= (dif); if (dif>qAmax) qAmax=dif; - } } - qA/=15; - printf("Quality %g < %g < 1\n",qA,qAmax); - -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -void StvNodeParsTest::TestMtx() -{ - double maxEps = 0,maxEpz = 0; - double hz = 0.0014880496061989194; - int nErr=0; - int iR =100 + gRandom->Rndm()*100; - int iAlf = 10 + gRandom->Rndm()*100; - int iLam = 10 + gRandom->Rndm()*100; - - double alf = iAlf/180.*M_PI; - double lam = iLam/180.*M_PI; - StvNodePars basePar,modiPar,baseEndPar,modiEndPar; - double Rho = 1./iR; - basePar._x=0.10; - basePar._y=0.20; - basePar._z=0.30; - basePar._psi=alf; - basePar._ptin=Rho/hz;; - basePar._tanl=tan(lam); - basePar._curv=Rho; - basePar._hz=hz; - basePar.ready(); - - THelixTrack baseHlx,modiHlx,baseEndHlx,modiEndHlx; - StvFitDers mtxStv,mtxZtv,mtxNum; - StvHlxDers mtxHlx; - basePar.get(&baseHlx); - double len = iR*1.5; - baseEndHlx = baseHlx; baseEndHlx.Move(len,mtxHlx); - baseEndPar.set(&baseEndHlx,hz); - baseEndPar.convert(mtxStv , mtxHlx); - baseEndPar.Deriv(len,mtxZtv); - double stpArr[]={0.1, 0.1, 3.14/180, 3.14/180, 0.1*basePar._ptin+1e-2}; - double fak=0.01; - memset(mtxNum[0],0,sizeof(mtxNum)); - for (int ip=0;ip<5; ip++) { //Loop thru input parameters - StvFitPars fp; fp.Arr()[ip]=stpArr[ip]*fak; - modiPar = basePar; - modiPar+= fp; - modiPar.get(&modiHlx); - modiEndHlx = modiHlx; - modiEndHlx.Move(len); - double myLen = modiEndHlx.Path(baseEndHlx.Pos()); - modiEndHlx.Move(myLen); - modiEndPar.set(&modiEndHlx,hz); - fp = modiEndPar-baseEndPar; - - for (int jp=0;jp<5;jp++) { - mtxNum[jp][ip] = fp.Arr()[jp]/(stpArr[ip]*fak); - } } - printf("TestMtx: Angle=%d Lam=%d \tRad=%d\n",iAlf,iLam,iR); - -static const char T[]="HZALP"; - for (int ip=0;ip<5; ip++) { //Loop thru input parameters - for (int jp=0;jp<5;jp++) { - double est = mtxNum[jp][ip]; - double ana = mtxStv[jp][ip]; - double unu = mtxZtv[jp][ip]; - double eps = 2*fabs(est-ana)/(stpArr[jp]/stpArr[ip]); - double epz = 2*fabs(est-unu)/(stpArr[jp]/stpArr[ip]); - if (eps>maxEps) maxEps=eps; - if (epz>maxEpz) maxEpz=epz; - - if (eps < 1e-3 && epz < 1e-3) continue; - nErr++; - printf(" m%c%c \t%g \t%g \t%g\n",T[jp],T[ip],ana,est,eps); - printf(" m%c%c \t%g \t%g \t%g\n",T[jp],T[ip],unu,est,epz); - } } - printf("TestMtx: %d errors maxEps=%g maxEpz=%g\n",nErr,maxEps,maxEpz); - -} - -//_____________________________________________________________________________ -// Some math for: -// -// (cL*cP) -// T = (cL*sP) -// (sL ) -// -// -// (-sP) -// P = ( cP) -// ( 0 ) -// -// -// -// (-sL*cP) -// L = (-sL*sP) -// ( cL ) -// -// -// dX = T*t + P*h + L*l -// -// -// (cP) -// D = (sP) -// (0 ) -// -// X0 = -imp*P -// dD = P*dPsi = P*(a/cL + rho*(cL*t -sL*l)) -// -// -// -// (Tk = T*s/cL + P*(-Imp+h+dFi0*s +rho*s*s/2) + L*l -// -// ACCOUNT ONLY 2D -// Tk = D*(s-sL*l) + P*(-Imp+h+dFi0*s+rho*s*s/2) -// dTk= D + P*(dFi0+rho*s) -// -// (Tk*dTk) = 0 -// -// Now keep only the biggest order of magnitude -// -// Tk = D*(s-sL*l) + P*(-Imp) -// dTk= D + P*(dFi0+rho*s) -// -// (s-sL*l)-Imp*(dFi0+rho*s)= 0 -// (1-Imp*rho)*s -sL*l -Imp*dFi0=0 -// s= (sL*l+Imp*dFi0)/(1-Imp*rho) -// dFi = dFi0 +rho*(sL*l+Imp*dFi0)/(1-Imp*rho) -// dFi = (dFi0*(1+rho*Imp) +rho*sL*l)/(1-rho*Imp) -// -// dFidFi0 = (1.)/(1-rho*Imp); -// dFidl = rho*sL/(1-rho*Imp); -// -// dFidA = (1+rho*Imp)/(1-rho*Imp) /cL -// -// dtdA = Imp/c2L/(1-Imp*rho) -// dtdl = tL/(1-Imp*rho) -// -// dZda = sL*dtdA; -// dZdl = sL*dtdl+cL; -// - -//_____________________________________________________________________________ -void StvNodePars::GetImpact(StvImpact *imp,const StvFitErrs *fe) const -{ - /// signed impact parameter; Signed in such a way that: - /// x = -impact*sin(Psi) - /// y = impact*cos(Psi) - imp->mImp = _x*(-_sinCA) + _y*(_cosCA); - double tst = _x*( _cosCA) + _y*(_sinCA); - assert(fabs(tst)<1e-5 || fabs(imp->mImp) > 1000*fabs(tst)); - imp->mZ = _z; - imp->mPsi = _psi; - imp->mPti = _ptin; - imp->mTan = _tanl; - imp->mCurv= _curv; - if (!fe) return; - - double c2L = 1./(1+_tanl*_tanl); - double cL = sqrt(c2L); - double sL = cL*_tanl; -// StvFitPars -// mH; direction perpendicular movement and Z -// mZ; Pseudo Z, direction perpendicular movement & H -// mA; Angle in XY. cos(A),sin(A),T moving direction -// mL; Angle lambda in Rxy/Z -// mP; 1/pt with curvature sign - -// Impacts -// float mImpImp; -// float mZImp, mZZ; -// float mPsiImp, mPsiZ, mPsiPsi; -// float mPtiImp, mPtiZ, mPtiPsi, mPtiPti; -// float mTanImp, mTanZ, mTanPsi, mTanPti, mTanTan; - -// t = tL*l + imp/cL/cL/(1-imp*rho)*a -// =========================== - - -double mImp = imp->mImp; -double nomMins = (1-mImp*_curv); -// d/dA -double dtda = mImp/nomMins /c2L; -double dpsida = 1/nomMins /cL; -double dZda = sL*dtda; -// d/dl -double dsdl = sL/nomMins; -double dPsidl = _curv*dsdl; -double dtdl = dsdl/cL; -double dZdl = sL*dtdl + cL; - - -double T[5][5]={ -/* h l A Lam Pti */ -/*------------------------------------*/ -/*Imp*/{ 1, 0, 0, 0, 0}, -/*Z */{ 0, dZdl, dZda, 0, 0}, -/*Psi*/{ 0,dPsidl, dpsida, 0, 0}, -/*Pti*/{ 0, 0, 0, 0, 1}, -/*Tan*/{ 0, 0, 0,1/c2L, 0}}; -/*-------------------------------------*/ - double qwe[15]; - TCL::trasat(T[0],fe->Arr(),qwe,5,5); - TCL::ucopy(qwe,&imp->mImpImp,15); -} -//_____________________________________________________________________________ -void StvNodeParsTest::TestImpact(int nEv) -{ - -StvNodePars iP,iPR,oP,oPR; -THelixTrack iH,iHR,oH,ht; - -THEmx_t oHE,oHER; -double dia[5],*e,qA,qAmax; -float *ef,*erf; - - iP._cosCA = 0.051522195951218416; iP._sinCA = -0.99867184876021664; iP._x = 56.80456301948584; - iP._y = -179.95090442478528; iP._z = 16.833129146428401; iP._psi = -1.5192513089402997; iP._ptin = -4.286089548109465; - iP._tanl = -0.71077992742240803; iP._curv = -0.0063779138641975935;iP._hz=(0.0014880496061989194); - iP.ready(); -StvFitErrs iE,oE,oER; - iE.mHH = 0.0025928369042255385; iE.mHZ = -4.9934860023454386e-11; iE.mZZ = 0.014598355970801268; iE.mHA = -0.00059887440419442305; - iE.mZA = 1.0958739205478152e-11; iE.mAA = 0.00026524379894739812; iE.mHL = 3.463001237863329e-12; iE.mZL = -0.0016525557966380938; - iE.mAL = 8.3669926017237923e-13; iE.mLL = 0.00041855110437868546; iE.mHP = 0.0043962440767417576; iE.mZP = -2.904206508909407e-11; - iE.mAP = -0.0041320793241820105; iE.mLP = -2.5031139398137018e-12; iE.mPP = 0.78568815092933286; iE.SetHz(0.0014880496061989194); - - - oER*=0.; - oHER.Clear(); - -// Prepare error matrix for TRandomVector - TMatrixDSym S(5); - e = iE.Arr(); - for (int i=0,li=0;i< 5;li+=++i) {S[i][i] = e[li+i];} - S*=0.01; -// Make huge correlations - TRandomVector::RandRotate(S); -// And put it back - for (int i=0,li=0;i< 5;li+=++i) {for (int j=0;j<=i;j++){e[li+j] = S[i][j];}} -// -// iE.Print("Input StvFitErrs"); - - iP.get(&iH); // nodePar => Helix - iE.Get(&iH); // fitErr => HelixErr - iE.Set(&iH,iP._hz); -// iE.Print("Input StvFitErrs => THEmx_t => StvFitErrs"); - - -// iH.Emx()->Print("Input Helix Errs"); - oH = iH; - double myDist = oH.Path(0.,0.); - oH.Move(myDist); //Move helix to 100cm - oP.set(&oH,iP._hz); //helix100 => nodePar100 - oE.Set(&oH,iP._hz); //helixErr100 => fitErr100 - oE.Print("Output StvFitErrs"); -// oH.Emx()->Print("Output Helix Errs"); - StvImpact oI,oIR; - oP.GetImpact(&oI,&oE); - oI.Print("Output StvImpact"); - - - -// Prepare error matrix for TRandomVector - e = iE.Arr(); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - S[i][j]=e[li+j]; S[j][i]=e[li+j]; - } } - TRandomVector RV(S); - -// Event loop - double oErr[15]={0}; - for (int ev=0;ev <= nEv;ev++) { - iPR = iP; - ht = iH; -// Randomize fit parameters - TVectorD res = RV.Gaus(); - StvFitPars fp(res.GetMatrixArray()); iPR+=fp; -// Create THelixTrack from StvNodePars - iPR.get(&ht); -// Set no error matrix to helix - ht.SetEmx(0); - - double my100 = ht.Path(0.,0.); - assert(fabs(my100-myDist)= M_PI) d[2]-=2*M_PI; -// float *ef = &oIR.mImpImp; - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { -// ef[li+j]+=d[i]*d[j]; - oErr[li+j]+=d[i]*d[j]; - } } - - my100 = ht.Path(oP.P); - ht.Move(my100); - oPR.set(&ht,iP._hz); - fp = oPR-oP; - const double *q = fp.Arr(); - e = oER.Arr(); - for (int i=0,li=0;i< 5;li+=++i) { - for (int j=0;j<=i;j++ ) { - e[li+j]+=q[i]*q[j]; - } } - }//EndEvts - TCL::vscale(oErr,(1./nEv),oErr,15); - TCL::ucopy (oErr,&oIR.mImpImp, 15); - oER*=(1./nEv); - - printf("*** Check StvFitErr matrix ***\n"); - - qA=0;qAmax=0; - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=oE[li+i]; - for (int j=0;j<=i;j++) { - double dif = (oER[li+j]-oE[li+j])/sqrt(dia[i]*dia[j]); - printf("(%d %d) \t%g = \t%g \t%g\n",i,j,oER[li+j],oE[li+j],dif); - dif = fabs(dif); - qA+= (dif); if (dif>qAmax) qAmax=dif; - } } - qA/=15; - printf("Quality %g < %g < 1\n",qA,qAmax); - - - printf("/n*** Check StvImpact Error matrix ***\n"); - ef = &oI.mImpImp; - erf = &oIR.mImpImp; - qA=0;qAmax=0; - for (int i=0,li=0;i< 5;li+=++i) { - dia[i]=ef[li+i]; - for (int j=0;j<=i;j++) { - double dif = (erf[li+j]-ef[li+j])/sqrt(dia[i]*dia[j]); - printf("(%d %d) \t%g = \t%g \t%g\n",i,j,erf[li+j],ef[li+j],dif); - dif = fabs(dif); - qA+= (dif); if (dif>qAmax) qAmax=dif; - } } - qA/=15; - printf("Quality %g < %g < 1\n",qA,qAmax); - -} -//_____________________________________________________________________________ -#include "TMatrixT.h" -#include "TMatrixTSym.h" -#include "TVectorT.h" -//_____________________________________________________________________________ -double StvFitErrs::EmxSign(int n,const float *e) -{ - enum {maxN =10,maxE = (maxN*maxN-maxN)/2+maxN}; - double d[maxE]; - assert(n>0 && n<=maxN); - TCL::ucopy(e,d,(n*(n+1))/2); - return EmxSign(n,d); -} -//_____________________________________________________________________________ -double StvFitErrs::EmxSign(int n,const double *e) -{ - TMatrixDSym S(n); - TVectorD coe(n); - for (int i=0,li=0;i< n;li+=++i) { - double qwe = e[li+i]; - if(qwe<=0) return qwe; - qwe = pow(2.,-int(log(qwe)/(2*log(2)))); - coe[i]=qwe; - for (int j=0;j<=i;j++ ) { - S[i][j]=e[li+j]*coe[i]*coe[j]; S[j][i]=S[i][j]; - } } - TMatrixD EigMtx(n,n); - TVectorD EigVal(n); - EigMtx = S.EigenVectors(EigVal); - - double ans = 3e33; - for (int i=0;i -#include -#include -#include -#include -#include -#include "THelixTrack.h" - -class StvNodePars; -class StvFitPars; -class StvFitErrs; -class StvImpact; -class StvELossTrak; - -//------------------------------------------------------------------------------ -typedef double Mtx55D_t[5][5]; -void Multiply(Mtx55D_t &res, const Mtx55D_t &A,const Mtx55D_t &B); -void Multiply(double res[5], const Mtx55D_t &A,const double B[5]); -inline void Copy(Mtx55D_t &to,const Mtx55D_t &fr){memcpy(to[0],fr[0],5*5*sizeof(to[0][0]));} - -//------------------------------------------------------------------------------ -class StvFitDers //Derivative matrix of StvFitPars -{ -public: -operator const Mtx55D_t &() const {return mMtx;}; -operator Mtx55D_t &() {return mMtx;}; -StvFitDers &operator=( const StvFitDers &fr) - {memcpy(mMtx[0],fr[0],sizeof(mMtx)); return *this;}; - void Reverse(); -protected: -Mtx55D_t mMtx; -}; -//------------------------------------------------------------------------------ -class StvHlxDers //Derivative matrix of THelixTrack -{ -public: -operator const Mtx55D_t &() const {return mMtx;}; -operator Mtx55D_t &() {return mMtx;}; -StvHlxDers &operator=( const StvFitDers &fr) - {memcpy(mMtx[0],fr[0],sizeof(mMtx)); return *this;}; -protected: -Mtx55D_t mMtx; -}; - -void Invert(Mtx55D_t &to,const Mtx55D_t &fr); -void Testik(const Mtx55D_t &tt); -double EmxSign(int n,const double *a); -double EmxSign(int n,const float *a); -//------------------------------------------------------------------------------ -class StvFitPars -{ -public: - StvFitPars():mH(0),mZ(0),mA(0),mL(0),mP(0){} - StvFitPars(double h,double z):mH(h),mZ(z),mA(0),mL(0),mP(0){} - StvFitPars(const double *arr) {memcpy(&mH,arr,5*sizeof(mH));} -const StvFitPars &operator*(const StvFitDers &t) const; - void Print(const char *tit=0) const; - int Check(const char *tit=0) const; - int TooBig(const StvNodePars &np) const; - double *Arr() {return &mH;} -const double *Arr() const {return &mH;} -operator const double *() const {return &mH;} -operator double *() {return &mH;} -StvFitPars &operator*=(double f) - {for(int i=0;i<5;i++){(*this)[i]*=f;} return *this;} - -public: -// Let (Dx,Dy,Dz) vector track direction -// It could be also represented: -// (cos(L)*cos(A),cos(L)*sin(A),sin(L)) - -// mH: movement along (-Dy ,Dx , 0) vector -// mZ: movement along (-Dx*Dz , -Dz*Dy, Dy*Dy+Dx*Dx) -// Or mH: along (-cos(A),sin(A),0) -// mZ: along (-sin(L)*cos(A),-sin(L)*sin(A), cos(L)) - -double mH; // direction perpendicular movement and Z -double mZ; // Pseudo Z, direction perpendicular movement & H -double mA; // Angle in XY. cos(A),sin(A),T moving direction -double mL; // Angle lambda in Rxy/Z -double mP; // 1/pt with curvature sign -}; - - -//------------------------------------------------------------------------------ -class StvNodePars { -public: - enum eNodePars {kNPars=5}; - StvNodePars() {reset();} - void reset(); - void ready(); - int isReady() const; - void set(const THelixTrack *ht, double Hz); -const double *pos() const {return &_x;} - double *pos() {return &_x;} - void get( THelixTrack *ht) const; -double getPt() const { return 1./(fabs(_ptin)+1e-6); } - void getMom(double p[3]) const; - void getDir(double d[3]) const; -double getP2() const; -double getP() const; -double getRxy() const; -double getCos2L() const {return 1./(1.+_tanl*_tanl);} -double getCosL() const; - void reverse(); - void Deriv(double len, StvFitDers &der) const; - void Deriv(double len,double dPdP0,StvFitDers &der) const; - int isValid() const {return (_hz && _cosCA);}; -/// convert THelixTrack derivativ matrix into StvFitPar one - void convert( StvFitDers &fitDer , const StvHlxDers &hlxDer) const; -// move point along helix - void move(double dLen); -double move(const double v[3],double dPP,int dir); -// move point along helix up to given radius in xy - void moveToR(double Rxy); -StvNodePars &merge(double wt,StvNodePars &other); -// typical variations of parametrs -StvFitPars delta() const; -StvFitErrs deltaErrs() const; -double diff(const StvNodePars &other) const; -double diff(const StvNodePars &other, const StvFitErrs &otherr) const; -double diff(const float hit[3]) const; - -operator const double *() const {return P;} -operator double *() {return P;} - int getCharge() const {return (_ptin > 0) ? -1 : 1;} - int check(const char *pri=0) const; -void operator+=(const StvFitPars &add); -StvNodePars &operator=(const StvNodePars &fr); -const StvFitPars &operator-(const StvNodePars& sub) const; -void print() const; - void GetRadial (double radPar[6],double *radErr=0,const StvFitErrs *fE=0) const; - void GetPrimial(double radPar[6],double *radErr=0,const StvFitErrs *fE=0) const; - void GetImpact(StvImpact *imp,const StvFitErrs *fE=0) const; - - enum {kX=0,kY,kZ,kPhi,kCurv,kTanL}; -public: - /// sine and cosine of cross angle - double _cosCA; - double _sinCA; - union{double P[1];double _x;}; - double _y; - double _z; - double _psi; - /// signed invert pt [sign = sign(-qB)] - double _ptin; - /// tangent of the track momentum dip angle - double _tanl; - /// signed curvature [sign = sign(-qB)] - double _curv; - /// Z component magnetic field in units Pt(Gev) = Hz * RCurv(cm) - double _hz; -}; -class StvNodeErrs { -public: -StvNodeErrs(){reset();assert(&_cTT-&_cXX+1==21);} -void reset() {memset(this,0,sizeof(StvNodeErrs));} -operator const double *() const { return &_cXX;} -operator double *() { return &_cXX;} -public: - double _cXX; - double _cYX,_cYY; - double _cZX,_cZY, _cZZ; - double _cEX,_cEY, _cEZ, _cEE; - double _cPX,_cPY, _cPZ, _cPE, _cPP; - double _cTX,_cTY, _cTZ, _cTE, _cTP, _cTT; -}; - -//------------------------------------------------------------------------------ -class StvFitErrs -{ -public: - enum eFitErrs {kNErrs=15}; - StvFitErrs(double hh=0,double hz=0,double zz=0); - StvFitErrs(const StvFitErrs &fr) {*this = fr;} - void Set(const THelixTrack *he,double hz); - void Get( THelixTrack *he) const; - void Get(const StvNodePars *np, StvNodeErrs *ne) const; -double GetHz() const ;//?? { return mHz ;} - void SetHz(double hz);//?? { mHz=hz ;} - const double *Arr() const { return &mHH;} - double *Arr() { return &mHH;} -operator const double *() const { return &mHH;} -operator double *() { return &mHH;} -StvFitErrs &operator=(const StvFitErrs &fr) ; -StvFitErrs &operator*=(double f) {for (int i=0;i mMats; -}; -//------------------------------------------------------------------------------ -class StvNodeParsTest -{ -public: -static void Test(); -static void TestGetRadial(int nEv=10000); -static void TestErrProp (int nEv=10000); -static void TestMtx (); -static void TestImpact (int nEv=10000) ; -ClassDef(StvNodeParsTest,0) -}; - -//------------------------------------------------------------------------------ -// StvNodePars::inlines -inline void StvNodePars::reset(){memset(this,0,sizeof(StvNodePars));} -//------------------------------------------------------------------------------ -inline void StvNodePars::ready(){_cosCA=cos(_psi);_sinCA=sin(_psi);_curv = _hz*_ptin;} -//------------------------------------------------------------------------------ -inline void StvNodePars::getMom(double p[3]) const -{ - double pt = 1./(fabs(_ptin)+1e-6); - p[0]=pt*_cosCA;p[1]=pt*_sinCA;p[2]=pt*_tanl; -} -//------------------------------------------------------------------------------ -inline double StvNodePars::getRxy() const -{ - return sqrt(_x*_x+_y*_y); -} -//------------------------------------------------------------------------------ -inline void StvNodePars::getDir(double d[3]) const -{ - double nor = sqrt(1.+_tanl*_tanl); - d[0]=_cosCA/nor;d[1]=_sinCA/nor;d[2]=_tanl/nor; -} -//------------------------------------------------------------------------------ -inline double StvNodePars::getP() const -{ - double t =_tanl*_tanl; - t = (t<0.01)? (1.+t*(0.5-t*0.125)) : sqrt(1.+t); - return t/(fabs(_ptin)+1e-12); -} - -//------------------------------------------------------------------------------ -inline double StvNodePars::getP2() const -{ return 1./(_ptin*_ptin+1e-12)*(1.+_tanl*_tanl);} - -//------------------------------------------------------------------------------ -inline void StvNodePars::reverse() -{ - _cosCA = -_cosCA; _sinCA=-_sinCA; _psi+= M_PI; - while (_psi> M_PI) {_psi-=2*M_PI;} - while (_psi<-M_PI) {_psi+=2*M_PI;} - _tanl = -_tanl ; _curv = -_curv ; _ptin = -_ptin; -} -//------------------------------------------------------------------------------ -inline double StvNodePars::getCosL() const -{ - double tt = _tanl*_tanl; - return (tt<0.1)? 1./(1. +tt*(0.5 - tt*0.25)) :1./sqrt(1+tt); -} - -#endif diff --git a/StRoot/StvUtil/StvPullEvent.cxx b/StRoot/StvUtil/StvPullEvent.cxx deleted file mode 100644 index fd131543d23..00000000000 --- a/StRoot/StvUtil/StvPullEvent.cxx +++ /dev/null @@ -1,201 +0,0 @@ -#include -#include -#include "StvPullEvent.h" -#include "RVersion.h" -#if ROOT_VERSION_CODE < 331013 -#include "TCL.h" -#else -#include "TCernLib.h" -#endif -#include "StEvent/StEnumerations.h" -#include "StvDebug.h" - -ClassImp(StvPullTrk) -ClassImp(StvPullHit) -ClassImp(StvPullEvent) - -//_____________________________________________________________________________ - StvPullEvent::StvPullEvent() - :mTrksG("StvPullTrk",100) - ,mTrksP("StvPullTrk",100) - ,mHitsG("StvPullHit",100) - ,mHitsP("StvPullHit",100) - ,mHitsR("StvPullHit",100) - { - mHitsG.SetOwner(0); mHitsP.SetOwner(0); mHitsR.SetOwner(0); - Clear(); - }; -//_____________________________________________________________________________ -void StvPullTrk::Clear(const char*) -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//_____________________________________________________________________________ -StvPullTrk::StvPullTrk() -{ - Clear(); -} -//_____________________________________________________________________________ -void StvPullTrk::Print(const char* option) const -{ - if (!option) option=""; - printf("StvPullTrk::Print(%s)\n",option); -} - - -//_____________________________________________________________________________ -void StvPullHit::Clear(const char*) -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//_____________________________________________________________________________ -StvPullHit::StvPullHit() -{ - Clear(); -} -//_____________________________________________________________________________ -void StvPullHit::Print(const char* option) const -{ - if (!option) option=""; - printf("StvPullHit::Print(%s)\n",option); - - printf("lYHit %g(%g)\tlZHit %g(%g) lLen=%g\n" - ,lYHit,lYHitErr - ,lZHit,lZHitErr,lLen); - - - printf("lYPul %g(%g)\tlZPul %g(%g)\n" - ,lYPul,lYPulErr - ,lZPul,lZPulErr); - - - printf("gRHit=%g \tgPHit %g(%g)\tgZHit %g(%g)\n" - ,gRHit - ,gPHit,gPHitErr - ,gZHit,gZHitErr); - - printf("gRFit=%g \tgPFit %g(%g)\tgZFit %g(%g)\n" - ,gRFit - ,gPFit,gPFitErr - ,gZFit,gZFitErr); - - printf("gPPul %g(%g)\tgZPul %g(%g)\n" - ,gPPul,gPPulErr - ,gZPul,gZPulErr); - - -} -//_____________________________________________________________________________ -int StvPullHit::TestIt() -{ - return 0; -} -//_____________________________________________________________________________ -void StvPullEvent::Add(StvPullHit &hit,int gloPrim) -{ - TClonesArray *hits = &mHitsG+gloPrim; - int iHit = hits->GetLast()+1; - StvPullHit *kHit = (StvPullHit*)hits->New(iHit); - *kHit = hit; - if (gloPrim) return; - if (!hit.mDetector) return; - int i = 4; - if (hit.mDetector==kTpcId) i=1; - if (hit.mDetector==kSvtId) i=2; - if (hit.mDetector==kSsdId) i=3; - if (hit.mDetector==kPxlId) i=4; - if (hit.mDetector==kIstId) i=5; - if (!i || i>3)return; - ++mNHits[i-1]; -} -//_____________________________________________________________________________ -void StvPullEvent::Add(StvPullTrk &trk,int gloPrim) -{ - TClonesArray *trks = &mTrksG+gloPrim; - int iTrk = trks->GetLast()+1; - StvPullTrk *kTrk = (StvPullTrk*)trks->New(iTrk); - *kTrk = trk; - assert(trk.mTrackNumber); - mNTrks[gloPrim]++; -} -//_____________________________________________________________________________ - -const int *StvPullEvent::GetNHits() const -{ - return mNHits; -} -//_____________________________________________________________________________ -void StvPullEvent::Clear(const char*) -{ - mHitsG.Clear();mHitsP.Clear();mHitsR.Clear(); - mTrksG.Clear();mTrksP.Clear(); - memset(mVtx,0,sizeof(mVtx)); - memset(mEtx,0,sizeof(mEtx)); - mRun=0; mEvt=0; - memset(mNTrks,0,sizeof(mNTrks)+sizeof(mNHits)); - -} - -//_____________________________________________________________________________ -void StvPullEvent::Finish() -{ -static int nCall=0; nCall++; - int iTkG=0,iTkP=0,iHiG=0,iHiP=0,idP=0,idG=0; - StvPullTrk* trkG=0,*trkP =0; - StvPullHit* hiG=0,*hiP =0; - int nHiG = mHitsG.GetLast()+1; - int nHiP = mHitsP.GetLast()+1; - for (iTkG=0;iTkGmTrackNumber; - idP=-1; trkP=0; - if (iTkPmTrackNumber; - } - int vertex = 0; - if (idG==idP) { //It is a primary - vertex = trkP->mVertex; - int nHits=0; - for(;iHiPmTrackNumber) break; - nHits++; - hiP->mTrackNumber=iTkG+1; - hiP->mVertex=vertex; - } - assert(nHits<=trkP->nAllHits); - trkP->mTrackNumber= iTkG+1; iTkP++; - }//end It is a primary - - int nHits=0; - for(;iHiGmTrackNumber) break; - nHits++; - hiG->mTrackNumber=iTkG+1; hiG->mVertex=vertex; - } - assert(nHits<=trkG->nAllHits); - trkG->mVertex = vertex; - trkG->mTrackNumber= iTkG+1; - } - -// for (iTkG=0;iTkGmVertex != mIVtx) continue; -// if (trkG->nAllHits < 15) continue; -// double ar[7]; -// ar[0] = cos(trkG->mPhi-trkG->mPsi); -// // assert(fabs(ar[0])<1e-3); -// ar[0] = trkG->mRxy*cos(trkG->mPhi); -// ar[1] = trkG->mRxy*sin(trkG->mPhi); -// ar[2] = trkG->mZ; -// ar[3] = cos(trkG->mDip)*cos(trkG->mPsi); -// ar[4] = cos(trkG->mDip)*sin(trkG->mPsi); -// ar[5] = sin(trkG->mDip); -// ar[6] = trkG->mCurv; -// double dca00 = (-ar[0]*ar[4]+ar[1]*ar[3])/cos(trkG->mDip); -// StvDebug::Count("PriDca00",dca00); -// } - - - -} - diff --git a/StRoot/StvUtil/StvPullEvent.h b/StRoot/StvUtil/StvPullEvent.h deleted file mode 100644 index ddb0a166ecf..00000000000 --- a/StRoot/StvUtil/StvPullEvent.h +++ /dev/null @@ -1,224 +0,0 @@ -/*! - * \class StvPullEvent - * \author Victor Perev, Jan 2006 - */ -/*************************************************************************** - * - * $Id: StvPullEvent.h,v 1.9 2016/12/28 16:49:11 perev Exp $ - * - * Author: Victor Perev, Jan 2006 - *************************************************************************** - * - * Description: - * - *************************************************************************** - * - * $Log: StvPullEvent.h,v $ - * Revision 1.9 2016/12/28 16:49:11 perev - * Global X,Y,Z for hit added - * - * Revision 1.8 2013/07/02 04:08:09 perev - * add dca00 to pull tree - * - * Revision 1.7 2013/03/08 03:42:55 perev - * Define empty Finish() - * - * Revision 1.6 2012/10/21 22:59:41 perev - * Add IdTruth into pulls - * - * Revision 1.5 2012/04/10 22:44:15 perev - * Chi2 for primary track + vertex added - * - * Revision 1.4 2011/08/19 16:27:06 perev - * track errors added - * - * Revision 1.3 2011/07/19 20:10:31 perev - * Dca00 added - * - * Revision 1.2 2011/04/03 20:53:54 perev - * Type of end tracking added - * - * Revision 1.1 2010/09/25 17:52:07 perev - * NewDir - * - * Revision 1.3 2010/08/01 00:13:19 perev - * Pull errors added - * - * Revision 1.2 2010/07/30 02:54:30 perev - * Length fr hit added - * - * Revision 1.1 2010/07/06 20:27:43 perev - * Alpha version of Stv (Star Tracker Virtual) - * - * Revision 1.7 2009/10/24 20:35:33 perev - * Remove redundante definition of StvPullEvent::~StvPullEvent() - * - * Revision 1.6 2009/10/18 22:02:12 perev - * Propagate primary info into globals(Finish()) - * - * Revision 1.5 2009/10/15 03:28:58 perev - * Add primary vertex number and charge(GVB) - * - * Revision 1.4 2007/10/16 20:56:00 fisyak - * Add pull entries for Pxl and Ist - * - * Revision 1.3 2006/12/19 19:44:41 perev - * tracks added - * - * Revision 1.2 2006/12/18 01:33:35 perev - * + branch mHitsR(nd) +nHitCand +iHitCand - * - * Revision 1.1 2006/04/07 17:34:41 perev - * StvPullEvent class added - * - * Revision 1.1 2006/02/14 19:02:09 perev - * Svt self alignment maker - * - * - **************************************************************************/ -#ifndef StvPullEvent_hh -#define StvPullEvent_hh -#include "TObject.h" -#include "TClonesArray.h" -#include "TDatime.h" - - -class StvPullTrk : public TObject { -public: - StvPullTrk(); - ~StvPullTrk(){} - void Finish(){;} - void Clear(const char *opt = ""); - void Print(const char* option = "") const; -public: -char mBeg[1]; -short mTrackNumber; //track number -unsigned char mVertex; //vertex number for primary track -unsigned char nAllHits; //number of all hits in track -unsigned char nTpcHits; //number of tpc hits in track -unsigned char nFtpcHits; //number of tpc hits in track -unsigned char nSsdHits; //number of ssd hits in track -unsigned char nRndHits; //number of RND hits in track -unsigned char mL; //Length of track -unsigned char mTypeEnd; //Type of end tracking - -float mChi2; -float mChi2P; -float mCurv; //curvature -float mPt; //pt -float mPsi; //track Psi(around beam) in global Stv frame -float mDip; //track Dip in global Stv frame -float mRxy; //Rxy of track begining -float mPhi; //Phi angle of track begining -float mZ; -float mDca00; -// Errors -float mPtErr; //pt error -float mPsiErr; //track Psi error -float mDipErr; //track Dip error -float mRxyErr; //Rxy error -float mZErr; //z error -short int mIdTruTk; -short int mQaTruTk; -char mEnd[1]; - ClassDef(StvPullTrk,4); -}; - -class StvPullHit : public TObject { -public: - StvPullHit(); - ~StvPullHit(){} - void Clear(const char *opt = ""); - void Print(const char* option = "") const; -int TestIt(); -public: -char mBeg[1]; //! No IO -short mTrackNumber; //track number of hit -unsigned char mVertex; //vertex number for primary track -unsigned char nAllHits; //number of all hits in track -unsigned char nTpcHits; //number of tpc hits in track -unsigned char nFtpcHits; //number of ftpc hits in track -unsigned char nSsdHits; //number of ssd hits in track -unsigned char nRndHits; //number of RND hits in track -unsigned char mDetector; //see StHit.h - // 0=smallest Xi2 - - -float mChi2; -float mCurv; //curvature -float mPt; //pt -float mCharge; //charge (Q) -float mX; //global X -float mY; //global Y -float mZ; //global Z -// locals -// local Stv frame is a StvTrtack frame -float lYHit; // y of Hit in local Stv frame -float lZHit; // z of Hit in local Stv frame -float lYHitErr; // y Hit Err in local Stv frame -float lZHitErr; // z Hit Err in local Stv frame -float lLen; // length of Hit - -float lYPul; // lYHit/lYHitErr -float lZPul; // lZHit/lZHitErr -float lYPulErr; // y pull Err in local Stv frame -float lZPulErr; // z pull Err in local Stv frame - -// Globals -float gPhiHP; // phi of normal vector of hit plane in global Stv frame -float gLamHP; // lambda of normal vector of hit plane in global Stv frame -float gRHit; // Rxy of Hit in global Stv frame -float gPHit; // Phi of Hit in global Stv frame -float gZHit; // Z of Hit in global Stv frame -float gPHitErr; // Phi Hit err in global Stv frame -float gZHitErr; // Z Hit err in global Stv frame - -float gRFit; // Rxy of Fit in global Stv frame -float gPFit; // Phi of Fit in global Stv frame -float gZFit; // Z of Fit in global Stv frame -float gPFitErr; // Phi Fit err in global Stv frame -float gZFitErr; // Z Fit err in global Stv frame - -float gPPul; // dPhi*Rxy of Pul in global Stv frame -float gZPul; // dZ of Pul in global Stv frame -float gPPulErr; // dPhi Pul err in global Stv frame -float gZPulErr; // dZ Pul err in global Stv frame - -float gPsi; // track Psi in global Stv frame -float gDip; // track Dip in global Stv frame -short int mIdTruth; -short int mQaTruth; -char mEnd[1]; //!No IO - ClassDef(StvPullHit,2); -}; - -class StvPullEvent : public TObject { -public: - StvPullEvent(); -void Clear(const char *opt = ""); -void Finish(); -void Add(StvPullHit &ph,int gloPrim); -void Add(StvPullTrk &pt,int gloPrim=0); -const int *GetNHits() const; -public: - int mRun; - int mEvt; - TDatime mDate; //DAQ time (GMT) - - int mIVtx; //Primary vertex id - float mVtx[3]; //Primary vertex position in global frame - float mEtx[6]; //errors xx,yx,yy,zx,zy,zz - float mChi2; //Chi square of vertex fit - int mNTrks[2]; //N glob,N Prim tracks - int mNHits[6]; //nTpc,nSvt,nSsd,nPxl,nIst,nRnd hits - -TClonesArray mTrksG; //global tracks -TClonesArray mTrksP; //primary tracks -TClonesArray mHitsG; //StvPullHits for global tracks -TClonesArray mHitsP; //StvPullHits for primary tracks -TClonesArray mHitsR; //StvPullHits for Rnd detectors - ClassDef(StvPullEvent,5); -}; - - -#endif diff --git a/StRoot/macros/calib/StvFitErr.C b/StRoot/macros/calib/StvFitErr.C deleted file mode 100644 index d4367a425f0..00000000000 --- a/StRoot/macros/calib/StvFitErr.C +++ /dev/null @@ -1,1876 +0,0 @@ -#include -#include -#include -#include "TSystem.h" -#include "TMath.h" -#include "TFile.h" -#include "TTree.h" -#include "TH1.h" -#include "TF1.h" -#include "TMath.h" -#include "TCanvas.h" -#include "TGraph.h" -#include "TCernLib.h" -#include "TMatrixD.h" -#include "TRandom.h" -#include "TVectorD.h" -#include "TVector2.h" -#include "TVector3.h" -#include "TTreeIter.h" -#include "TTable.h" -#include "TInterpreter.h" -#include "TMinuit.h" -#include "StvUtil/StvHitErrCalculator.h" -#include "TPolinom.h" -#include -//#define APPROX -static const double kWeight = 0.99; //pars = oldPars*(1-kWeight) + newPars*kWeight -static int testOnly=0; -enum {kMinNodes = 10,kMinHits=25}; -static const double kMaxDY=0.5,kMaxDZ=0.5,kErrFak=1.,kMaxCur=1./200,kPMin=0.5; -static const int gScale = 0; -static const double kUppPar=22,kLowPar=1e-8; - -//______________________________________________________________________________ -class FEEvent; -class FEFcn; -class StvHitErrCalculator; -class StvTpcHitErrCalculator; -int StvFitErr(const char *file="pulls.root"); -int MyTest(); -#if !defined(__MAKECINT__) -enum {kMaxPars = StvHitErrCalculator::kMaxPars}; -TMatrixD T(TMatrixD a) { TMatrixD mx(a); return mx.T();} - - -//______________________________________________________________________________ -class FERead : public TNamed -{ -public: -FERead(const char *file); -FEEvent *ReadEvent(); -private: -TTreeIter *mTreeIter; -FEEvent *mEvent; -}; - -//______________________________________________________________________________ -class Poli2 { -public: -Poli2(int npw,double reg); -Poli2(int npw,int n,const double *X,const double *Y,const double *W); -void SetReg(double reg) {fReg = reg;} -double Fit(); -void Clear(); -void Add(double x, double y, double w); -double Xi2() const {return fXi2;} -double LiH() const {return fXi2+fLiH+fKor;} -double dKordW() const {return fdKor;} -double Xi2(int ipt) const; -double Res(int ipt) const; -double Kor() const {return fKor;} -double Kor(int ipt) const; -double dKordW(int ipt) const; -double EvalXi2() const; -int Pw() const {return fPw ;} -int NPt() const {return fN ;} -double Fun( double x ) const; -double FunErr2( double x ) const; -double Pull( double x ,double y,double yErr2) const; -double dXi2dW( int ipt ) const; -double d2Xi2dW( int k, int l ) const; -double dLiHdW( int ipt ) const; -double d2LiHdW( int kpt ,int lpt) const; -double Deriv( TVectorD &Di ) const; -double D2riv( TMatrixD &Dik) const; -void TestIt() const; -void MyTest() const; -static void Test(); -static void Test2(); -static void TestErr(); -private: -static double F(double T) { return TMath::Erf(T)/M_2_SQRTPIl;} -private: -int fPw; -char fBeg[1]; -int fN; -double fReg,fKor,fdKor; -double fX[100]; -double fY[100]; -double fW[100]; -double fXi2; -double fLiH; -double fX0,fY0; -char fEnd[1]; -TVectorD fP; -TVectorD fB; -TMatrixD fA; -TMatrixD fAi; -}; - - -//______________________________________________________________________________ -class FEEvent -{ -public: - FEEvent(TTreeIter &th); - int NextTrack(int &jr); - void Reset() {mLTrack=0;mRTrack=-1;} -public: -int mLTrack,mRTrack; -const int &run; -const int &evt; -const int &nGHits; -const float *&mCurv; -const float *&mChi2; -const float *&mPt; -const short *&mTrackNumber; -const unsigned char *&nAllHits; //number of all hits in track -const unsigned char *&nTpcHits; //number of tpc hits in track -const unsigned char *&nFtpcHits; //number of ftpc hits in track -const unsigned char *&nSsdHits; //number of ssd hits in track -const unsigned char *&nRndHits; //number of RND hits in track -const unsigned char *&mDetector; -const float *&lYHit; -const float *&lZHit; -const float *&lLen; -const float *&gPhiHP; // phi of normal vector of hit plane in global Stv frame -const float *&gLamHP; // lambda of normal vector of hit plane in global Stv frame -const float *&gPsi; -const float *&gDip; -const float *&gRFit; -const float *&gPFit; -const float *&gZFit; -}; -//______________________________________________________________________________ -class FECalcHolder -{ -public: - FECalcHolder(); - FECalcHolder(int id,StvHitErrCalculator* calc,const double miMax[2][2]); - StvHitErrCalculator *GetCalc() const {return mCalc;} -virtual StvHitErrCalculator *GetCalc(const float x[3]) {if(x){};return mCalc;} -virtual int FixPars(FEFcn * /*fcn*/) {return 0;} - int GetId() {return mId;} - void SetOffset(int off) {mOffset=off;} - int GetOffset() const {return mOffset;} - int GetNPars() const {return mCalc->GetNPars();} -const double *GetPars() const {return mCalc->GetPars() ;} -const char *GetName() const {return mCalc->GetName() ;} - void Update(const double *a); - void DbLoad(); - void DbSave(); - void Scale(double fak); - - void AvInit(); - void AvAdd(const double hRR[3],double yXi2,double zXi2); - void AvEnd(); - -private: -char mBeg[1]; -TTable *mTab; -int mId; -int mOffset; -public: -double mAve[10]; -double mAveDer[kMaxPars][3]; -double mMiMax[2][2]; -StvHitErrCalculator* mCalc; -char mEnd[1]; -}; - -//______________________________________________________________________________ -class FETpcCalcHolder: public FECalcHolder -{ -public: - FETpcCalcHolder(StvHitErrCalculator* calc,const double miMax[2][2]) - :FECalcHolder(1,calc,miMax){;} -virtual StvHitErrCalculator *GetCalc(const float x[3]); -virtual int FixPars(FEFcn *fcn); -}; -//______________________________________________________________________________ -class FETstCalcHolder: public FECalcHolder -{ -public: - FETstCalcHolder(); -}; - -//______________________________________________________________________________ -class FENode -{ -public: -float tkDir[3]; -float hiPos[3]; -float hiDir[3][3]; -float s; -float yz[2]; -float detId; -}; -typedef std::vector FENodes; - -//______________________________________________________________________________ -class FETrak -{ -public: -void Add(const FENode &node) {mNodes.push_back(node);} -int NNodes() const {return mNodes.size(); } -const FENodes &Nodes() {return mNodes; } -private: -FENodes mNodes; -}; -typedef std::vector FETraks; -//______________________________________________________________________________ -class FEFcn -{ -public: - FEFcn(); - void Clear(); - void Add(FECalcHolder *holder); - void Add(); - void DbLoad(); - void DbSave(); - int Add(FEEvent *event); - - void InitFitter(); - int GetNPars() const {return mNPars;} -double* GetPars() {return mPars ;} - int GetIPar(const char* name) const; - int GetNFixd() const {return mNFixd;} - void Update(const double *upd); - void Synchro(char from,const double *par=0); - void Approx(int nonBias); -FECalcHolder *GetCalc(int id,const float hiPos[3]); - void Eval(int npar, double* grad, double& fval, double* par, int flag); - void FixPar(int iPar,int fix=1); - int FixPars(); - int IsFixed(int iPar) const {return mFix[iPar];} - int Fit(); - void AvErr(const char *tit); - int IsEnded() const; -static void Fcn(int &npar, double* grad, double& fval, double* par, int flag); - - -private: -char mFix[400]; -int mNPars; -int mNFixd; -int mNEvs; -int mNTks; -int mNHits; -int mNCall; -double mPars[100]; -double mFist[100]; -double mVal00; -double mVal99; -double mXi2[3]; -double mRes[4]; - -char mEnd[1]; -TString mNams[100]; -std::vector mCas; -FETraks mTks; -static FEFcn *mgInst; -}; -#ifdef APPROX -//______________________________________________________________________________ -class FEApprox -{ -public: - FEApprox(FEFcn *fefcn); -int Prepare(); -int Quadr(); -int Approx(); -int Test(); -private: -FEFcn *mFcn; -int mNPars; -TMatrixD mG,mGi,mC; -TVectorD mB,mP,mPrev,mClo,mIclo,mCup,mIcup; -TVectorD mXlo,mIxlo,mXup,mIxup; -double mXi2; -}; -#endif //APPROX - - -FEFcn *FEFcn::mgInst=0; - -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -void CalcInit(); -FEFcn myFcn; -TMinuit myFitter(100); -//______________________________________________________________________________ -int MyTest() -{ - Poli2::Test(); - Poli2::TestErr(); - return 0; -} -//______________________________________________________________________________ -int StvFitErr(const char *file) -{ - testOnly = strcmp(file,"test")==0; - printf("StvFitErr(%s) started",file); - - CalcInit(); - myFcn.DbLoad(); - myFcn.InitFitter(); - - int nEv=0; - FEEvent *ev=0; - int eot=0; - if (!testOnly) { - FERead input(file); - while ((ev=input.ReadEvent())) - { - // printf ("Event %d\n",nEv); - nEv++; eot = myFcn.Add(ev); - if (eot) break; - } - printf ("StvFitErr: %d Events used\n",nEv); - #ifdef APPROX - FEApprox app(&myFcn); - #endif - } else { -// TestOnly - myFcn.Add(); - } - myFcn.AvErr("Before Fit"); - int ans =0; - ans = myFcn.Fit(); - myFcn.AvErr("After Fit"); - myFcn.DbSave(); - return (myFcn.IsEnded())? 99:0; -} -//______________________________________________________________________________ -void CalcInit() -{ - const char* innOutNames[4] ={"StvTpcInnerHitErrsFE" ,"StvTpcOuterHitErrsFE" - ,"StvTpcInnerPromptErrsFE" ,"StvTpcOuterPromptErrsFE" }; -// const double innOutPars[2][6]={{0.047,0.107,5e-5,1./12,0.0011, 0.0012} -// ,{0.035,0.077,5e-5,1./12,0.0011, 0.0012}}; - double TpcMiMax[2][2]={{0.05,0.2},{0.05,0.2}}; - - - myFcn.Clear(); - if (testOnly) { - FECalcHolder *hold= new FETstCalcHolder(); - myFcn.Add(hold); - return; - } - - for (int io=0;io<4;io++) { - StvHitErrCalculator *hec = (io<2) ? new StvTpcHitErrCalculator(innOutNames[io]) - : new StvHitErrCalculator (innOutNames[io]); - FECalcHolder *hold= new FETpcCalcHolder(hec,TpcMiMax); - myFcn.Add(hold); - } -} -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ - - -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -Poli2::Poli2(int npw,double reg):fP(npw+1),fB(npw+1),fA(npw+1,npw+1),fAi(npw+1,npw+1) -{ - fPw = npw; - Clear(); - fReg = reg; -} -//______________________________________________________________________________ -void Poli2::Clear() -{ - memset(fBeg,0,fEnd-fBeg+1); -} -//______________________________________________________________________________ -Poli2::Poli2(int npw,int N,const double *X,const double *Y,const double *W) -:fP(npw+1),fB(npw+1),fA(npw+1,npw+1),fAi(npw+1,npw+1) -{ - fPw = npw; - Clear(); - fN = N; - int nb = N*sizeof(double); - memcpy(fX,X,nb); - memcpy(fY,Y,nb); - memcpy(fW,W,nb); -} -//______________________________________________________________________________ -void Poli2::Add(double x, double y, double w) -{ - fX[fN]=x; fY[fN]=y, fW[fN]=w; fN++; - assert(fN<=100); -} -//______________________________________________________________________________ -double Poli2::Fit() -{ - double Wt=0,Wx=0,Wy=0; - for (int i=0;iGaus(0,sqrt(1./W[i])); - } - Poli2 pp(npw,20,X,Y,W); - pp.Fit(); -// pp.MyTest(); - double Xi2 = pp.Xi2(); - double Xi2Eva = pp.EvalXi2(); if ( Xi2Eva) {}; - printf ("Xi2 = %g Fun(10)= %g\n",Xi2,pp.Fun(10.)); - - TPoliFitter pf(2); - for (int i=0;i<20;i++) { pf.Add(X[i],Y[i],1./W[i]);} - Xi2 =pf.Fit()*(20-3); - printf ("Xi2 = %g Fun(10)= %g\n",Xi2,pf.Eval(10.)); - - -// for (int i=0; i<20; i++) { -// printf(" %g %g : %g\n",X[i],YY[i],pp.Fun(X[i])); -// } -// check d/dW - printf("\n check d/dWi\n"); - double myDelta = 1e-3,delta,maxDif=0; - for (int k=0;k<20;k++) { - Poli2 ppp(npw,0); - for (int i=0;i<20;i++) { - double w = W[i]; - if (i==k) { delta = w*myDelta; w+=delta;} - ppp.Add(X[i],Y[i],w); - } - ppp.Fit(); - double ana = pp.dXi2dW(k); - double num = (ppp.Xi2()-pp.Xi2())/delta; - double dif = 2*(num-ana)/(fabs(num+ana)+3e-33); - if (maxDifGaus(0,sqrt(1./W[i])); - } - Poli2 pp(npw,20,X,Y,W); - pp.Fit(); -// pp.MyTest(); - TVectorD myDer(20),nyDer(20); - pp.Deriv(myDer); - printf("\n check d/dWi\n"); - double myDelta = 1e-3,delta,maxDif=0; - for (int k=0;k<20;k++) { - Poli2 ppp(npw,0); - for (int i=0;i<20;i++) { - double w = W[i]; - if (i==k) { delta = w*myDelta; w+=delta;} - ppp.Add(X[i],Y[i],w); - } - ppp.Fit(); - ppp.Deriv(nyDer); - for (int l=0;l<=k; l++) { - - double ana = 0.5*(pp.d2Xi2dW(k,l)+ppp.d2Xi2dW(k,l)); - double num = (nyDer(l)-myDer(l))/delta; - double dif = 2*(num-ana)/(fabs(num+ana)+3e-33); - if (fabs(dif)> maxDif) maxDif =fabs(dif); - if (fabs(dif)<1e-3) continue; - printf ("d2Xi2dW(%2d,%2d) \tana=%g \tnum = %g \tdif=%g\n",k,l,ana,num,dif); - } - } - printf ("Test2 d2Xi2dW(...) maxDif=%g\n",maxDif); - - -} -//______________________________________________________________________________ -void Poli2::TestIt() const -{ - TVectorD g,gT; - Poli2 pp(*this); - pp.Fit(); - double Xi2 = pp.Deriv(g); - - double delta = 1e-3; - for (int k=0;k0.01) - printf ("\ndXi2dW(%2d) \tana=%g \tnum = %g \tdif=%g\n\n",k,ana,num,dif); - } - - -} -//______________________________________________________________________________ -void Poli2::TestErr() -{ - double A[3]={3,0.02,0.05}; - - int npw=2; - double X[20],Y[20],W[20],YY[20]; - for (int i=0;i<20;i++) { - X[i]=i; - YY[i]= A[0]+X[i]*(A[1]+A[2]*X[i]); - W[i]= 1+10./YY[i]; - } - int nEv=10000,nTot=0; - double av=0,rms=0; - for (int iev=0;ievGaus(YY[i],sqrt(1./W[i])); - } - Poli2 pp(npw,20,X,Y,W); - pp.Fit(); - for (int ix=0;ix<20;ix++) { - double delta = (pp.Fun(X[ix])-YY[ix])/sqrt(pp.FunErr2(X[ix])); - av+=delta;rms+=delta*delta;nTot++; - } - } - av/=nTot; rms/=nTot; rms=sqrt(rms); - - - printf ("TestErr Av=%g Rms=%g\n",av,rms); -} -//______________________________________________________________________________ -void poli2() -{ -Poli2::Test(); -Poli2::Test2(); -Poli2::TestErr(); -} - -//______________________________________________________________________________ -FEEvent::FEEvent(TTreeIter &th): - run ( th("mRun")), - evt ( th("mEvt")), - nGHits ( th("mHitsG")), - mCurv ( th("mHitsG.mCurv")), - mChi2 ( th("mHitsG.mChi2")), - mPt ( th("mHitsG.mPt")), - mTrackNumber ( th("mHitsG.mTrackNumber")), - nAllHits ( th("mHitsG.nAllHits")), - nTpcHits ( th("mHitsG.nTpcHits")), - nFtpcHits ( th("mHitsG.nFtpcHits")), - nSsdHits ( th("mHitsG.nSsdHits")), - nRndHits ( th("mHitsG.nRndHits")), - mDetector ( th("mHitsG.mDetector")), - lYHit ( th("mHitsG.lYHit")), - lZHit ( th("mHitsG.lZHit")), - lLen ( th("mHitsG.lLen")), - gPhiHP ( th("mHitsG.gPhiHP")), - gLamHP ( th("mHitsG.gLamHP")), - gPsi ( th("mHitsG.gPsi")), - gDip ( th("mHitsG.gDip")), - gRFit ( th("mHitsG.gRFit")), - gPFit ( th("mHitsG.gPFit")), - gZFit ( th("mHitsG.gZFit")) -{ - mLTrack=0;mRTrack=-1; - -} -//______________________________________________________________________________ -int FEEvent::NextTrack(int &jr) -{ - mLTrack = mRTrack+1; - if (mLTrack>=nGHits) { jr=-1; return -1;} - mRTrack=mLTrack; - int tkNum= mTrackNumber[mLTrack]; - for (int j=mLTrack+1; jAddFile(file); - mEvent = new FEEvent(*mTreeIter); -} -//______________________________________________________________________________ -FEEvent* FERead::ReadEvent() -{ - mEvent->Reset(); - int nbytes = mTreeIter->Next(); - if (!nbytes) return 0; - return mEvent; -} - -//______________________________________________________________________________ -FECalcHolder::FECalcHolder(int id,StvHitErrCalculator* calc - ,const double miMax[2][2]) -{ - memset(mBeg,0,mEnd-mBeg+1); - mId=id; mCalc=calc; - memcpy(mMiMax[0],miMax[0],sizeof(mMiMax)); - double *par = calc->GetPars(); - for (int j=0;j<2;j++) {par[j] = 0.5*(miMax[j][0]+miMax[j][1]);} -} -//______________________________________________________________________________ -FECalcHolder::FECalcHolder() -{ - memset(mBeg,0,mEnd-mBeg+1); -} -//______________________________________________________________________________ - void FECalcHolder::Update(const double *a) - { - double b[100]; - int n = mCalc->GetNPars(); - for (int i=0;iSetPars(b); -} -//______________________________________________________________________________ -void FECalcHolder::DbLoad() -{ - gSystem->Load("libStDb_Tables.so"); - TString dbName(GetName()); - - - TString dbFile("StarDb/Calibrations/tracker/"); - dbFile += dbName; dbFile += ".C"; - int myN = mCalc->GetNPars();if(myN){}; - if (!gSystem->AccessPathName(dbFile)) {//file exists - printf("FECalcHolder::DbLoad: %s\n",dbFile.Data()); - TString command (".L "); command += dbFile; - gInterpreter->ProcessLine(command); - mTab = (TTable *) gInterpreter->Calc("CreateTable()"); - command.ReplaceAll(".L ",".U "); - gInterpreter->ProcessLine(command); - mCalc->SetPars((double*)mTab->GetArray()); -//?? Scale(1./kErrFak); - } else { //file does not exist - printf("FECalcHolder::DbLoad: %s NOT FOUND. Default is used)\n",dbFile.Data()); -// mTab = (TTable *)gInterpreter->Calc("new St_StvHitErrs(\"someHitError\",1)"); -// mTab->SetName(dbName); -// mTab->SetUsedRows(1); -// memcpy(mTab->GetArray(),mCalc->GetPars(),myN*sizeof(double)); - } - -} -//______________________________________________________________________________ -void FECalcHolder::DbSave() -{ - if (testOnly) return; - int myN = mCalc->GetNPars(); - memcpy(mTab->GetArray(),mCalc->GetPars(),myN*sizeof(double)); - TString dbFile("StarDb/Calibrations/tracker/"); - dbFile += GetName(); - dbFile += ".C"; - if (!gSystem->AccessPathName(dbFile)) {//file exists - TString ts(dbFile); - ts +=".BAK"; gSystem->Rename(dbFile,ts); - } - { //save FE file - std::ofstream ofs(dbFile); - -// Save increased errors -//?? Scale(kErrFak); - mTab->SavePrimitive(ofs); -//?? Scale(1./kErrFak); - } -// Save production errors - { - dbFile.ReplaceAll("FE.C",".C"); - std::ofstream ofs(dbFile); - TString ts(mTab->GetName()); - assert(ts.EndsWith("FE")); - ts.Chop();ts.Chop(); - mTab->SetName(ts); - mTab->SavePrimitive(ofs); - ts+="FE"; - mTab->SetName(ts); - } -} -//______________________________________________________________________________ -void FECalcHolder::Scale(double fak) -{ - int n = mTab->GetRowSize()/sizeof(double); - double *d = (double*)mTab->GetArray(); - TCL::vscale(d,fak,d,n); -} -//______________________________________________________________________________ -void FECalcHolder::AvInit() -{ - memset(mAve ,0,sizeof(mAve )); - memset(mAveDer[0],0,sizeof(mAveDer)); -} -//______________________________________________________________________________ -void FECalcHolder::AvAdd(const double hRR[3],double yXi2,double zXi2) -{ -// double der[kMaxPars][3]; - mAve[0]++; - mAve[1]+=hRR[0]; - mAve[2]+=hRR[0]*hRR[0]; - mAve[3]+=hRR[2]; - mAve[4]+=hRR[2]*hRR[2]; - mAve[5]+=yXi2; - mAve[6]+=zXi2; - -// mCalc->CalcDcaDers(der); -// TCL::vadd(mAveDer[0],der[0],mAveDer[0],kMaxPars*3); -} -//______________________________________________________________________________ -void FECalcHolder::AvEnd() -{ - for (int i=1;i<7;i++) {mAve[i]/=mAve[0];} - for (int i=2;i<5;i+=2){mAve[i] -= pow(mAve[i-1],2);} - - printf(" %s\t yRes=%g zRes=%g \n\n",GetName(),sqrt(myFcn.mRes[1]),sqrt(myFcn.mRes[3])); - printf(" %s\t yErr= %5.2g(+-%5.2g) \tzErr = %5.2g(+-%5.2g) Hits=%g\n" - ,GetName() - ,sqrt(mAve[1]), mAve[2]/(2*sqrt(mAve[1])) - ,sqrt(mAve[3]), mAve[4]/(2*sqrt(mAve[3])), mAve[0]); - printf(" %s\t yXi2=%g zXi2=%g \n\n",GetName(),mAve[5],mAve[6]); - - -} -//______________________________________________________________________________ -StvHitErrCalculator *FETpcCalcHolder::GetCalc(const float x[3]) -{ -static const double Rinner =120.8; -static const double Dinner =120.8/cos(15./180*M_PI); -static const double kZPrompt = 205; - int inOut = -1; - if (strstr(mCalc->GetName(),"TpcInnerHit" )) inOut=0;; - if (strstr(mCalc->GetName(),"TpcOuterHit" )) inOut=1;; - if (strstr(mCalc->GetName(),"TpcInnerPrompt")) inOut=2;; - if (strstr(mCalc->GetName(),"TpcOuterPrompt")) inOut=3;; - assert(inOut>=0); - float rxy = x[0]*x[0]+x[1]*x[1]; - int jk=-1; - if (rxyDinner*Dinner) jk=1; - if (jk==-1) { - float gphi = atan2(x[1],x[0])/M_PI*180; - gphi = fmod(gphi+15,30.)-15; - gphi = fmod(gphi+15,30.)-15; - jk = (sqrt(rxy)*cos(gphi/180*M_PI) kZPrompt) jk+=2; - return (inOut==jk)? mCalc:0; -} -//______________________________________________________________________________ -int FETpcCalcHolder::FixPars(FEFcn *fcn) -{ -enum { -kYErr =0, /* Intrinsic resolution, padrow or Y direction */ -kZErr =1, /* Intrinsic resolution, z direction */ -kThkDet =2, /* detector thickness**2 , not fitted */ -kYYDiff =3, /* Diffusion in XY direction *yFactor */ -kZZDiff =4, /* Diffusion in Z direction *ZFactor */ -kYFact =5, /* Error factor in Y-direction */ -kZFact =6, /* Error factor in Z-direction */ -kZAB2 =7}; /* Constant member in Z direction (a*b)**2 */ - - if (strstr(GetName(),"Prompt")) return 0; - fcn->FixPar(kZAB2+mOffset); - fcn->FixPar(kThkDet+mOffset); - return 2; -} -//______________________________________________________________________________ -FETstCalcHolder::FETstCalcHolder() -{ - - mId = 1946; - mCalc = new StvHitErrCalculator("TestHitErrCalc",2); - double pars[2]={0.04,0.01}; - mCalc->SetPars(pars); -} - -//______________________________________________________________________________ -//______________________________________________________________________________ -FEFcn::FEFcn() -{ - Clear(); - mgInst = this; -} -//______________________________________________________________________________ -void FEFcn::Clear() -{ - memset(mFix,0,mEnd-mFix); - mTks.clear(); - mCas.clear(); -} -//______________________________________________________________________________ -void FEFcn::FixPar(int ipar,int fix) -{ - assert(mFix[ipar]!=2); - mFix[ipar]=fix; - if (fix) {myFitter.FixParameter(ipar);mNFixd++;} - else {myFitter.Release(ipar) ;mNFixd--;} -} -//______________________________________________________________________________ -int FEFcn::GetIPar(const char* name) const -{ - for (int ip=0;ipSetOffset(mNPars); - mNPars+=holder->GetNPars(); - mCas.push_back(holder); -} -//______________________________________________________________________________ -int FEFcn::FixPars() -{ - int n = mCas.size(); - int nn = 0; - for (int i=0;iFixPars(this); - } - return nn; - -} -//______________________________________________________________________________ -void FEFcn::InitFitter() -{ - myFitter.SetMaxIterations(2000); - myFitter.SetPrintLevel(1); - Synchro('C'); - TCL::ucopy(mPars,mFist,mNPars); - - myFitter.SetFCN(&Fcn); - int n = FixPars(); - printf("FEFcn::InitFitter() %d fixed params\n",n); - -} -//______________________________________________________________________________ -void FEFcn::DbLoad() -{ - for (int i=0;i<(int)mCas.size();i++) { mCas[i]->DbLoad(); } -} -//______________________________________________________________________________ -void FEFcn::DbSave() -{ - for (int i=0;i<(int)mCas.size();i++) { mCas[i]->DbSave(); } -} - -//______________________________________________________________________________ -void FEFcn::Update(const double *upd) -{ - for (int i=0;i<(int)mCas.size();i++) { - mCas[i]->Update(upd); - } -} -//______________________________________________________________________________ -int FEFcn::Fit() -{ - int stat=0; - stat=myFitter.Command("SET GRAD "); - stat=myFitter.Command("SET GRAD 1"); - assert(!stat); - stat=myFitter.Command("SET STRATEGY 0 "); - assert(!stat); -//stat=myFitter.Command("SET ERRORDEF 0.0001"); - stat=myFitter.Command("SHOW EPS"); - stat=myFitter.Command("SHOW ERR"); - mVal99 = 0; - for (int it=0;it<10;it++) { - mVal00 = mVal99; - Approx(0); - stat = myFitter.Migrad(); - printf("%d Command Migrad == %d\n",it,stat); - if (!stat) {break;} - stat = myFitter.Command("SCAN"); - printf("%d Command Scan== %d\n",it,stat); - if (stat) break; - } -// myFitter.Command("IMPROVE"); - Approx(1); - printf("FEFcn::Fit() Average Xi2/Ndf = %g(y) %g(z) %g\n",mXi2[0],mXi2[1],mXi2[2]); - return 0; - -} -//______________________________________________________________________________ -FECalcHolder *FEFcn::GetCalc(int id,const float hiPos[3]) -{ - for (int i=0;i<(int)mCas.size();i++) { - if (id!=mCas[i]->GetId()) continue; - StvHitErrCalculator *calc = mCas[i]->GetCalc(hiPos); - if (calc) return mCas[i]; - } - assert(0 && "HitErrCalculator not found"); - return 0; -} - -//______________________________________________________________________________ -int FEFcn::Add(FEEvent* ev) -{ - mNEvs++; - int jl,jr; - FENode node; - while ((jl=ev->NextTrack(jr))>-1) - { - if (fabs(ev->mCurv[jl])>kMaxCur) continue; - if (ev->nAllHits[jl] mPt[jl]/cos(ev->gDip[jl]))mChi2+jl,idx); -// float minXi2 = ev->mChi2[jl+idx[4]]; - for (int j=jl;j<=jr;j++) { - if (fabs(ev->lYHit[j])>kMaxDY) continue; - if (fabs(ev->lZHit[j])>kMaxDZ) continue; - double psi = ev->gPsi[j]; - double dip = ev->gDip[j]; - node.tkDir[0] = cos(dip)*cos(psi); - node.tkDir[1] = cos(dip)*sin(psi); - node.tkDir[2] = sin(dip); - - double phi = ev->gPFit[j]; - assert(fabs(phi)<7); - double rxy = ev->gRFit[j]; - assert(rxy<300); - node.hiPos[0] = rxy*cos(phi); - node.hiPos[1] = rxy*sin(phi); - node.hiPos[2] = ev->gZFit[j]; - assert(fabs(node.hiPos[2])<300); - - phi = ev->gPhiHP[j]; - dip = ev->gLamHP[j]; - node.hiDir[0][0] = cos(dip)*cos(phi); - node.hiDir[0][1] = cos(dip)*sin(phi); - node.hiDir[0][2] = sin(dip); - - node.hiDir[1][0] =-sin(phi); - node.hiDir[1][1] = cos(phi); - node.hiDir[1][2] = 0; - - node.hiDir[2][0] =-sin(dip)*cos(phi); - node.hiDir[2][1] =-sin(dip)*sin(phi); - node.hiDir[2][2] = cos(dip); - - node.s = ev->lLen[j]; - if (node.s>=300) continue; - assert(node.s<300); - if (!y00) { y00=ev->lYHit[j]; z00=ev->lZHit[j];} - node.yz[0] = ev->lYHit[j]-y00; - node.yz[1] = ev->lZHit[j]-z00; - node.detId = ev->mDetector[j]; - nNodes++; - myTrak.Add(node); - } - assert(myTrak.NNodes()==nNodes); - if (nNodesGaus(0.,rmsDY); - double lZHit = gRandom->Gaus(0.,rmsDZ); - if (fabs(lYHit)>kMaxDY) continue; - if (fabs(lZHit)>kMaxDZ) continue; - node.tkDir[0] = cos(dip)*cos(psi); - node.tkDir[1] = cos(dip)*sin(psi); - node.tkDir[2] = sin(dip); - - double phi = 0; - double rxy = 100; - node.hiPos[0] = rxy*cos(phi); - node.hiPos[1] = rxy*sin(phi); - node.hiPos[2] = 100; - - phi = 0; dip=0; - - node.hiDir[0][0] = cos(dip)*cos(phi); - node.hiDir[0][1] = cos(dip)*sin(phi); - node.hiDir[0][2] = sin(dip); - - node.hiDir[1][0] =-sin(phi); - node.hiDir[1][1] = cos(phi); - node.hiDir[1][2] = 0; - - node.hiDir[2][0] =-sin(dip)*cos(phi); - node.hiDir[2][1] =-sin(dip)*sin(phi); - node.hiDir[2][2] = cos(dip); - - node.s = s;s+=deltaS; - node.yz[0] = lYHit; - node.yz[1] = lZHit; - node.detId = 1946; - nNodes++; - myTrak.Add(node); - } - mNHits += nNodes; - mNTks++; - mTks.push_back(myTrak); - assert(nNodes==mTks.back().NNodes()); - } - assert(mTks.size()); - return; -} - -//______________________________________________________________________________ -void FEFcn::Eval(int npar, double* gradp, double& fvalp, double* par, int flag) -{ - assert(npar<=mNPars); - mNCall++; - long double grad[100]={0},fval=0,myXi2[3]={0}; - long double gra2[100]={0},fval2=0; - int myN=0,myNy=0,myNz=0; - - memset(mRes,0,sizeof(mRes)); - int myNHits = 0; -// Update calc's params by current ones - Synchro('A',par); -//?? Poli2 poliSY(2),poliSZ(1); - Poli2 poliSY(2,kMaxDY),poliSZ(1,kMaxDZ); - for (int itk=0;itk<(int)mTks.size();itk++) {//Loop over tracks - const FENodes &nodes = mTks[itk].Nodes(); - int nNodes = nodes.size();; - poliSY.Clear(); poliSZ.Clear(); - FECalcHolder *hold[100]; - double hRR[3],dRR[10][3]; - for (int iNode=0;iNodeGetCalc(); - calc->SetTrack(n.tkDir); - calc->CalcDcaErrs(n.hiPos,n.hiDir,hRR); - assert(hRR[0]>0); - assert(hRR[2]>0); - assert(hRR[0]*hRR[2]>hRR[1]*hRR[1]); - poliSY.Add(n.s,n.yz[0],1./hRR[0]); - poliSZ.Add(n.s,n.yz[1],1./hRR[2]); - } // end 1st Loop over nodes - - poliSY.Fit(); - poliSZ.Fit(); - fval += ((poliSY.LiH()+poliSZ.LiH()))-mVal00/mTks.size(); - myXi2[0] += poliSY.Xi2()-(nNodes); - myXi2[1] += poliSZ.Xi2()-(nNodes); - - myXi2[2] = 0.5*(myXi2[0]+myXi2[1]); - fval2 += poliSY.Xi2()+poliSZ.Xi2()- 2*nNodes; - myNy+=(nNodes); - myNz+=(nNodes); - myN+=myNy+myNz; - - myNHits+=nNodes; - for (int iNode=0;iNodeGetCalc(); - calc->SetTrack(n.tkDir); - calc->CalcDcaErrs(n.hiPos,n.hiDir,hRR); - calc->CalcDcaDers(dRR); - // dLih/dW*dW/dErr2 - double dLihdErrY = -poliSY.dLiHdW(iNode)/(hRR[0]*hRR[0]); - double dLihdErrZ = -poliSZ.dLiHdW(iNode)/(hRR[2]*hRR[2]); - double dXi2dErrY = -poliSY.dXi2dW(iNode)/(hRR[0]*hRR[0]); - double dXi2dErrZ = -poliSZ.dXi2dW(iNode)/(hRR[2]*hRR[2]); - int nPar=calc->GetNPars(); - int offs=hold[iNode]->GetOffset(); - for (int jPar=0;jPar fval+mVal00) mVal99 = fval+mVal00; - if (!mVal00) { mVal00 = mVal99; fvalp = 0;} - TCL::vscale(mRes,(1./myNHits),mRes,4); - - - if (flag==2) { - for (int i=0;iGetCalc(); - calc->SetTrack(n.tkDir); - calc->CalcDcaErrs(n.hiPos,n.hiDir,hRR); - assert(hRR[0]>0); - assert(hRR[2]>0); - poliSY.Add(n.s,n.yz[0],1./hRR[0]); - poliSZ.Add(n.s,n.yz[1],1./hRR[2]); - } // end 1st Loop over nodes - - poliSY.Fit(); - poliSZ.Fit(); - myXi2[0] += poliSY.Xi2()-nNodes; - myXi2[1] += poliSZ.Xi2()-nNodes; - - myXi2[2] = 0.5*(myXi2[0]+myXi2[1]); - mydKor += poliSY.dKordW()+poliSZ.dKordW(); - myN+=nNodes; - - for (int iNode=0;iNodeGetCalc(); - calc->SetTrack(n.tkDir); - calc->CalcDcaErrs(n.hiPos,n.hiDir,hRR); - assert(hRR[0]>0); - assert(hRR[2]>0); - myPull += pow(poliSY.Pull(n.s,n.yz[0],hRR[0]),2); - myPull += pow(poliSZ.Pull(n.s,n.yz[1],hRR[2]),2); - - } // end 1st Loop over nodes - - }//End tracks - - mXi2[0] = 1+myXi2[0]/myN; - mXi2[1] = 1+myXi2[1]/myN; - mXi2[2] = 0.5*(mXi2[0]+mXi2[1]); - myPull /=(2*myN); - mydKor /=(2*myN); - printf("Approx::Aver: Xi2=%g(y) %g(z) %g Pull=%g\n" - ,mXi2[0],mXi2[1],mXi2[2],double(myPull)); - - if (gScale) { - double korFak = (1.+mydKor/mXi2[2]); - if (!nonBias) {TCL::vscale(mPars, mXi2[2]*korFak ,mPars,mNPars);} - else {TCL::vscale(mPars,double(myPull*korFak),mPars,mNPars);} - } - - Synchro('P'); -} -//______________________________________________________________________________ -void FEFcn::Synchro(char from,const double* Arr ) -{ -// from: 0=from StvHitErrCalc's; 1=from Minuit; 2 = FEFcn::mPar; 3=from array - - switch (from) { - case 'C': {// input from StvHitErrCals's - int nump = 0; - for (int i=0;i<(int)mCas.size();i++) { - StvHitErrCalculator *calc = mCas[i]->GetCalc(); - int nP = calc->GetNPars(); - const double *p = calc->GetPars(); - for (int ip=0;ipGetName());ts+="_";ts+=ip; - double qwe = p[ip]; if (qwe<1e-8) qwe=1e-8; - double stp = qwe*0.1; if (stp<1e-8) stp = 0.8e-6; - myFitter.DefineParameter(nump,ts.Data(), qwe, stp, kLowPar, kUppPar); - mNams[nump] = ts; - mPars[nump] = qwe; - nump++; - } - } - if (!mNPars) mNPars = nump; - assert(mNPars==nump); - break;} - - case 'M': {// input from Minuit - double err; - for (int ipar=0;iparEval(npar,grad,fval,par,flag); -} - -//______________________________________________________________________________ -void FEFcn::AvErr(const char *tit) -{ - for (int ih=0;ih<(int)mCas.size();ih++) - { - FECalcHolder *hold = mCas[ih]; hold->AvInit(); - } - Poli2 poliSY(2,kMaxDY),poliSZ(2,kMaxDZ); - for (int itk=0;itk<(int)mTks.size();itk++) {//Loop over tracks - const FENodes &nodes = mTks[itk].Nodes(); - int nNodes = nodes.size(); - poliSY.Clear(); poliSZ.Clear(); - FECalcHolder *hold[100]; - double errs[100][3]; - double hRR[3]; - for (int iNode=0;iNodeGetCalc(); - calc->SetTrack(n.tkDir); - calc->CalcDcaErrs(n.hiPos,n.hiDir,hRR); - memcpy(errs[iNode],hRR,sizeof(hRR)); - poliSY.Add(n.s,n.yz[0],1./hRR[0]); - poliSZ.Add(n.s,n.yz[1],1./hRR[2]); - } // end 1st Loop over nodes - - poliSY.Fit(); - poliSZ.Fit(); - - for (int iNode=0;iNodeAvAdd(errs[iNode],yXi2,zXi2); - } // end 2nd Loop over nodes - }//End tracks - - printf("\n ====== AvErr(%s) Events=%d Tracks=%d Hits=%d\n" - ,tit,mNEvs,mNTks,mNHits); - - for (int ih=0;ih<(int)mCas.size();ih++) - { - FECalcHolder *hold = mCas[ih]; - hold->AvEnd(); - } - return; -} -//______________________________________________________________________________ -int FEFcn::IsEnded() const -{ - double sum = 0,dlt=0; - for (int i=0;i 1e-2) return 0; - printf(" *** Fit CONVERGED Hurragh***\n"); - return 1; -} - - -//______________________________________________________________________________ -//______________________________________________________________________________ -#ifdef APPROX -//______________________________________________________________________________ -FEApprox::FEApprox(FEFcn *fefcn) -{ - mFcn=fefcn; - mNPars = mFcn->GetNPars(); - mG.ResizeTo(mNPars,mNPars); - mGi.ResizeTo(mNPars,mNPars); - mB.ResizeTo(mNPars); - mP.ResizeTo(mNPars); - mPrev.ResizeTo(mNPars); - mPrev = TVectorD(mNPars,mFcn->GetPars()); - mXlo.ResizeTo(mNPars); - mIxlo.ResizeTo(mNPars);mIxlo =1.; - mXup.ResizeTo(mNPars); - mIxup.ResizeTo(mNPars);mIxup =1.; -} -//______________________________________________________________________________ -int FEApprox::Prepare() -{ - assert(mNPars<100); - long double myXi2=0,myB[100]={0},myG[100][100]={{0}}; - int myN=0; - TMatrixD d2LdWWy,d2LdWWz,dSdPy,dSdPz; - TMatrixD dWdSy,dWdSz,d2WdSSy,d2WdSSz; - TVectorD dLdWy,dLdWz; - -//?? Poli2 poliSY(2),poliSZ(1); - Poli2 poliSY(2),poliSZ(2); - const FETrak* trak = mFcn->GetTrak(); - for (;trak;trak=trak->Next()) { - int nNodes = trak->GetNNodes(); - poliSY.Clear(); poliSZ.Clear(); - FECalcHolder *hold[100]; - double hRR[3],dRR[10][3]; - for (int iNode=0;iNodeGetNode(iNode); - hold[iNode] = mFcn->GetCalc((int)n->detId,n->hiPos); - StvHitErrCalculator *calc = hold[iNode]->GetCalc(); - calc->SetTrack(n->tkDir); - calc->CalcDcaErrs(n->hiPos,n->hiDir,hRR); - assert(hRR[0]>0); - assert(hRR[2]>0); - poliSY.Add(n->s,n->yz[0],1./hRR[0]); - poliSZ.Add(n->s,n->yz[1],1./hRR[2]); - } // end 1st Loop over nodes - - poliSY.Fit(); - poliSZ.Fit(); - myXi2 +=poliSY.LiH()+poliSZ.LiH(); - poliSY.Deriv(dLdWy); poliSY.D2riv(d2LdWWy); - poliSZ.Deriv(dLdWz); poliSZ.D2riv(d2LdWWz); - dWdSy.ResizeTo(nNodes,nNodes); dWdSy=0.; - dWdSz.ResizeTo(nNodes,nNodes); dWdSz=0.; - d2WdSSy.ResizeTo(nNodes,nNodes); d2WdSSy=0.; - d2WdSSz.ResizeTo(nNodes,nNodes); d2WdSSz=0.; - dSdPy.ResizeTo(mNPars,nNodes); dSdPy=0.; - dSdPz.ResizeTo(mNPars,nNodes); dSdPz=0.; - dSdPy.ResizeTo(mNPars,nNodes); dSdPy=0.; - myN++; - - StvHitErrCalculator *calc=0;const FENode *n=0; - for (int iNode=0;iNodeGetNode(iNode); - calc = hold[iNode]->GetCalc(); - calc->SetTrack(n->tkDir); - calc->CalcDcaErrs(n->hiPos,n->hiDir,hRR); - calc->CalcDcaDers(dRR); - int offs=hold[iNode]->GetOffset(); - int nP = calc->GetNPars(); - for (int jp=0;jp0) { - myDel = 1./sqrt(mG[ipar][ipar]); - if (delta > myDel) delta = myDel; - myDel = fabs(mB[ipar]/mG[ipar][ipar]); - if (delta > myDel) delta = myDel; - } else { - myDel = fabs(mB[ipar]/mG[ipar][ipar])*2/0.1; - if (delta > myDel) delta = myDel; - } - mXlo[ipar] = mPrev[ipar]-delta; - if (mXlo[ipar]<1e-8) mXlo[ipar]=1e-8; - mXup[ipar] = mPrev[ipar]+delta; - } - -// Prepare inequalities - - int nCas = mFcn->mCas.size(); - mC.ResizeTo(nCas*2,mNPars); mC = 0.; - mClo.ResizeTo(nCas*2); - mIclo.ResizeTo(nCas*2); mIclo = 1; - mCup.ResizeTo(nCas*2); - mIcup.ResizeTo(nCas*2); mIcup = 1; - int iRow = 0; - for (int ic=0;icmCas[ic]; - StvHitErrCalculator *calc = hold->GetCalc(); - int iCol = hold->GetOffset(); - int nP = calc->GetNPars(); - for (int ip=0;ipmAveDer[ip][0]; - mC[iRow+1][iCol+ip] = hold->mAveDer[ip][2]; - } - mClo[iRow+0] = hold->mMiMax[0][0]; - mClo[iRow+1] = hold->mMiMax[1][0]; - mCup[iRow+0] = hold->mMiMax[0][1]; - mCup[iRow+1] = hold->mMiMax[1][1]; - iRow+=2; - } - return 0; -} -#include "Riostream.h" -#include "TMath.h" -#include "TSystem.h" - -#include "TMatrixD.h" -#include "TMatrixDSym.h" -#include "TVectorD.h" -#include "TQpProbDens.h" -#include "TGondzioSolver.h" -#include "TMehrotraSolver.h" - -//______________________________________________________________________________ -int FEApprox::Test() -{ - mP = TVectorD(mNPars,mFcn->GetPars()); - Prepare(); -// mB.Print(); - TVectorD baseDer(mB); - TMatrixD baseD2r(mG); - double baseFcn = mXi2; - double part = 3e-2,minStp=3e-4; - for (int ip=0;ipIsFixed(ip)) continue; - double eps = mP[ip]*part; if (eps Update(mP.GetMatrixArray()); - Prepare(); - double nowFcn = mXi2; - double num = (nowFcn-baseFcn)/eps; - double ana = mB[ip]; - double dif = 2*(num-ana)/(fabs(num+ana)+3e-33); - printf ("dXi2dP(%2d) \tana=%g \tnum = %g \tdif=%g\n",ip,ana,num,dif); - for (int jp=0;jp<=ip;jp++) { - if (mFcn->IsFixed(jp)) continue; - num = (mB[jp]-baseDer[jp])/eps; - ana = (mG[ip][jp]+baseD2r[ip][jp])/2; - dif = 2*(num-ana)/(fabs(num+ana)+3e-33); - printf ("\td2Xi2dPP(%2d,%2d) \tana=%g \tnum = %g \tdif=%g\n",ip,jp,ana,num,dif); - } - mP[ip]=sav; - mFcn->Update(mP.GetMatrixArray()); - } - - return 0; -} -//______________________________________________________________________________ -int FEApprox::Quadr() -{ -const int nrVar=mNPars; -const int nrEqual = mFcn->GetNFixd()+3; -const int nrInEqual = mC.GetNrows(); -TVectorD c = mB; -TMatrixDSym Q(nrVar,mG.GetMatrixArray()); - - // equality equation - TMatrixD A(nrEqual,nrVar); - TVectorD b(nrEqual); - int iiEqual=0; - for (int ipar=0;iparIsFixed(ipar)) continue; - A[iiEqual][ipar] = 1; - b[iiEqual] = 0; - iiEqual++; - } - A[iiEqual][4]=1; A[iiEqual][4+6]=-1.;iiEqual++; - A[iiEqual][5]=1; A[iiEqual][5+6]=-1.;iiEqual++; - A[iiEqual][2]=1; A[iiEqual][2+6]=-1.;iiEqual++; - - - // inequality equation - // - // - although not applicable in the current situatio since nrInEqual = 0, one - // has to specify not only clo and cup but also an index vector iclo and icup, - // whose values are either 0 or 1 . If iclo[j] = 1, the lower boundary condition - // is active on x[j], etc. ... - -// TMatrixD C (nrInEqual,nrVar); -// TVectorD clo (nrInEqual); -// TVectorD cup (nrInEqual); -// TVectorD iclo(nrInEqual); -// TVectorD icup(nrInEqual); - - // simple square boundary condition : 0 <= x_i, so only xlo is relevant . - // Like for clo and cup above, we have to define an index vector ixlo and ixup . - // Since each variable has the lower boundary, we can set the whole vector - // ixlo = 1 - -// TVectorD xlo (nrVar); xlo = 1e-8; -// TVectorD xup (nrVar); xup = 10; -// TVectorD ixlo(nrVar); ixlo = 1; -// TVectorD ixup(nrVar); ixup = 1; - - // setup the quadratic programming problem . Since a small number of variables are - // involved and "Q" has everywhere entries, we chose the dense version "TQpProbDens" . - // In case of a sparse formulation, simply replace all "Dens" by "Sparse" below and - // use TMatrixDSparse instead of TMatrixDSym and TMatrixD - - TQpProbDens *qp = new TQpProbDens(nrVar,nrEqual,nrInEqual); - - // stuff all the matrices/vectors defined above in the proper places - - TQpDataDens *prob = (TQpDataDens *)qp->MakeData(c,Q,mXlo,mIxlo,mXup,mIxup,A,b,mC,mClo,mIclo,mCup,mIcup); - - - // setup the nrVar variables, vars->fX will contain the final solution - - TQpVar *vars = qp->MakeVariables(prob); - TQpResidual *resid = qp->MakeResiduals(prob); - - // Now we have to choose the method of solving, either TGondzioSolver or TMehrotraSolver - // The Gondzio method is more sophisticated and therefore numerically more involved - // If one want the Mehrotra method, simply replace "Gondzio" by "Mehrotra" . - - TGondzioSolver *s = new TGondzioSolver(qp,prob); -//TMehrotraSolver *s = new TMehrotraSolver(qp,prob); - const Int_t status = s->Solve(prob,vars,resid); - assert(!status); - mP = vars->fX; - - - - return 0; -} - -//______________________________________________________________________________ -int FEApprox::Approx() -{ - int iter = 0,nCutStp=0; - double myXi2 = 1000.; - for (;iter<26;iter++) - { - Prepare(); - if (mXi2 > myXi2 && nCutStp>5) { - nCutStp++; - mP = 0.5*(mP+mPrev); - mFcn->Update(mP.GetMatrixArray()); - continue; - } - nCutStp=0; - int ans = Quadr(); if(ans){}; - double eps = 0,maxpar=0;int ips=-1; - for (int ip=0;ipUpdate(mP.GetMatrixArray()); - if (eps<0.03) break; - } -// Now release all the parameters - for (int iPar=0;iParIsFixed(iPar)!=1) continue; -// printf(" Approx:: release parameter %d\n",iPar); - mFcn->FixPar(iPar,0); - } - - return iter; -} -#endif // APPROX -#endif - diff --git a/StRoot/macros/calib/StvFitErr.csh b/StRoot/macros/calib/StvFitErr.csh deleted file mode 100755 index 9dff7624d63..00000000000 --- a/StRoot/macros/calib/StvFitErr.csh +++ /dev/null @@ -1,155 +0,0 @@ -# -# Evaluation of hit errors. -# invoking: -# StvFitErr.csh daqfile.daq pp2009 -# -# daqfile must be the fullname of daq file, including full path -# -# At the beginning empty working directory must be created -# At the end in subdirectory StarDb/Calibrations/tracker/ -# will be created files: -# StarDb/Calibrations/tracker/ssdHitError.20050101.235959.C -# StarDb/Calibrations/tracker/svtHitError.20050101.235959.C -# StarDb/Calibrations/tracker/tpcInnerHitError.20050101.235959.C -# StarDb/Calibrations/tracker/tpcOuterHitError.20050101.235959.C -# -# these files could be used by Stv. -# file stv.log contains log of Stv -# file fit.log contains log of HitError fitting -# -# All questions to Victor Perev -# Victor Perev Feb 17, 2007 -############################################################################ -source ${GROUP_DIR}/.starver .DEV -echo STAR = $STAR $ROOTSYS - -# Check input file -if ( ! ${%1} ) then - echo "fiterr: ***No input daq file ***" - exit 13 -endif - -set daqFile = ${1} - -set myFile = {$daqFile:s/@//} -setenv STV_FILE_LIST $myFile - -if (!( -e ${myFile} )) then - echo "fiterr: ***Daq file Not FOUND // ${daqFile} ***" - exit 13 -endif -echo "fiterr: Input daq file=${daqFile}" -set nam = ${daqFile:t} -set nam = ${nam:r} -set nam = ${nam:s/@//} - - -set Opt = ${2} -setenv STV_OPTS $Opt -set myOpt = ${3} -set nFETracks = ${4}; -if ( ! $nFETracks ) set nFETracks = 1000000; -echo "fiterr: *** $nFETracks tracks requested" -# FloatPointException OFF -setenv STARFPE NO - -# Fit Stv errors - - -# Create DB directories -mkdir -p StarDb/Calibrations/tracker/ -mkdir -p StarDb/Calibrations/rich/ - -# Create link to fiterr.C for aclic -#if ( ! ( -e fiterr.C ) ) ln -sf $STAR/StRoot/macros/calib/fiterr.C . - -@ iter = 0 - -AGAIN: -@ iter = $iter + 1 - -set myroot_time = 0 -set fitlog_time = 0 -if ( -e fit.log) set fitlog_time = `stat -c %X fit.log` -if ( -e stv.log) set myroot_time = `stat -c %X stv.log` -touch fit.log -touch stv.log -if ($myroot_time > $fitlog_time) goto FIT - -echo '*** STV Started *** Iter=' $iter -echo '*** STV Started *** Iter=' $iter >> stv.log - -## STV: -## gdb root.exe <>& stv.log -## run -b -## .L runStv.C -## #include -## const char *star = gSystem->Getenv("STAR"); -## const char *path = gSystem->Getenv("LD_LIBRARY_PATH"); -## printf("*** STAR = %s ***\n",star); -## printf("*** PATH = %s ***\n",path); -## int ans =13; -## ans =runStv("$daqFile","${Opt}",0,11); -## printf("*** runStv=%d\n ***",ans); -## ans =13; -## chain->SetAttr("fiterr",$nFETracks,"Stv"); -## chain->SetAttr("HitLoadOpt" ,0,"Stv"); -## chain->SetAttr("useTracker" ,1,"Stv"); -## chain->SetAttr("useVertexFinder",0,"Stv"); -## chain->SetAttr("useEventFiller" ,1,"Stv"); -## chain->SetAttr("makePulls" ,1,"Stv"); -## ans = chain->EventLoop(4000); -## bt -## printf("*** EventLoop=%d ***\n",ans); -## if (ans > 2) exit(13); -## ans =chain->Finish(); -## if (ans) exit(14); -## exit(0); -## EOF -########################## -runCondor.csh -########################## -set myerr = $status -if ($myerr) goto STVERR -echo '*** STV Ended *** Status=' $myerr -echo '*** STV Ended *** Iter=' $iter >> stv.log -touch stv.log -if ($myerr) goto STVERR - -FIT: -echo '*** FitErr Started *** Iter=' $iter -##set timstamp = ( `grep 1stEventTimeStamp stv.log` ) -##echo $timstamp - -touch fit.log - -root.exe -b <>& fit.log -#include - -gSystem->Load("libQuadp.so"); -gSystem->Load("StvUtil"); - -.L StvFitErr.C+ -int ans = 13; -ans = StvFitErr("condor/*.tags.root"); -exit(ans); -.q -EOF -set myerr = $status -echo '*** FitErr Ended *** Status=' $myerr -if ($myerr) goto FITERR -if ( $iter > 9 ) goto MANY -goto AGAIN - -# -STVERR: -echo "STVERR =" $myerr "Iter=" $iter -exit - -FITERR: if (myerr==99) goto DONE - echo "FITERR =" $myerr "Iter=" $iter -exit -DONE: echo "DONE Iter=" $iter -exit -MANY: echo "TOO MANY Iters=" $iter -exit diff --git a/StRoot/macros/calib/runStv.C b/StRoot/macros/calib/runStv.C deleted file mode 100644 index 02860582a80..00000000000 --- a/StRoot/macros/calib/runStv.C +++ /dev/null @@ -1,65 +0,0 @@ -class StMaker; -void rmMaker(const StMaker *top,const char *key); -int runStv(const char *daqFile,const char *flg,int nEvents,int myFlag) -{ -int stv = (myFlag )%10; -int trs = (myFlag/10 )%10; -int mcm = (myFlag/100 )%10; -int knn = (myFlag/1000)%10; - -printf("\n*** runStv(\"%s\",\"%s\",%d,%d)\n\n",daqFile,flg,nEvents,myFlag); -gROOT->LoadMacro("bfc.C"); -TString opt(flg),fil(daqFile); -int fr=1,to=nEvents; -int ierr = 0; - -opt += ",StvPulls"; - - -bfc(-1,opt,fil); -chain->SetAttr("blackList","Svt","St_db_Maker::"); - -// StIOInterFace *iomk = (StIOInterFace *)chain->GetMaker("inputStream"); -// if (iomk && !fil.Contains(".geant.")) { -// TString dir("/star/simu/simu/perev/StiVMC/offline/users/perev/fitErrSim/"); -// iomk->SetBranch("geantBranch",dir,"r"); -// } - - -StMaker *mk=0; - -//StMaker::lsMakers(chain); - -if (nEvents>=0) chain->Init(); - -//========================================== -rmMaker(chain,"StKinkMaker"); -//========================================== -if (knn){ - chain->SetAttr("seedFinders","KN","Stv"); - chain->SetAttr("seedFinders","KN","Sti"); -} -if (nEvents>=0) chain->EventLoop(nEvents); -return 99; -} - -void rmMaker(const StMaker *top, const char *key) -{ - TRegexp rex(key); - for (int del=1;del;) { - TDataSetIter iter((TDataSet*)top,20); - del=0; - for(const TDataSet *mk=top;mk;mk = iter.Next()) { - if(strncmp(".maker",mk->GetTitle(),6)!=0) continue; - TString ts(mk->ClassName()); ts+="::"; - ts+=mk->GetName(); - if (ts.Index(rex)<0) continue; - printf("*** Remove %s *** \n",ts.Data()); - delete mk; del = 1; break; - } - } - - printf("*** Maker %s Not Found ***\n",ts.Data()); - -} - diff --git a/StarDb/AgMLGeometry/CreateGeometry.h b/StarDb/AgMLGeometry/CreateGeometry.h index 7deee16ed76..66da8858fa8 100644 --- a/StarDb/AgMLGeometry/CreateGeometry.h +++ b/StarDb/AgMLGeometry/CreateGeometry.h @@ -2,8 +2,6 @@ #if !defined(__CINT__) || defined(__CLING__) #include "StBFChain/StBFChain.h" -#include "StarVMC/StarAgmlLib/AgModule.h" -#include "StarVMC/StarAgmlLib/StarTGeoStacker.h" #include "StarVMC/StarGeometry/StarGeo.h" #endif @@ -33,27 +31,18 @@ TDataSet *CreateGeometry(const Char_t *name="y2011") { // Append geom.root to the extentionless filename filename+=".geom.root"; - // Detect second call to the system - if ( AgModule::Find("HALL") ) { - if ( chain->GetOption("Sti") || - chain->GetOption("StiCA") || - chain->GetOption("StiVMC") ){ - cout << "AgML geometry: HALL exists. Restore from cache file " - << filename.Data() << endl; + if ( gGeoManager ) { + if ( chain->GetOption("Sti") || chain->GetOption("StiCA") ) { gGeoManager = 0; - assert(0); + assert(0); // this assert should be called in our Sti reconstruction chains... why not? TGeoManager::Import( filename ); - assert(gGeoManager); } - return geom; } - cout << "AgML: Building geometry " << name << " " << endl; - // Create the geometry using TGeo - AgBlock::SetStacker( new StarTGeoStacker() ); Geometry *build = new Geometry(); + build->InitAgML( "StarTGeoStacker" ); // Suppress copious ROOT warnings Long_t save = gErrorIgnoreLevel; gErrorIgnoreLevel = 9999; diff --git a/StarDb/AgMLGeometry/Geometry.y2024.C b/StarDb/AgMLGeometry/Geometry.y2024.C new file mode 100644 index 00000000000..f55678cbabf --- /dev/null +++ b/StarDb/AgMLGeometry/Geometry.y2024.C @@ -0,0 +1,7 @@ +#include "CreateGeometry.h" +TDataSet *CreateTable() +{ + // Return the requested geometry + return CreateGeometry("y2024"); +} + diff --git a/StarDb/AgMLGeometry/Geometry.y2024a.C b/StarDb/AgMLGeometry/Geometry.y2024a.C new file mode 100644 index 00000000000..f2f2ab9c970 --- /dev/null +++ b/StarDb/AgMLGeometry/Geometry.y2024a.C @@ -0,0 +1,7 @@ +#include "CreateGeometry.h" +TDataSet *CreateTable() +{ + // Return the requested geometry + return CreateGeometry("y2024a"); +} + diff --git a/StarDb/Calibrations/ftpc/ftpcCoordTrans.C b/StarDb/Calibrations/ftpc/ftpcCoordTrans.C index d4608c768c3..fad3dfb6f76 100644 --- a/StarDb/Calibrations/ftpc/ftpcCoordTrans.C +++ b/StarDb/Calibrations/ftpc/ftpcCoordTrans.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcCoordTrans_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/ftpc/.ftpcCoordTrans/ftpcCoordTrans Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/Calibrations/ftpc/ftpcTemps.devE.C b/StarDb/Calibrations/ftpc/ftpcTemps.devE.C index 033596ce752..bba15262002 100644 --- a/StarDb/Calibrations/ftpc/ftpcTemps.devE.C +++ b/StarDb/Calibrations/ftpc/ftpcTemps.devE.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcTemps_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_ftpcTemps")) return 0; ftpcTemps_st row; diff --git a/StarDb/Calibrations/ftpc/ftpcTemps.eStar2.C b/StarDb/Calibrations/ftpc/ftpcTemps.eStar2.C index 033596ce752..bba15262002 100644 --- a/StarDb/Calibrations/ftpc/ftpcTemps.eStar2.C +++ b/StarDb/Calibrations/ftpc/ftpcTemps.eStar2.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcTemps_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_ftpcTemps")) return 0; ftpcTemps_st row; diff --git a/StarDb/Calibrations/ftpc/ftpcTemps.y2010.C b/StarDb/Calibrations/ftpc/ftpcTemps.y2010.C index 033596ce752..bba15262002 100644 --- a/StarDb/Calibrations/ftpc/ftpcTemps.y2010.C +++ b/StarDb/Calibrations/ftpc/ftpcTemps.y2010.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcTemps_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_ftpcTemps")) return 0; ftpcTemps_st row; diff --git a/StarDb/Calibrations/ftpc/ftpcTemps.y2011.C b/StarDb/Calibrations/ftpc/ftpcTemps.y2011.C index 033596ce752..bba15262002 100644 --- a/StarDb/Calibrations/ftpc/ftpcTemps.y2011.C +++ b/StarDb/Calibrations/ftpc/ftpcTemps.y2011.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcTemps_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_ftpcTemps")) return 0; ftpcTemps_st row; diff --git a/StarDb/Calibrations/ftpc/ftpcVoltage.C b/StarDb/Calibrations/ftpc/ftpcVoltage.C index aae48774dae..6b7c5f486c7 100644 --- a/StarDb/Calibrations/ftpc/ftpcVoltage.C +++ b/StarDb/Calibrations/ftpc/ftpcVoltage.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcVoltage_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/ftpc/.ftpcVoltage/ftpcVoltage Allocated rows: 1 Used rows: 1 Row size: 116 bytes diff --git a/StarDb/Calibrations/ftpc/ftpcVoltageStatus.C b/StarDb/Calibrations/ftpc/ftpcVoltageStatus.C index 979917675b2..d548d54fad9 100644 --- a/StarDb/Calibrations/ftpc/ftpcVoltageStatus.C +++ b/StarDb/Calibrations/ftpc/ftpcVoltageStatus.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcVoltageStatus_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/ftpc/.ftpcVoltageStatus/ftpcVoltageStatus Allocated rows: 1 Used rows: 1 Row size: 20 bytes diff --git a/StarDb/Calibrations/rich/richvoltages.C b/StarDb/Calibrations/rich/richvoltages.C index ad66a54b425..d984eaaf25e 100644 --- a/StarDb/Calibrations/rich/richvoltages.C +++ b/StarDb/Calibrations/rich/richvoltages.C @@ -1,3 +1,5 @@ +#include "tables/St_richvoltages_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/rich/.richvoltages/richvoltages Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/Calibrations/rich/spaceChargeCor.C b/StarDb/Calibrations/rich/spaceChargeCor.C index 7c856ac764e..07702bd2b99 100644 --- a/StarDb/Calibrations/rich/spaceChargeCor.C +++ b/StarDb/Calibrations/rich/spaceChargeCor.C @@ -1,3 +1,5 @@ +#include "tables/St_spaceChargeCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/rich/.spaceChargeCor/spaceChargeCor Allocated rows: 1 Used rows: 1 Row size: 60 bytes diff --git a/StarDb/Calibrations/rich/spaceChargeCorR2.C b/StarDb/Calibrations/rich/spaceChargeCorR2.C index 4431d5f9667..9f70bcec998 100644 --- a/StarDb/Calibrations/rich/spaceChargeCorR2.C +++ b/StarDb/Calibrations/rich/spaceChargeCorR2.C @@ -1,3 +1,5 @@ +#include "tables/St_spaceChargeCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/rich/.spaceChargeCorR2/spaceChargeCorR2 Allocated rows: 1 Used rows: 1 Row size: 60 bytes diff --git a/StarDb/Calibrations/rich/spaceChargeCorR2.eStar2.C b/StarDb/Calibrations/rich/spaceChargeCorR2.eStar2.C index 4431d5f9667..9f70bcec998 100644 --- a/StarDb/Calibrations/rich/spaceChargeCorR2.eStar2.C +++ b/StarDb/Calibrations/rich/spaceChargeCorR2.eStar2.C @@ -1,3 +1,5 @@ +#include "tables/St_spaceChargeCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/rich/.spaceChargeCorR2/spaceChargeCorR2 Allocated rows: 1 Used rows: 1 Row size: 60 bytes diff --git a/StarDb/Calibrations/rich/trigDetSums.C b/StarDb/Calibrations/rich/trigDetSums.C index a012c8d1f70..0ea0e598f96 100644 --- a/StarDb/Calibrations/rich/trigDetSums.C +++ b/StarDb/Calibrations/rich/trigDetSums.C @@ -1,3 +1,5 @@ +#include "tables/St_trigDetSums_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/rich/.trigDetSums/trigDetSums Allocated rows: 1 Used rows: 1 Row size: 144 bytes diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000001.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000001.C index d14b6c2e774..f9721c5ea86 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000001.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; const double drift_dist = 29928.; //in microns diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000027.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000027.C index eae30ad1e96..aa21e7bc5d4 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000027.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050120.000027.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[344] = {//Pass126 021M diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050217.000027.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050217.000027.C index e4d414e51c6..3dc55265fd5 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050217.000027.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050217.000027.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[344] = {//Pass126 049M diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050310.000027.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050310.000027.C index d27f4fdc4fe..ba8c22960dc 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050310.000027.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20050310.000027.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[293] = {//Pass126 Cu62M diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070206.000001.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070206.000001.C index f2d56bf5a72..2436caee6c4 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070206.000001.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070206.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[376] = {//~kotov/public/macros/drift/AuAu2007120/tfit_AuAu2007_120_db.txt diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070321.000209.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070321.000209.C index d93ed16bb5c..3789511b6f9 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070321.000209.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070321.000209.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[314] = {//Clean up diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000201.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000201.C index 97dde67a47c..2f040cda614 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000201.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000201.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[292] = {//Pass217 RFJ diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000210.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000210.C index c9c884d119b..32338d553c3 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000210.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.20070524.000210.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; svtHybridDriftVelocity_st row[287] = {//Pass217 RFS Cleaned diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.C index b412940ed9e..b2e7034b75c 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; const double drift_dist = 29928.; //in microns diff --git a/StarDb/Calibrations/svt/svtHybridDriftVelocity.y2006.C b/StarDb/Calibrations/svt/svtHybridDriftVelocity.y2006.C index b412940ed9e..b2e7034b75c 100644 --- a/StarDb/Calibrations/svt/svtHybridDriftVelocity.y2006.C +++ b/StarDb/Calibrations/svt/svtHybridDriftVelocity.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_svtHybridDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtHybridDriftVelocity")) return 0; const double drift_dist = 29928.; //in microns diff --git a/StarDb/Calibrations/svt/svtRDOstripped.C b/StarDb/Calibrations/svt/svtRDOstripped.C index dbc4788f262..6f77367ba58 100644 --- a/StarDb/Calibrations/svt/svtRDOstripped.C +++ b/StarDb/Calibrations/svt/svtRDOstripped.C @@ -1,3 +1,5 @@ +#include "tables/St_svtRDOstripped_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtRDOstripped")) return 0; svtRDOstripped_st row[72] = { diff --git a/StarDb/Calibrations/svt/svtRDOstripped.y2005d.C b/StarDb/Calibrations/svt/svtRDOstripped.y2005d.C index dbc4788f262..6f77367ba58 100644 --- a/StarDb/Calibrations/svt/svtRDOstripped.y2005d.C +++ b/StarDb/Calibrations/svt/svtRDOstripped.y2005d.C @@ -1,3 +1,5 @@ +#include "tables/St_svtRDOstripped_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtRDOstripped")) return 0; svtRDOstripped_st row[72] = { diff --git a/StarDb/Calibrations/svt/svtRDOstripped.y2006.C b/StarDb/Calibrations/svt/svtRDOstripped.y2006.C index dbc4788f262..6f77367ba58 100644 --- a/StarDb/Calibrations/svt/svtRDOstripped.y2006.C +++ b/StarDb/Calibrations/svt/svtRDOstripped.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_svtRDOstripped_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_svtRDOstripped")) return 0; svtRDOstripped_st row[72] = { diff --git a/StarDb/Calibrations/tof/tofStatus.C b/StarDb/Calibrations/tof/tofStatus.C index 1ff576d3a89..9ac29300b12 100644 --- a/StarDb/Calibrations/tof/tofStatus.C +++ b/StarDb/Calibrations/tof/tofStatus.C @@ -1,3 +1,5 @@ +#include "tables/St_tofStatus_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tof/.tofStatus/tofStatus Allocated rows: 1 Used rows: 1 Row size: 48000 bytes diff --git a/StarDb/Calibrations/tpc/GatingGrid.C b/StarDb/Calibrations/tpc/GatingGrid.C index 9165c310692..e1da6e2e50a 100644 --- a/StarDb/Calibrations/tpc/GatingGrid.C +++ b/StarDb/Calibrations/tpc/GatingGrid.C @@ -1,3 +1,5 @@ +#include "tables/St_GatingGrid_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_GatingGrid")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGrid.y2018.C b/StarDb/Calibrations/tpc/GatingGrid.y2018.C index 585a5c670f7..2a1026f4b2e 100644 --- a/StarDb/Calibrations/tpc/GatingGrid.y2018.C +++ b/StarDb/Calibrations/tpc/GatingGrid.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_GatingGrid_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_GatingGrid")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGrid.y2019.C b/StarDb/Calibrations/tpc/GatingGrid.y2019.C index 9165c310692..e1da6e2e50a 100644 --- a/StarDb/Calibrations/tpc/GatingGrid.y2019.C +++ b/StarDb/Calibrations/tpc/GatingGrid.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_GatingGrid_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_GatingGrid")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGrid.y2022.C b/StarDb/Calibrations/tpc/GatingGrid.y2022.C index 9766d4ec07b..ce53f436187 100644 --- a/StarDb/Calibrations/tpc/GatingGrid.y2022.C +++ b/StarDb/Calibrations/tpc/GatingGrid.y2022.C @@ -1,3 +1,5 @@ +#include "tables/St_GatingGrid_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_GatingGrid")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGridB.20190225.230040.C b/StarDb/Calibrations/tpc/GatingGridB.20190225.230040.C deleted file mode 100644 index ba26f07546d..00000000000 --- a/StarDb/Calibrations/tpc/GatingGridB.20190225.230040.C +++ /dev/null @@ -1,55 +0,0 @@ -TDataSet *CreateTable() { - if (!TClass::GetClass("St_tpcCorrection")) return 0; -/* - Table: GatingGridB : parameters from Timothy Camarda, 08/09/21 - Old Gating Grid for Run < 18: t0 = 320 ns, setting time = 2.5 us, tau = 2.5 / 4.6 = 543 ns - New Gating Grid for Run 18: t0 = 240 ns, setting time = 1.43 us, tau = 1.43 / 4.6 = 311 ns - Old Gating Grid for Runs 19 - 21 - New Gating Grid for Run > 21: t0 = 240 ns, setting time = 2.0 us, tau = 2.0 / 4.6 = 435 ns. - setting time = time of reaching transperency 99% - tau = setting time/4.6 => exp(-4.6) = 1% - description: Gating Grid transperancy = 0, for t < t0, and 1 - exp(-(t-t0)/tau), for t > t0 -// Fit from 19GeV_2019 data 04/08/2022 G3GFdEdx.root - TF1 *GG = new TF1("GG","TMath::Log(1 - TMath::Exp(-(x-[0])*4.6/[1]))",0,10) - GG->SetParameters(0,2.5) - FitP->Draw("mu:y>>O","i&&j&&abs(x)>40.5","prof") - O->Fit(GG,"er","",0.3,6) - FCN=1174.76 FROM MINOS STATUS=SUCCESSFUL 12 CALLS 109 TOTAL - EDM=1.21976e-08 STRATEGY= 1 ERROR MATRIX ACCURATE - EXT PARAMETER STEP FIRST - NO. NAME VALUE ERROR SIZE DERIVATIVE - 1 p0 1.84098e-01 2.77863e-03 -1.12239e-05 -3.12034e-01 - 2 p1 1.75245e+00 7.48903e-03 7.48903e-03 -3.75507e-04 - 1 p0 2.85771e-01 2.81202e-03 -1.15678e-05 -3.50969e-01 - 2 p1 1.68566e+00 7.58048e-03 7.58048e-03 -4.47722e-04 - - FitP->Draw("mu:y>>I","i&&j&&abs(x)<40.5","prof") -root.exe [72] I->Fit(GG,"er","",0.3,6) - FCN=3798.34 FROM MINOS STATUS=SUCCESSFUL 25 CALLS 119 TOTAL - EDM=1.73946e-09 STRATEGY= 1 ERROR MATRIX ACCURATE - EXT PARAMETER STEP FIRST - NO. NAME VALUE ERROR SIZE DERIVATIVE - 1 p0 1.33585e-01 6.38740e-03 -3.01241e-05 2.44724e-03 - 2 p1 1.29436e+00 1.79433e-02 1.79433e-02 -2.11496e-03 - 1 p0 2.42155e-01 6.17075e-03 -3.49149e-05 2.97485e-03 - 2 p1 1.23716e+00 1.72556e-02 1.72556e-02 -2.32131e-03 -*/ - Int_t nrows = 2; - St_tpcCorrection *tableSet = new St_tpcCorrection("GatingGridB",nrows); - tpcCorrection_st row; - memset(&row,0,tableSet->GetRowSize()); - row.idx = 1; - row.nrows = nrows; - row.npar = 2; - row.a[0] = 2.85771e-01; // t0 - row.a[1] = 1.68566e+00; // settingTime - tableSet->AddAt(&row); // Outer - memset(&row,0,tableSet->GetRowSize()); - row.idx = 2; - row.nrows = nrows; - row.npar = 2; - row.a[0] = 2.42155e-01; // t0 - row.a[1] = 1.23716e+00; // settingTime - tableSet->AddAt(&row); // Outer - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tpc/GatingGridB.C b/StarDb/Calibrations/tpc/GatingGridB.C index 208936f0f59..3c89d31783e 100644 --- a/StarDb/Calibrations/tpc/GatingGridB.C +++ b/StarDb/Calibrations/tpc/GatingGridB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcCorrection")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGridB.y2018.C b/StarDb/Calibrations/tpc/GatingGridB.y2018.C index a34f69cc66a..f10e95db3ef 100644 --- a/StarDb/Calibrations/tpc/GatingGridB.y2018.C +++ b/StarDb/Calibrations/tpc/GatingGridB.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcCorrection")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGridB.y2019.C b/StarDb/Calibrations/tpc/GatingGridB.y2019.C index 208936f0f59..3c89d31783e 100644 --- a/StarDb/Calibrations/tpc/GatingGridB.y2019.C +++ b/StarDb/Calibrations/tpc/GatingGridB.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcCorrection")) return 0; /* diff --git a/StarDb/Calibrations/tpc/GatingGridB.y2022.C b/StarDb/Calibrations/tpc/GatingGridB.y2022.C new file mode 100644 index 00000000000..5c8d491363b --- /dev/null +++ b/StarDb/Calibrations/tpc/GatingGridB.y2022.C @@ -0,0 +1,25 @@ +#ifndef __CINT__ +#include "tables/St_tpcCorrection_Table.h" +#endif + +TDataSet *CreateTable() { + if (!TClass::GetClass("St_tpcCorrection")) return 0; +/* + Table: GatingGridB : parameters from Timothy Camarda, 08/09/21 + New Gating Grid for Run > 21: t0 = 240 ns, setting time = 2.0 us, tau = 2.0 / 4.6 = 435 ns. + setting time = time of reaching transperency 99% + tau = setting time/4.6 => exp(-4.6) = 1% + description: Gating Grid transperancy = 0, for t < t0, and 1 - exp(-(t-t0)/tau), for t > t0 +*/ + Int_t nrows = 1; + St_tpcCorrection *tableSet = new St_tpcCorrection("GatingGridB",nrows); + tpcCorrection_st row; + memset(&row,0,tableSet->GetRowSize()); + row.idx = 1; + row.nrows = nrows; + row.npar = 2; + row.a[0] = 0.24; // t0 + row.a[1] = 2.00; // settingTime + tableSet->AddAt(&row); // Outer + return (TDataSet *)tableSet; +} diff --git a/StarDb/Calibrations/tpc/TpcAccumulatedQ.C b/StarDb/Calibrations/tpc/TpcAccumulatedQ.C index 615712e2c61..c9dc3800c72 100644 --- a/StarDb/Calibrations/tpc/TpcAccumulatedQ.C +++ b/StarDb/Calibrations/tpc/TpcAccumulatedQ.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrection3MDF.C b/StarDb/Calibrations/tpc/TpcAdcCorrection3MDF.C index 521edfbce9a..4532895e970 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrection3MDF.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrection3MDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection3_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection3")) return 0; Int_t nrows = 1; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrection4MDF.C b/StarDb/Calibrations/tpc/TpcAdcCorrection4MDF.C index 48d80e360dd..e9cdb7b5739 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrection4MDF.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrection4MDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection4_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection4")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrection5MDF.C b/StarDb/Calibrations/tpc/TpcAdcCorrection5MDF.C index 51cca59885a..2ce107a2686 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrection5MDF.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrection5MDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection4_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection4")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrection6MDF.C b/StarDb/Calibrations/tpc/TpcAdcCorrection6MDF.C index 4df21dff983..b84bb093d4b 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrection6MDF.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrection6MDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection4_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection4")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrectionB.C b/StarDb/Calibrations/tpc/TpcAdcCorrectionB.C index fc3f8cad927..2bf5e242b3a 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrectionB.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrectionB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.TpcAdcCorrectionB/TpcAdcCorrectionB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrectionC.C b/StarDb/Calibrations/tpc/TpcAdcCorrectionC.C index fc922bc638f..f96e54e38f5 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrectionC.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrectionC.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrectionC.y2019.C b/StarDb/Calibrations/tpc/TpcAdcCorrectionC.y2019.C index 14ae5e8fe41..f2eb0c7ad51 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrectionC.y2019.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrectionC.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.TpcAdcCorrectionC/TpcAdcCorrectionC Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.C b/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.C index 33a25defa76..1f7dce88c49 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 1; diff --git a/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.r2019.C b/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.r2019.C index 33a25defa76..1f7dce88c49 100644 --- a/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.r2019.C +++ b/StarDb/Calibrations/tpc/TpcAdcCorrectionMDF.r2019.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 1; diff --git a/StarDb/Calibrations/tpc/TpcAdcI.C b/StarDb/Calibrations/tpc/TpcAdcI.C index ade649c6b9e..8fa3ffb781e 100644 --- a/StarDb/Calibrations/tpc/TpcAdcI.C +++ b/StarDb/Calibrations/tpc/TpcAdcI.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcAvgCurrent.C b/StarDb/Calibrations/tpc/TpcAvgCurrent.C index 7dc7433dbc7..b745790f80e 100644 --- a/StarDb/Calibrations/tpc/TpcAvgCurrent.C +++ b/StarDb/Calibrations/tpc/TpcAvgCurrent.C @@ -1,5 +1,7 @@ #include +#include "tables/St_TpcAvgCurrent_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_TpcAvgCurrent")) return 0; TpcAvgCurrent_st row; diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.20190609.132047.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.20190609.132047.C index 4e1ff1cb60f..cc1d68b2af7 100644 --- a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.20190609.132047.C +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.20190609.132047.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcAvgPowerSupply_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.TpcAvgPowerSupply/TpcAvgPowerSupply Allocated rows: 1 Used rows: 1 Row size: 2316 bytes diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2018.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2018.C index 77d6007c2a2..bfa7460fc84 100644 --- a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2018.C +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcAvgPowerSupply_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_TpcAvgPowerSupply")) return 0; TpcAvgPowerSupply_st row; diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2019.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2019.C index 68b5b4d82e4..5975c3912ed 100644 --- a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2019.C +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcAvgPowerSupply_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_TpcAvgPowerSupply")) return 0; TpcAvgPowerSupply_st row; diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2020.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2020.C index 68b5b4d82e4..5975c3912ed 100644 --- a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2020.C +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2020.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcAvgPowerSupply_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_TpcAvgPowerSupply")) return 0; TpcAvgPowerSupply_st row; diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2021.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2021.C index 68b5b4d82e4..5975c3912ed 100644 --- a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2021.C +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2021.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcAvgPowerSupply_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_TpcAvgPowerSupply")) return 0; TpcAvgPowerSupply_st row; diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2022.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2022.C new file mode 120000 index 00000000000..e825b23cd65 --- /dev/null +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2022.C @@ -0,0 +1 @@ +TpcAvgPowerSupply.y2021.C \ No newline at end of file diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2023.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2023.C new file mode 120000 index 00000000000..e825b23cd65 --- /dev/null +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2023.C @@ -0,0 +1 @@ +TpcAvgPowerSupply.y2021.C \ No newline at end of file diff --git a/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2024.C b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2024.C new file mode 120000 index 00000000000..e825b23cd65 --- /dev/null +++ b/StarDb/Calibrations/tpc/TpcAvgPowerSupply.y2024.C @@ -0,0 +1 @@ +TpcAvgPowerSupply.y2021.C \ No newline at end of file diff --git a/StarDb/Calibrations/tpc/TpcCurrentCorrectionX.C b/StarDb/Calibrations/tpc/TpcCurrentCorrectionX.C index 1ca6dead9e7..d4abdd17822 100644 --- a/StarDb/Calibrations/tpc/TpcCurrentCorrectionX.C +++ b/StarDb/Calibrations/tpc/TpcCurrentCorrectionX.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 192; diff --git a/StarDb/Calibrations/tpc/TpcDriftDistOxygen.C b/StarDb/Calibrations/tpc/TpcDriftDistOxygen.C index 01b9bd7498f..9f6b46b5cdd 100644 --- a/StarDb/Calibrations/tpc/TpcDriftDistOxygen.C +++ b/StarDb/Calibrations/tpc/TpcDriftDistOxygen.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // tpcCorrection! Allocated rows: 48 Used rows: 48 Row size: 16 bytes diff --git a/StarDb/Calibrations/tpc/TpcDriftVelRowCor.C b/StarDb/Calibrations/tpc/TpcDriftVelRowCor.C index f0245b165a5..ddaa4120676 100644 --- a/StarDb/Calibrations/tpc/TpcDriftVelRowCor.C +++ b/StarDb/Calibrations/tpc/TpcDriftVelRowCor.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcEdge.C b/StarDb/Calibrations/tpc/TpcEdge.C index c9719d4c4e6..d9ce92dcfec 100644 --- a/StarDb/Calibrations/tpc/TpcEdge.C +++ b/StarDb/Calibrations/tpc/TpcEdge.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcEffectivedX.C b/StarDb/Calibrations/tpc/TpcEffectivedX.C index 22fc298c253..d9bd1422e91 100644 --- a/StarDb/Calibrations/tpc/TpcEffectivedX.C +++ b/StarDb/Calibrations/tpc/TpcEffectivedX.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcEffectivedX_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_TpcEffectivedX")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcEtaCorrection.C b/StarDb/Calibrations/tpc/TpcEtaCorrection.C index f08b0b1634b..72d721d56e3 100644 --- a/StarDb/Calibrations/tpc/TpcEtaCorrection.C +++ b/StarDb/Calibrations/tpc/TpcEtaCorrection.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcEtaCorrection.y2019.C b/StarDb/Calibrations/tpc/TpcEtaCorrection.y2019.C index c43284e4b3d..196ab305ce5 100644 --- a/StarDb/Calibrations/tpc/TpcEtaCorrection.y2019.C +++ b/StarDb/Calibrations/tpc/TpcEtaCorrection.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcEtaCorrectionB.C b/StarDb/Calibrations/tpc/TpcEtaCorrectionB.C index 05e8ab3b9c2..f7d107aa728 100644 --- a/StarDb/Calibrations/tpc/TpcEtaCorrectionB.C +++ b/StarDb/Calibrations/tpc/TpcEtaCorrectionB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcLengthCorrectionB.C b/StarDb/Calibrations/tpc/TpcLengthCorrectionB.C index f5ac00d0a23..11c32b6bc29 100644 --- a/StarDb/Calibrations/tpc/TpcLengthCorrectionB.C +++ b/StarDb/Calibrations/tpc/TpcLengthCorrectionB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcLengthCorrectionMDF.C b/StarDb/Calibrations/tpc/TpcLengthCorrectionMDF.C index 5856ea826cb..cd7f4d92ae1 100644 --- a/StarDb/Calibrations/tpc/TpcLengthCorrectionMDF.C +++ b/StarDb/Calibrations/tpc/TpcLengthCorrectionMDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 6; diff --git a/StarDb/Calibrations/tpc/TpcLengthCorrectionMDN.C b/StarDb/Calibrations/tpc/TpcLengthCorrectionMDN.C index e631de8ee6f..7886885b2f5 100644 --- a/StarDb/Calibrations/tpc/TpcLengthCorrectionMDN.C +++ b/StarDb/Calibrations/tpc/TpcLengthCorrectionMDN.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; MDFCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcMultiplicity.C b/StarDb/Calibrations/tpc/TpcMultiplicity.C index 2f04c45ea74..05585076c7f 100644 --- a/StarDb/Calibrations/tpc/TpcMultiplicity.C +++ b/StarDb/Calibrations/tpc/TpcMultiplicity.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcPadCorrection.C b/StarDb/Calibrations/tpc/TpcPadCorrection.C index 0ff819cd10a..30b35ce060e 100644 --- a/StarDb/Calibrations/tpc/TpcPadCorrection.C +++ b/StarDb/Calibrations/tpc/TpcPadCorrection.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcPadCorrection_Table.h" + // $Id: TpcPadCorrection.C,v 1.1 2010/08/31 21:56:32 fisyak Exp $ TDataSet *CreateTable() { if (!TClass::GetClass("St_TpcPadCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.C b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.C index 31a102ab119..4c5b4866534 100644 --- a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.C +++ b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 48; diff --git a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2016.C b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2016.C index 31a102ab119..4c5b4866534 100644 --- a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2016.C +++ b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 48; diff --git a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2018.C b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2018.C index 31a102ab119..4c5b4866534 100644 --- a/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2018.C +++ b/StarDb/Calibrations/tpc/TpcPadCorrectionMDF.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_MDFCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_MDFCorrection")) return 0; Int_t nrows = 48; diff --git a/StarDb/Calibrations/tpc/TpcPadPedRMS.C b/StarDb/Calibrations/tpc/TpcPadPedRMS.C index be09f0ddb07..93681297de5 100644 --- a/StarDb/Calibrations/tpc/TpcPadPedRMS.C +++ b/StarDb/Calibrations/tpc/TpcPadPedRMS.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcPadPedRMS.y2022.C b/StarDb/Calibrations/tpc/TpcPadPedRMS.y2022.C index aada73cb626..8c9cb492141 100644 --- a/StarDb/Calibrations/tpc/TpcPadPedRMS.y2022.C +++ b/StarDb/Calibrations/tpc/TpcPadPedRMS.y2022.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcPhiDirection.C b/StarDb/Calibrations/tpc/TpcPhiDirection.C index 94c94436435..164644769d4 100644 --- a/StarDb/Calibrations/tpc/TpcPhiDirection.C +++ b/StarDb/Calibrations/tpc/TpcPhiDirection.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20141220.000000.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20141220.000000.C index a356cf91a09..c196b08b208 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20141220.000000.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20141220.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20141220.000000.C,v 1.1 2017/05/25 15:32:05 fisyak Exp $ // $Log: TpcResponseSimulator.20141220.000000.C,v $ // Revision 1.1 2017/05/25 15:32:05 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000001.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000001.C index b4c621bdfdd..e2536582790 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000001.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20151220.000001.C,v 1.1 2017/05/20 00:54:00 fisyak Exp $ // $Log: TpcResponseSimulator.20151220.000001.C,v $ // Revision 1.1 2017/05/20 00:54:00 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000002.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000002.C index 283c1c7d83f..06ad701b855 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000002.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20151220.000002.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20151220.000002.C,v 1.1 2017/08/08 21:37:17 fisyak Exp $ // $Log: TpcResponseSimulator.20151220.000002.C,v $ // Revision 1.1 2017/08/08 21:37:17 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20171220.000001.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20171220.000001.C index 18885c5bc36..1e8c28cd44c 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20171220.000001.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20171220.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.TpcResponseSimulator/TpcResponseSimulator Allocated rows: 1 Used rows: 1 Row size: 124 bytes diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071405.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071405.C index 5cd1a2e3262..68ed4178d0f 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071405.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071405.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20180531.071405.C,v 1.2 2020/05/23 20:57:26 fisyak Exp $ // $Log: TpcResponseSimulator.20180531.071405.C,v $ // Revision 1.2 2020/05/23 20:57:26 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071409.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071409.C index 675c3ff7fe8..8072dc5288b 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071409.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071409.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20180531.071409.C,v 1.2 2020/07/08 17:12:39 fisyak Exp $ // $Log: TpcResponseSimulator.20180531.071409.C,v $ // Revision 1.2 2020/07/08 17:12:39 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071410.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071410.C index 4a7d6ae8efc..fc3ded0598b 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071410.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180531.071410.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20180531.071410.C,v 1.1 2021/05/10 21:02:56 fisyak Exp $ // $Log: TpcResponseSimulator.20180531.071410.C,v $ // Revision 1.1 2021/05/10 21:02:56 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180605.071409.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180605.071409.C index 18661eb97bc..662ca1c337a 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.20180605.071409.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.20180605.071409.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.20171220.000001.C,v 1.1 2019/10/09 20:40:02 iraklic Exp $ // $Log: TpcResponseSimulator.20171220.000001.C,v $ // Revision 1.1 2019/10/09 20:40:02 iraklic diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.C index ec9ce26e023..8bc9d3c1d94 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.C,v 1.15 2018/10/17 20:45:17 fisyak Exp $ // $Log: TpcResponseSimulator.C,v $ // Revision 1.15 2018/10/17 20:45:17 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.r2019.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.r2019.C index 7d14af930d4..33d5bfb0435 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.r2019.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.r2019.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2019.C,v 1.4 2020/04/03 23:47:14 fisyak Exp $ // $Log: TpcResponseSimulator.y2019.C,v $ // Revision 1.4 2020/04/03 23:47:14 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2005.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2005.C index d84ced8fe50..a9e58087376 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2005.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2005.C,v 1.1 2018/12/16 20:37:45 fisyak Exp $ // $Log: TpcResponseSimulator.y2005.C,v $ // Revision 1.1 2018/12/16 20:37:45 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2009.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2009.C index 87f3302b60b..db812e6a379 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2009.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2009.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2009.C,v 1.13 2014/03/16 20:17:36 fisyak Exp $ // $Log: TpcResponseSimulator.y2009.C,v $ // Revision 1.13 2014/03/16 20:17:36 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2010.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2010.C index a6291e4962b..b27b8cc8bbd 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2010.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2010.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2010.C,v 1.16 2018/12/09 23:21:53 fisyak Exp $ // $Log: TpcResponseSimulator.y2010.C,v $ // Revision 1.16 2018/12/09 23:21:53 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2011.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2011.C index d8f794fce33..88583ec2839 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2011.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2011.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2011.C,v 1.12 2018/12/09 23:21:53 fisyak Exp $ // $Log: TpcResponseSimulator.y2011.C,v $ // Revision 1.12 2018/12/09 23:21:53 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2012.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2012.C index 9ad166151a4..0100781f9f7 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2012.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2012.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2012.C,v 1.3 2013/11/08 16:18:25 fisyak Exp $ // $Log: TpcResponseSimulator.y2012.C,v $ // Revision 1.3 2013/11/08 16:18:25 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2013.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2013.C index 4abba2f57a2..cd07abad291 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2013.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2013.C,v 1.1 2014/01/09 23:15:10 fisyak Exp $ // $Log: TpcResponseSimulator.y2013.C,v $ // Revision 1.1 2014/01/09 23:15:10 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2014.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2014.C index b729b06a661..9ef0d19d037 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2014.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2014.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2014.C,v 1.1 2016/09/19 12:25:07 fisyak Exp $ // $Log: TpcResponseSimulator.y2014.C,v $ // Revision 1.1 2016/09/19 12:25:07 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2015.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2015.C index 1379ba2eb9a..eb8c15a8512 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2015.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2015.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2015.C,v 1.1 2016/09/19 12:25:07 fisyak Exp $ // $Log: TpcResponseSimulator.y2015.C,v $ // Revision 1.1 2016/09/19 12:25:07 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2016.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2016.C index a9aa08bf669..112f360b956 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2016.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2016.C,v 1.3 2017/08/08 21:37:17 fisyak Exp $ // $Log: TpcResponseSimulator.y2016.C,v $ // Revision 1.3 2017/08/08 21:37:17 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2017.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2017.C index 439c3b878ee..298b9f71e10 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2017.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2017.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2017.C,v 1.3 2018/12/09 23:21:53 fisyak Exp $ // $Log: TpcResponseSimulator.y2017.C,v $ // Revision 1.3 2018/12/09 23:21:53 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2018.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2018.C index 0b086acf746..dddc296a3e7 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2018.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2018.C,v 1.4 2020/04/27 21:20:13 fisyak Exp $ // $Log: TpcResponseSimulator.y2018.C,v $ // Revision 1.4 2020/04/27 21:20:13 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2019.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2019.C index 46055946842..85712d0ffab 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2019.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2019.C,v 1.4 2020/04/03 23:47:14 fisyak Exp $ // $Log: TpcResponseSimulator.y2019.C,v $ // Revision 1.4 2020/04/03 23:47:14 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2020.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2020.C index 2edd3f9ff03..c29461d8192 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2020.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2020.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2020.C,v 1.1 2021/05/10 21:02:56 fisyak Exp $ // $Log: TpcResponseSimulator.y2020.C,v $ // Revision 1.1 2021/05/10 21:02:56 fisyak diff --git a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2021.C b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2021.C index c4f131c8c0c..4573d674acc 100644 --- a/StarDb/Calibrations/tpc/TpcResponseSimulator.y2021.C +++ b/StarDb/Calibrations/tpc/TpcResponseSimulator.y2021.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcResponseSimulator_Table.h" + // $Id: TpcResponseSimulator.y2021.C,v 1.1 2021/05/10 21:02:56 fisyak Exp $ // $Log: TpcResponseSimulator.y2021.C,v $ // Revision 1.1 2021/05/10 21:02:56 fisyak diff --git a/StarDb/Calibrations/tpc/TpcRowQ.C b/StarDb/Calibrations/tpc/TpcRowQ.C index 1d9bb0d5115..257046e905c 100644 --- a/StarDb/Calibrations/tpc/TpcRowQ.C +++ b/StarDb/Calibrations/tpc/TpcRowQ.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcSecRowB.C b/StarDb/Calibrations/tpc/TpcSecRowB.C index 856ef9bdf9e..b5420ab9928 100644 --- a/StarDb/Calibrations/tpc/TpcSecRowB.C +++ b/StarDb/Calibrations/tpc/TpcSecRowB.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcSecRowCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // TpcSecRow Allocated rows: 24 Used rows: 24 Row size: 360 bytes diff --git a/StarDb/Calibrations/tpc/TpcSecRowB.y2018.C b/StarDb/Calibrations/tpc/TpcSecRowB.y2018.C index 8037c09ee18..65b59338699 100644 --- a/StarDb/Calibrations/tpc/TpcSecRowB.y2018.C +++ b/StarDb/Calibrations/tpc/TpcSecRowB.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcSecRowCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // TpcSecRow Allocated rows: 24 Used rows: 24 Row size: 360 bytes diff --git a/StarDb/Calibrations/tpc/TpcSecRowB.y2019.C b/StarDb/Calibrations/tpc/TpcSecRowB.y2019.C index 8037c09ee18..65b59338699 100644 --- a/StarDb/Calibrations/tpc/TpcSecRowB.y2019.C +++ b/StarDb/Calibrations/tpc/TpcSecRowB.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_TpcSecRowCor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // TpcSecRow Allocated rows: 24 Used rows: 24 Row size: 360 bytes diff --git a/StarDb/Calibrations/tpc/TpcSpaceCharge.C b/StarDb/Calibrations/tpc/TpcSpaceCharge.C index 2405bb04919..f50448476db 100644 --- a/StarDb/Calibrations/tpc/TpcSpaceCharge.C +++ b/StarDb/Calibrations/tpc/TpcSpaceCharge.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcTanL.C b/StarDb/Calibrations/tpc/TpcTanL.C index 663c42ce288..40f23f709ff 100644 --- a/StarDb/Calibrations/tpc/TpcTanL.C +++ b/StarDb/Calibrations/tpc/TpcTanL.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcZCorrectionB.C b/StarDb/Calibrations/tpc/TpcZCorrectionB.C index 9fa97192999..13ce16afa2b 100644 --- a/StarDb/Calibrations/tpc/TpcZCorrectionB.C +++ b/StarDb/Calibrations/tpc/TpcZCorrectionB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcZCorrectionC.C b/StarDb/Calibrations/tpc/TpcZCorrectionC.C index 53651562fe6..29ea7d86348 100644 --- a/StarDb/Calibrations/tpc/TpcZCorrectionC.C +++ b/StarDb/Calibrations/tpc/TpcZCorrectionC.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcZDC.C b/StarDb/Calibrations/tpc/TpcZDC.C index 30ffe2109e9..4445f80f79c 100644 --- a/StarDb/Calibrations/tpc/TpcZDC.C +++ b/StarDb/Calibrations/tpc/TpcZDC.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcdCharge.C b/StarDb/Calibrations/tpc/TpcdCharge.C index 559412a4833..83fa2efcca8 100644 --- a/StarDb/Calibrations/tpc/TpcdCharge.C +++ b/StarDb/Calibrations/tpc/TpcdCharge.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/TpcdEdxCor.C b/StarDb/Calibrations/tpc/TpcdEdxCor.C index 29ee0e95407..1db4b0fd728 100644 --- a/StarDb/Calibrations/tpc/TpcdEdxCor.C +++ b/StarDb/Calibrations/tpc/TpcdEdxCor.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // Ad hoc accont of saturation in dE/dx if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcdXCorrectionB.C b/StarDb/Calibrations/tpc/TpcdXCorrectionB.C index 8d6d0e20088..87798a5ca5e 100644 --- a/StarDb/Calibrations/tpc/TpcdXCorrectionB.C +++ b/StarDb/Calibrations/tpc/TpcdXCorrectionB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/TpcdXdY.C b/StarDb/Calibrations/tpc/TpcdXdY.C index 8257d609216..cf38efe035b 100644 --- a/StarDb/Calibrations/tpc/TpcdXdY.C +++ b/StarDb/Calibrations/tpc/TpcdXdY.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcdZdY.C b/StarDb/Calibrations/tpc/TpcdZdY.C index 93866fcfd96..5f66fa4ae47 100644 --- a/StarDb/Calibrations/tpc/TpcdZdY.C +++ b/StarDb/Calibrations/tpc/TpcdZdY.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcnPad.C b/StarDb/Calibrations/tpc/TpcnPad.C index 94776b54cc6..2f9baa82704 100644 --- a/StarDb/Calibrations/tpc/TpcnPad.C +++ b/StarDb/Calibrations/tpc/TpcnPad.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcnPad.y2019.C b/StarDb/Calibrations/tpc/TpcnPad.y2019.C index 1d725942599..36786a650ff 100644 --- a/StarDb/Calibrations/tpc/TpcnPad.y2019.C +++ b/StarDb/Calibrations/tpc/TpcnPad.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 1; diff --git a/StarDb/Calibrations/tpc/TpcnTbk.C b/StarDb/Calibrations/tpc/TpcnTbk.C index a4511d60c84..7e5d984757b 100644 --- a/StarDb/Calibrations/tpc/TpcnTbk.C +++ b/StarDb/Calibrations/tpc/TpcnTbk.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; Int_t nrows = 2; diff --git a/StarDb/Calibrations/tpc/TpcrCharge.C b/StarDb/Calibrations/tpc/TpcrCharge.C index 7a724070886..623e3101e02 100644 --- a/StarDb/Calibrations/tpc/TpcrCharge.C +++ b/StarDb/Calibrations/tpc/TpcrCharge.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/itpcDeadFEE.20190416.035540.C b/StarDb/Calibrations/tpc/itpcDeadFEE.20190416.035540.C index 5dec20f43bb..44bca66e6a2 100644 --- a/StarDb/Calibrations/tpc/itpcDeadFEE.20190416.035540.C +++ b/StarDb/Calibrations/tpc/itpcDeadFEE.20190416.035540.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcDeadFEE_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_itpcDeadFEE")) return 0; diff --git a/StarDb/Calibrations/tpc/itpcDeadFEE.20190624.011700.C b/StarDb/Calibrations/tpc/itpcDeadFEE.20190624.011700.C index 644f5d41793..4a25b393985 100644 --- a/StarDb/Calibrations/tpc/itpcDeadFEE.20190624.011700.C +++ b/StarDb/Calibrations/tpc/itpcDeadFEE.20190624.011700.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcDeadFEE_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_itpcDeadFEE")) return 0; diff --git a/StarDb/Calibrations/tpc/itpcDeadFEE.C b/StarDb/Calibrations/tpc/itpcDeadFEE.C index f908c22cb00..6b7e211fcb9 100644 --- a/StarDb/Calibrations/tpc/itpcDeadFEE.C +++ b/StarDb/Calibrations/tpc/itpcDeadFEE.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcDeadFEE_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_itpcDeadFEE")) return 0; diff --git a/StarDb/Calibrations/tpc/itpcPadGainT0.C b/StarDb/Calibrations/tpc/itpcPadGainT0.C index faf0370358a..e62ddadbf66 100644 --- a/StarDb/Calibrations/tpc/itpcPadGainT0.C +++ b/StarDb/Calibrations/tpc/itpcPadGainT0.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_itpcPadGainT0")) return 0; itpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/itpcPadGainT0.y2018.C b/StarDb/Calibrations/tpc/itpcPadGainT0.y2018.C index faf0370358a..e62ddadbf66 100644 --- a/StarDb/Calibrations/tpc/itpcPadGainT0.y2018.C +++ b/StarDb/Calibrations/tpc/itpcPadGainT0.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_itpcPadGainT0")) return 0; itpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/itpcPadGainT0.y2019.C b/StarDb/Calibrations/tpc/itpcPadGainT0.y2019.C index faf0370358a..e62ddadbf66 100644 --- a/StarDb/Calibrations/tpc/itpcPadGainT0.y2019.C +++ b/StarDb/Calibrations/tpc/itpcPadGainT0.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_itpcPadGainT0")) return 0; itpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/itpcPadGainT0.y2020.C b/StarDb/Calibrations/tpc/itpcPadGainT0.y2020.C index faf0370358a..e62ddadbf66 100644 --- a/StarDb/Calibrations/tpc/itpcPadGainT0.y2020.C +++ b/StarDb/Calibrations/tpc/itpcPadGainT0.y2020.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_itpcPadGainT0")) return 0; itpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/itpcRDOMap.C b/StarDb/Calibrations/tpc/itpcRDOMap.C index b182ca48785..b5bad3ebe54 100644 --- a/StarDb/Calibrations/tpc/itpcRDOMap.C +++ b/StarDb/Calibrations/tpc/itpcRDOMap.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOMap_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOMap")) return 0; diff --git a/StarDb/Calibrations/tpc/starTriggerDelay.C b/StarDb/Calibrations/tpc/starTriggerDelay.C new file mode 120000 index 00000000000..78052916102 --- /dev/null +++ b/StarDb/Calibrations/tpc/starTriggerDelay.C @@ -0,0 +1 @@ +starTriggerDelay.y2019.C \ No newline at end of file diff --git a/StarDb/Calibrations/tpc/starTriggerDelay.y2019.C b/StarDb/Calibrations/tpc/starTriggerDelay.y2019.C index 44fcce6bb46..47ed4e84ebf 100644 --- a/StarDb/Calibrations/tpc/starTriggerDelay.y2019.C +++ b/StarDb/Calibrations/tpc/starTriggerDelay.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_starTriggerDelay_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/RunLog/onl/.starTriggerDelay/starTriggerDelay Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/Calibrations/tpc/tpcAcCharge.C b/StarDb/Calibrations/tpc/tpcAcCharge.C index 6de675f198e..e630afbd3e3 100644 --- a/StarDb/Calibrations/tpc/tpcAcCharge.C +++ b/StarDb/Calibrations/tpc/tpcAcCharge.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAcCharge_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAcCharge")) return 0; tpcAcCharge_st row = {0,0}; diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.20080219.143436.C b/StarDb/Calibrations/tpc/tpcAltroParams.20080219.143436.C index 6acf55f7cec..a5cf8f83322 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.20080219.143436.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.20080219.143436.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.20180426.121919.C b/StarDb/Calibrations/tpc/tpcAltroParams.20180426.121919.C index 5d4b58bc2e2..db9bf78feb8 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.20180426.121919.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.20180426.121919.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.20180426.124701.C b/StarDb/Calibrations/tpc/tpcAltroParams.20180426.124701.C index b183f262347..6d02f52fcf7 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.20180426.124701.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.20180426.124701.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.C b/StarDb/Calibrations/tpc/tpcAltroParams.C index ab9a2086e92..b58654aa233 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2008.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2008.C index bfaf1f2004d..229fda77003 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2008.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2008.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2009.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2009.C index 2a5daf00e24..41cb512cca9 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2009.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2009.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2010.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2010.C index 5d4b58bc2e2..db9bf78feb8 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2010.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2010.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; St_tpcAltroParams *tableSet = new St_tpcAltroParams("tpcAltroParams",24); diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2016.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2016.C index b183f262347..6d02f52fcf7 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2016.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2019.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2019.C index 86bd09bb2ba..97253b7179a 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2019.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2020.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2020.C index 378a91fefd6..03eb3d61c13 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2020.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2020.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcAltroParams.y2021.C b/StarDb/Calibrations/tpc/tpcAltroParams.y2021.C index 226a589dd7c..c02777597f7 100644 --- a/StarDb/Calibrations/tpc/tpcAltroParams.y2021.C +++ b/StarDb/Calibrations/tpc/tpcAltroParams.y2021.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAltroParams_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAltroParams")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcAnodeHV.C b/StarDb/Calibrations/tpc/tpcAnodeHV.C index bd457f98a68..a1e580704e2 100644 --- a/StarDb/Calibrations/tpc/tpcAnodeHV.C +++ b/StarDb/Calibrations/tpc/tpcAnodeHV.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAnodeHV_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAnodeHV")) return 0; St_tpcAnodeHV *tableSet = new St_tpcAnodeHV("tpcAnodeHV",19*24); diff --git a/StarDb/Calibrations/tpc/tpcAnodeHVavg.C b/StarDb/Calibrations/tpc/tpcAnodeHVavg.C index cd780ba4a9a..4daaba525a6 100644 --- a/StarDb/Calibrations/tpc/tpcAnodeHVavg.C +++ b/StarDb/Calibrations/tpc/tpcAnodeHVavg.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAnodeHVavg_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAnodeHVavg")) return 0; St_tpcAnodeHVavg *tableSet = new St_tpcAnodeHVavg("tpcAnodeHVavg",19*24); diff --git a/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2018.C b/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2018.C index b31f03a731c..7d336d0441d 100644 --- a/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2018.C +++ b/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAnodeHVavg_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAnodeHVavg")) return 0; St_tpcAnodeHVavg *tableSet = new St_tpcAnodeHVavg("tpcAnodeHVavg",19*24); diff --git a/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2019.C b/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2019.C index b31f03a731c..7d336d0441d 100644 --- a/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2019.C +++ b/StarDb/Calibrations/tpc/tpcAnodeHVavg.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAnodeHVavg_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAnodeHVavg")) return 0; St_tpcAnodeHVavg *tableSet = new St_tpcAnodeHVavg("tpcAnodeHVavg",19*24); diff --git a/StarDb/Calibrations/tpc/tpcAvCurrent.C b/StarDb/Calibrations/tpc/tpcAvCurrent.C index f33ce8e9bba..3630fb9f5a4 100644 --- a/StarDb/Calibrations/tpc/tpcAvCurrent.C +++ b/StarDb/Calibrations/tpc/tpcAvCurrent.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcAvCurrent_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcAvCurrent")) return 0; tpcAvCurrent_st row; diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.C index 2ade69b15f9..e947df2eef0 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2016.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2016.C index 36b5868c83c..8da64a31450 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2016.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2017.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2017.C index 36b5868c83c..8da64a31450 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2017.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2017.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2018.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2018.C index e708b4d0407..057b77bde7c 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2018.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2019.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2019.C index efeaa5c149b..a7dd63a6963 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2019.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2020.C b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2020.C index 971ec3d9897..535fa9424a7 100644 --- a/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2020.C +++ b/StarDb/Calibrations/tpc/tpcBXT0CorrEPD.y2020.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcBXT0Corr_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcPressureB/tpcPressureB Allocated rows: 50 Used rows: 50 Row size: 120 bytes diff --git a/StarDb/Calibrations/tpc/tpcDriftVelocity.C b/StarDb/Calibrations/tpc/tpcDriftVelocity.C index 71328de3a10..e75c6e7ba2b 100644 --- a/StarDb/Calibrations/tpc/tpcDriftVelocity.C +++ b/StarDb/Calibrations/tpc/tpcDriftVelocity.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcDriftVelocity_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcDriftVelocity")) return 0; tpcDriftVelocity_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.C b/StarDb/Calibrations/tpc/tpcElectronics.C index ff7e83d42fd..2c2a7fc53ec 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2001.C b/StarDb/Calibrations/tpc/tpcElectronics.y2001.C index ff7e83d42fd..2c2a7fc53ec 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2001.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2003.C b/StarDb/Calibrations/tpc/tpcElectronics.y2003.C index ff7e83d42fd..2c2a7fc53ec 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2003.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2003.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2004.C b/StarDb/Calibrations/tpc/tpcElectronics.y2004.C index ff7e83d42fd..2c2a7fc53ec 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2004.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2004.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2005.C b/StarDb/Calibrations/tpc/tpcElectronics.y2005.C index ff7e83d42fd..2c2a7fc53ec 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2005.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2006.C b/StarDb/Calibrations/tpc/tpcElectronics.y2006.C index 5805cedc55f..43d191ddccc 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2006.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2007.C b/StarDb/Calibrations/tpc/tpcElectronics.y2007.C index 5805cedc55f..43d191ddccc 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2007.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2008.C b/StarDb/Calibrations/tpc/tpcElectronics.y2008.C index 5805cedc55f..43d191ddccc 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2008.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2008.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcElectronics.y2019.C b/StarDb/Calibrations/tpc/tpcElectronics.y2019.C index 5805cedc55f..43d191ddccc 100644 --- a/StarDb/Calibrations/tpc/tpcElectronics.y2019.C +++ b/StarDb/Calibrations/tpc/tpcElectronics.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcElectronics_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcElectronics")) return 0; tpcElectronics_st row; diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.C index c8fb88fefe0..aca8b671c52 100644 --- a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.C +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcExtraGainCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcExtraGainCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2019.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2019.C new file mode 100644 index 00000000000..797ce75b782 --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2019.C @@ -0,0 +1,44 @@ +TDataSet *CreateTable() { + // ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_tpcExtraGainCorrection")) return 0; + Int_t nrows = 24; + St_tpcExtraGainCorrection *tableSet = new St_tpcExtraGainCorrection("tpcExtraGainCorrection",nrows); + tpcExtraGainCorrection_st row[24] = { + /* runs S r p1 p2 rdo fee status beginTime, endTime */ + // y2019 + { 0, 0, 20105037, 20107001,19, -1, -1, -1, 3, 17, 0}, /* Dead S19_F17 20190416.035540 20190417.040924 */ + { 0, 0, 20062048, 20077035,10, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 20062048, 20077035, 4, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 20074001, 20074001,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 iold = 64 */ + { 0, 0, 20074001, 20074001,24, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 iold = 64 */ + { 0, 0, 20074001, 20074001,24, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 iold = 64 */ + { 0, 0, 20078030, 20102004,10, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 20078030, 20102004, 4, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 20124077, 20126029,18, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 iold = 177 */ + { 0, 0, 20137011, 20137011,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 20169029, 20170002,20, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 26*/ + { 0, 0, 20170008, 20196017,10, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 20170008, 20196017, 4, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 20170008, 20196017,20, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 20174045, 20175028, 5, 55, 30, 45, 6, 0, 0}, /* Dead 20190624.011700 20190624.124959 */ + { 0, 0, 20174045, 20175028, 5, 56, 30, 45, 6, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 20196006, 20196017,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 6*/ + { 0, 0, 20342006, 20342006,21, -1, -1, -1, 1, 47, 0}, /* Dead */ + { 0, 0, 20344045, 21258004,21, -1, -1, -1, 1, 47, 0}, /* Dead S21_F47 20191210.162105 20200914.081917 */ + { 0, 0, 20348016, 20348022,14, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 5*/ + { 0, 0, 20354003, 20354005,12, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 20354050, 20355013,12, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 19*/ + { 0, 0, 20354050, 20355021,12, -1, -1, -1,-1, 0, 0}, /* Dead nruns = 21*/ + { 0, 0, 20356015, 20356039,20, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 14*/ + }; + for (Int_t i = 0; i < nrows; i++) { + row[i].idx = i+1; + row[i].nrows = nrows; + tableSet->AddAt(&row[i]); + } + // tableSet->Print(0,nrows); + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} + + diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2020.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2020.C new file mode 100644 index 00000000000..a0a74ffa35a --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2020.C @@ -0,0 +1,751 @@ +TDataSet *CreateTable() { + // ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_tpcExtraGainCorrection")) return 0; + Int_t nrows = 694; + St_tpcExtraGainCorrection *tableSet = new St_tpcExtraGainCorrection("tpcExtraGainCorrection",nrows); + tpcExtraGainCorrection_st row[694] = { + // y2020 + { 0, 0, 20344045, 21258004,21, -1, -1, -1, 1, 47, 0}, /* Dead S21_F47 20191210.162105 20200914.081917 */ + + { 0, 0, 20348016, 20348022,14, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 5*/ + { 0, 0, 20354003, 20354005,12, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 3 dead sector 12*/ + { 0, 0, 20356015, 20356039,20, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 14*/ + + { 0, 0, 21069008, 21069014,14, -1, -1, -1, 4, 27, 1}, /* Alive nruns = 6 */ + + { 0, 0, 21004008, 21008016,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 144*/ + { 0, 0, 21028024, 21028028, 2, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 iold = 1301 */ + { 0, 0, 21029027, 21030001, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 14*/ + + { 0, 0, 21037017, 21037017,16, 39, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21037017, 21037017,16, 40, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + + { 0, 0, 21037047, 21038033,12, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 28 dead all sector*/ + { 0, 0, 21038035, 21038041,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5*/ + { 0, 0, 21038035, 21039011,12, -1, -1, -1,-1, -1, 0}, /* Dead whole sector 12 nruns = 23*/ + { 0, 0, 21039013, 21039041,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 18*/ + { 0, 0, 21039043, 21041013,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 53*/ + { 0, 0, 21039043, 21042020,12, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 83 whole sector is dead */ + { 0, 0, 21040042, 21041006,16, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 8 iold = 1600 whole sector is dead */ +#if 0 + { 0, 0, 21044028, 21045023,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 34*/ + { 0, 0, 21045038, 21046002,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 21046006, 21053059,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 213*/ + { 0, 0, 21050063, 21053059,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 148*/ + { 0, 0, 21055035, 21055037,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 21056002, 21056002,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ +#endif +#if 0 + { 0, 0, 21044028, 21058020,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 34*/ + { 0, 0, 21045025, 21046005,10, -1, -1, -1, 4, -1, 1}, /* Alive nruns = 1 */ +#endif + { 0, 0, 21044028, 21045024,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 34*/ + // 21058020 problem V inner = 615V and V outer = 805 V + { 0, 0, 21046006, 21058019,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 34*/ + { 0, 0, 21050047, 21058019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 158*/ + + { 0, 0, 21058025, 21060019,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 32*/ + { 0, 0, 21058025, 21060019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 32*/ + + { 0, 0, 21060022, 21062015,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 51*/ + + { 0, 0, 21060022, 21063008,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 73*/ + { 0, 0, 21060005, 21060005,16, 39, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21060005, 21060005,16, 40, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + // 21062015 Low Voltage + { 0, 0, 21063004, 21063008,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 21063010, 21066025,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 84*/ + { 0, 0, 21063010, 21066025,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 84*/ + { 0, 0, 21066029, 21073021,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 145*/ + + { 0, 0, 21067021, 21067021,14, 17, 10, 24, 2, 36, 0}, /* Dead */ + { 0, 0, 21067021, 21067021,14, 18, 10, 19, 2, 36, 0}, /* Dead */ + + { 0, 0, 21069008, 21069014,14, -1, -1, -1, 4, 27, 1}, /* Alive nruns = 6 iold = 3105 */ + + { 0, 0, 21069014, 21069020,21, -1, -1, -1, 1, 54, 1}, /* Alive nruns = 4*/ + { 0, 0, 21069017, 21069017,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + + { 0, 0, 21070014, 21072010,18, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 41 iold = 2581 */ + { 0, 0, 21071013, 21071013, 9, -1, -1, -1, 4, 4, 0}, /* Dead nruns = 1*/ + { 0, 0, 21071014, 21073021,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 28*/ + { 0, 0, 21073025, 21077002,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 104*/ + { 0, 0, 21073025, 21077002,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 104*/ + + { 0, 0, 21176027, 21177012,11, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 11*/ + + { 0, 0, 21076029, 21076029,20, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21076029, 21076029,20, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21076029, 21076029,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21076029, 21076029,20, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + + { 0, 0, 21077004, 21078013,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 29*/ + { 0, 0, 21077004, 21080022,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 102*/ + { 0, 0, 21078014, 21078014, 9, -1, -1, -1, 4, 4, 0}, /* Dead */ + { 0, 0, 21078015, 21080022,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 72*/ + { 0, 0, 21080027, 21169035,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 21080027, 21169035,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + + { 0, 0, 21243033, 21244023,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 27 */ + { 0, 0, 21243033, 21244023,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 27 */ + { 0, 0, 21243033, 21244023,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 27 */ + { 0, 0, 21243033, 21243034,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + + { 0, 0, 21243033, 21243042,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21243033, 21243044,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21243033, 21243044,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21243033, 21243048,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21243033, 21244023,13, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 27 */ + { 0, 0, 21243033, 21244023,13, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 27 */ + { 0, 0, 21243033, 21244023,13, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 27 */ + + { 0, 0, 21243034, 21243034,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243034, 21243044,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243038, 21243042,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243038, 21243042,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243038, 21243042,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243038, 21243042,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243038, 21243042,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243043, 21243047,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243043, 21243047,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243043, 21243047,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243043, 21243047,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243044, 21243047,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21243044, 21243048,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243045, 21243045,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243045, 21243045,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243045, 21243045,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243046, 21243048,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21243046, 21243049,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21243046, 21244013,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 17 */ + { 0, 0, 21243047, 21243047,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243047, 21243048,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243047, 21243048,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21243049, 21243049,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21243050, 21244004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243050, 21244004,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21243050, 21244013,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 13 */ + { 0, 0, 21243050, 21244013,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 13 */ + { 0, 0, 21244001, 21244001,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244001, 21244006,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21244002, 21244004,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244002, 21244004,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244003, 21244004,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244003, 21244009,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21244007, 21244008,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244007, 21244008,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244007, 21244008,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244007, 21244008,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244007, 21244009,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244008, 21244012,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21244010, 21244014,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21244011, 21244014,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21244011, 21244014,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21244011, 21244022,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21244012, 21244014,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244012, 21244014,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244014, 21244023,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244022, 21244023,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244022, 21244023,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244022, 21244023,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244023, 21244023,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244023, 21244023,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244023, 21244023,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244025, 21244025,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244025, 21244025,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244025, 21244026,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244025, 21244026,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244025, 21244028,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21244025, 21245001,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 12 */ + { 0, 0, 21244025, 21247010,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 32 */ + { 0, 0, 21244025, 21249016,13, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244025, 21249016,13, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244025, 21249016,13, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244025, 21249016,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244025, 21249016,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244025, 21249016,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 89 */ + { 0, 0, 21244026, 21244026,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244026, 21244026,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244026, 21247017,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 36 */ + { 0, 0, 21244027, 21244029,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244027, 21244032,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21244028, 21244028,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244028, 21244029,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244028, 21244031,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21244028, 21244032,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21244031, 21244031,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244031, 21244031,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244031, 21244033,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244032, 21244036,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21244033, 21244033,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21244033, 21244034,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244033, 21244034,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21244034, 21245001,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244034, 21245001,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21244036, 21244036,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21245001, 21245005,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21245001, 21245006,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21245005, 21245008,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21245006, 21245008,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21245006, 21246015,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21245006, 21247010,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 19 */ + { 0, 0, 21245008, 21245008,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21245008, 21245008,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21245008, 21245008,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21245008, 21245009,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21245010, 21245010,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21245010, 21247004,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21246013, 21246013,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21246018, 21246018,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21246018, 21246025,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21246018, 21247001,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21246018, 21247002,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21246025, 21246025,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21246025, 21246025,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247001, 21247001,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247002, 21247004,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21247002, 21247006,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21247003, 21247004,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247003, 21247004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247004, 21247004,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247006, 21247007,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247006, 21247007,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247006, 21247007,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247006, 21247009,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247006, 21247009,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247007, 21247007,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247008, 21247010,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21247009, 21247009,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247009, 21247009,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247009, 21247010,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247009, 21247010,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247012, 21247013,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247013, 21247013,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247013, 21247017,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247013, 21247017,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247013, 21247017,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247013, 21247017,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247014, 21247015,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247015, 21247015,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247015, 21247015,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247015, 21247017,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247017, 21247017,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247019, 21247019,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247019, 21247020,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247019, 21247020,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247019, 21247020,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247019, 21247020,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247019, 21247027,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247019, 21247027,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21247020, 21247025,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247020, 21247025,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247025, 21247025,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247027, 21247035,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21247027, 21248015,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 17 */ + { 0, 0, 21247027, 21248026,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 26 */ + { 0, 0, 21247030, 21247032,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247030, 21247033,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21247030, 21247033,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21247032, 21247033,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247032, 21247033,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247033, 21247035,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21247034, 21247034,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247034, 21247035,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21247035, 21247035,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21247035, 21247035,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248002, 21248002,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248002, 21248002,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248002, 21248011,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21248002, 21248011,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21248003, 21248004,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248003, 21248004,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248004, 21248004,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248004, 21248004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248004, 21248006,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248004, 21248008,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21248007, 21248007,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248007, 21248007,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248007, 21248008,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248007, 21248008,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248009, 21248009,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248009, 21248011,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248010, 21248010,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248010, 21248011,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248011, 21248017,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248015, 21248020,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21248017, 21248017,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248017, 21248017,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248017, 21248017,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248017, 21248020,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248017, 21248021,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21248018, 21248026,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21248018, 21248026,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21248020, 21248021,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248020, 21248021,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248020, 21248022,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248020, 21248023,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21248022, 21248023,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248022, 21248023,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248023, 21248023,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248024, 21248024,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248024, 21248026,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248025, 21248025,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248025, 21248026,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248025, 21248026,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248026, 21248026,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248026, 21248026,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248026, 21248026,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248028, 21248028,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248028, 21248029,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248028, 21248031,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21248028, 21249014,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 19 */ + { 0, 0, 21248028, 21249014,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 19 */ + { 0, 0, 21248028, 21249016,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 21 */ + { 0, 0, 21248029, 21248029,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248029, 21248031,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21248030, 21248031,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248030, 21248031,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21248031, 21248031,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248031, 21248031,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21248031, 21248031,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249001, 21249004,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21249001, 21249009,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21249002, 21249002,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249002, 21249002,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249002, 21249003,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249002, 21249004,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249004, 21249004,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249004, 21249004,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249004, 21249004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249006, 21249007,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249006, 21249008,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249008, 21249009,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249009, 21249009,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249010, 21249011,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249010, 21249011,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249011, 21249011,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249011, 21249011,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249011, 21249013,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249011, 21249013,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249011, 21249016,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21249013, 21249013,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249013, 21249013,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249013, 21249013,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249013, 21249014,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249015, 21249015,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249015, 21249016,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249016, 21249016,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249016, 21249016,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249016, 21249016,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249016, 21249016,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249026, 21249026,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249026, 21249026,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249026, 21249026,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249026, 21249028,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249026, 21249028,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249026, 21249028,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249026, 21249028,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249026, 21249035,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21249026, 21249038,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,13, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,13, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,13, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249026, 21249038,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21249028, 21249029,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249029, 21249035,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21249029, 21249035,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21249029, 21249038,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21249031, 21249034,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249033, 21249033,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249033, 21249033,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249033, 21249033,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249035, 21249038,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21249035, 21249038,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21249036, 21249037,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249037, 21249037,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249037, 21249038,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249037, 21249038,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249037, 21249038,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249041, 21249041,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249041, 21249042,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249041, 21249042,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249041, 21249043,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249041, 21249043,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21249041, 21250002,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21249041, 21250003,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21249041, 21250036,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,13, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,13, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,13, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249041, 21250036,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 34 */ + { 0, 0, 21249043, 21249043,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249043, 21249044,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249043, 21250002,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21249044, 21249045,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21249044, 21250003,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21249045, 21249045,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21249045, 21250001,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250001, 21250001,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250001, 21250001,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250002, 21250008,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21250003, 21250007,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21250006, 21250006,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250006, 21250006,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250006, 21250007,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250006, 21250010,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21250006, 21250011,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21250007, 21250036,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 25 */ + { 0, 0, 21250007, 21250036,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 25 */ + { 0, 0, 21250008, 21250008,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250010, 21250010,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250010, 21250010,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250010, 21250010,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250011, 21250011,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250011, 21250021,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 11 */ + { 0, 0, 21250012, 21250012,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250012, 21250014,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21250013, 21250014,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250013, 21250014,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250014, 21250014,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250014, 21250017,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21250016, 21250017,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250016, 21250020,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21250017, 21250019,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21250019, 21250019,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250019, 21250019,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250019, 21250019,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250019, 21250020,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250021, 21250022,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250021, 21250026,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21250022, 21250022,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250022, 21250022,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250022, 21250022,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250022, 21250026,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250026, 21250036,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 10 */ + { 0, 0, 21250027, 21250027,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250027, 21250027,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250027, 21250028,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250029, 21250029,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250029, 21250030,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250030, 21250030,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250030, 21250030,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250031, 21250031,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250031, 21250031,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250031, 21250035,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21250032, 21250033,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250033, 21250035,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250033, 21250035,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250035, 21250036,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250035, 21250036,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250038, 21250039,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250038, 21250039,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250038, 21250043,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21250038, 21250043,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21250038, 21251015,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 20 */ + { 0, 0, 21250038, 21258004,13, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250038, 21258004,13, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250038, 21258004,13, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250038, 21258004,14, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250038, 21258004,14, -1, -1, -1, 6, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250038, 21258004,14, -1, -1, -1, 7, -1, 0}, /* Dead nruns = 98 */ + { 0, 0, 21250040, 21250040,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250040, 21250040,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250040, 21250041,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21250040, 21250043,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21250040, 21251001,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21250041, 21251014,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 16 */ + { 0, 0, 21250041, 21251014,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 16 */ + { 0, 0, 21250043, 21250043,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21250043, 21251002,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251002, 21251002,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251002, 21251002,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251002, 21251003,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251002, 21251006,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251002, 21251006,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251003, 21251008,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21251006, 21251006,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251006, 21251006,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251008, 21251009,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251008, 21251010,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251008, 21251010,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251008, 21251010,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251008, 21251011,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251008, 21251012,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21251011, 21251012,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251012, 21251012,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251013, 21251020,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21251013, 21251022,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21251013, 21251022,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21251014, 21251015,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251014, 21251015,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251014, 21251015,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251014, 21251020,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251014, 21251020,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251014, 21251025,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21251016, 21251021,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251020, 21251020,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251020, 21251021,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251020, 21252006,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 11 */ + { 0, 0, 21251021, 21251021,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251021, 21251021,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251021, 21251021,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251021, 21251025,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251022, 21251022,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251022, 21251023,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21251022, 21251025,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21251023, 21251023,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251023, 21251023,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251025, 21251025,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251025, 21251025,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251025, 21251025,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21251025, 21252003,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21251025, 21252003,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21252001, 21252001,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252002, 21252003,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252002, 21252003,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252002, 21252005,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21252002, 21252006,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21252002, 21252007,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21252002, 21252008,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21252003, 21252003,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252003, 21252003,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252003, 21252003,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252003, 21252004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252004, 21252004,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252004, 21252004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252004, 21252004,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252005, 21252005,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252005, 21252006,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252005, 21252007,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21252005, 21252007,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21252006, 21252006,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252006, 21252006,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252006, 21252008,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21252008, 21252008,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252008, 21252008,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252008, 21252008,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252008, 21252009,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252008, 21256009,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 30 */ + { 0, 0, 21252009, 21252021,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21252010, 21252010,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252010, 21252010,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252010, 21252010,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252010, 21252011,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252010, 21252011,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252010, 21252011,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252010, 21252015,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21252011, 21252011,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252011, 21252014,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252014, 21252014,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252014, 21252015,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252014, 21252015,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252014, 21252021,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21252015, 21252025,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21252015, 21252026,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 6 */ + { 0, 0, 21252021, 21252021,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252021, 21252021,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252021, 21252025,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21252022, 21254010,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 13 */ + { 0, 0, 21252022, 21254010,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 13 */ + { 0, 0, 21252024, 21252024,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252024, 21252024,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252024, 21252024,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252024, 21252024,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252024, 21252025,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21252025, 21252025,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252026, 21252026,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252026, 21252026,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252026, 21252026,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21252033, 21254002,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21252033, 21254010,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21254001, 21254002,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21254001, 21254002,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21254002, 21254005,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21254004, 21254004,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254005, 21254005,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254005, 21254007,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21254007, 21254007,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254007, 21254008,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21254007, 21254011,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21254008, 21254008,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254011, 21254011,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254011, 21254011,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254011, 21254011,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254011, 21254013,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21254011, 21256006,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21254012, 21255021,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21254013, 21254013,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254013, 21254013,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254013, 21254013,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21254013, 21256009,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21254013, 21256009,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21255019, 21258004,14, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 41 */ + { 0, 0, 21256006, 21256006,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21256006, 21256006,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21256006, 21257001,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 14 */ + { 0, 0, 21256006, 21257002,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 15 */ + { 0, 0, 21256007, 21256008,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21256008, 21256014,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21256008, 21256014,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21256008, 21256014,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21256010, 21256010,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21256014, 21256034,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21256014, 21256034,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21256014, 21256034,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21256015, 21256036,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21256017, 21257002,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21256017, 21257003,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 */ + { 0, 0, 21256018, 21257005,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 9 */ + { 0, 0, 21257001, 21257002,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257001, 21257002,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257001, 21257038,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 18 */ + { 0, 0, 21257002, 21257005,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21257004, 21257005,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257004, 21257038,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 15 */ + { 0, 0, 21257004, 21257038,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 15 */ + { 0, 0, 21257010, 21257014,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257013, 21257013,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257013, 21257014,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257014, 21257014,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257014, 21257029,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21257014, 21257029,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21257015, 21258004,13, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 18 */ + { 0, 0, 21257017, 21257017,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257017, 21257030,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21257018, 21257029,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257029, 21257029,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257031, 21257031,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257031, 21257031,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257031, 21257031,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257034, 21257034,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257036, 21257036,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257037, 21257037,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257037, 21257039,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257037, 21257039,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257037, 21257039,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257038, 21257039,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2 */ + { 0, 0, 21257039, 21257039,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257040, 21257040,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257040, 21258004,13, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21257040, 21258004,13, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 7 */ + { 0, 0, 21257041, 21257041,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21257041, 21257044,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257041, 21257044,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257041, 21257044,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 */ + { 0, 0, 21257041, 21258001,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4 */ + { 0, 0, 21257043, 21258004,13, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5 */ + { 0, 0, 21257044, 21257044,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21258002, 21258002,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21258002, 21258002,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 21258002, 21258004,13, -1, -1, -1, 8, -1, 0}, /* Dead nruns = 2 */ + + { 0, 0, 21169037, 21182037,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 270*/ + { 0, 0, 21169037, 21182037,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 270*/ + { 0, 0, 21175025, 21175025,16, 39, 2, 9, 3, 1, 0}, /* Dead nruns = 1 iold = 2930 */ + { 0, 0, 21175025, 21175025,16, 40, 2, 8, 3, 1, 0}, /* Dead nruns = 1 iold = 2930 */ + { 0, 0, 21182041, 21184025,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 33*/ + { 0, 0, 21182041, 21184025,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 33*/ + { 0, 0, 21184027, 21188016,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 86*/ + { 0, 0, 21184027, 21188016,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 86*/ + { 0, 0, 21188028, 21193007,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 59*/ + { 0, 0, 21188028, 21193007,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 59*/ + { 0, 0, 21193006, 21193007,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 21193009, 21195015,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 44*/ + { 0, 0, 21193009, 21195015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 44*/ + { 0, 0, 21193009, 21195015,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 44*/ + { 0, 0, 21195017, 21204013,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 124*/ + { 0, 0, 21195017, 21204013,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 124*/ + { 0, 0, 21195017, 21204013,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 124*/ + { 0, 0, 21205003, 21205020,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 12*/ + { 0, 0, 21205003, 21205020,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 12*/ + { 0, 0, 21205003, 21205020,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 12*/ + { 0, 0, 21205025, 21206023,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 22*/ + { 0, 0, 21205025, 21206023,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 22*/ + { 0, 0, 21205025, 21206023,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 22*/ + { 0, 0, 21206025, 21211005,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 76*/ + { 0, 0, 21206025, 21211005,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 76*/ + { 0, 0, 21206025, 21211005,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 76*/ + { 0, 0, 21211007, 21220020,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 134*/ + { 0, 0, 21211007, 21220020,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 134*/ + { 0, 0, 21211007, 21220020,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 134*/ + { 0, 0, 21212008, 21220010, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 111*/ + { 0, 0, 21220022, 21221031,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21220022, 21221031,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21220022, 21221031,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21221035, 21222027,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 21*/ + { 0, 0, 21221035, 21222027,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 21*/ + { 0, 0, 21221035, 21222027,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 21*/ + { 0, 0, 21222029, 21224022,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 47*/ + { 0, 0, 21222029, 21224022,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 47*/ + { 0, 0, 21222029, 21224022,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 47*/ + { 0, 0, 21223036, 21223036,16, 39, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21223036, 21223036,16, 40, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21233027, 21233027,16, 39, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ + { 0, 0, 21233027, 21233027,16, 40, 2, 9, 3, 1, 0}, /* Dead nruns = 1*/ +#if 0 + // Problems 21243033 - 21243034 - 21258004 + { 0, 0, 21243033, 21258004,13, -1, -1, -1,-1, 0, 0}, /* Dead whole sector*/ + { 0, 0, 21243033, 21258004,14, -1, -1, -1,-1, 0, 0}, /* Dead whole sector*/ +#endif + { 0, 0, 21224046, 21225007,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 12*/ + { 0, 0, 21224046, 21225007,20, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 12*/ + { 0, 0, 21224046, 21228019,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 89*/ + { 0, 0, 21224046, 21228019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 89*/ + { 0, 0, 21224046, 21228019,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 89*/ + { 0, 0, 21225035, 21228019,20, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 77*/ + { 0, 0, 21225035, 21228019,20, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 77*/ + { 0, 0, 21225035, 21228019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 77*/ + { 0, 0, 21226003, 21226003,10, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + + { 0, 0, 21229027, 21230013,20, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 18*/ + { 0, 0, 21229027, 21230013,20, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 18*/ + { 0, 0, 21228021, 21229021,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 29*/ + { 0, 0, 21228021, 21229021,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 29*/ + { 0, 0, 21228021, 21229021,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 29*/ + { 0, 0, 21229027, 21231020,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 33*/ + { 0, 0, 21229027, 21231020,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 33*/ + { 0, 0, 21229027, 21231020,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 33*/ + { 0, 0, 21229041, 21231020,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 31 whole sector is out*/ + { 0, 0, 21231022, 21235015,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 86*/ + { 0, 0, 21231022, 21235015,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 86 whole sector*/ + { 0, 0, 21231022, 21235015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 86*/ + { 0, 0, 21231022, 21235015,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 86*/ + { 0, 0, 21235017, 21235029,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 11*/ + { 0, 0, 21235017, 21235029,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 11 whole sector*/ + { 0, 0, 21235017, 21235029,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 11*/ + { 0, 0, 21235017, 21235029,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 11*/ + { 0, 0, 21235034, 21239016,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 98*/ + { 0, 0, 21235034, 21239016,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 98*/ + { 0, 0, 21235034, 21239016,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 98*/ + { 0, 0, 21235034, 21239016,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 98*/ + { 0, 0, 21239010, 21239016, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 7*/ + { 0, 0, 21239018, 21240022,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 21239018, 21240022,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 21239018, 21240022,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 21239018, 21240022,22, -1, -1, -1, 2, 32, 0}, /* Dead nruns = 23*/ + { 0, 0, 21239018, 21240022, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 23*/ + { 0, 0, 21240024, 21241022,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 18*/ + { 0, 0, 21240024, 21241022,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 18*/ + { 0, 0, 21240024, 21241022,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 18*/ + { 0, 0, 21240024, 21241022,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 18*/ + { 0, 0, 21240024, 21241022, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 18*/ + { 0, 0, 21241025, 21243016,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21241025, 21243016,14, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21241025, 21243016,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21241025, 21243016,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 45*/ + { 0, 0, 21241025, 21243016, 4, -1, -1, -1, 8, 0, 0} /* Dead nruns = 45*/ + + }; + for (Int_t i = 0; i < nrows; i++) { + row[i].idx = i+1; + row[i].nrows = nrows; + tableSet->AddAt(&row[i]); + } + // tableSet->Print(0,nrows); + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2021.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2021.C new file mode 100644 index 00000000000..c18eadb08a8 --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2021.C @@ -0,0 +1,133 @@ +TDataSet *CreateTable() { + // ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_tpcExtraGainCorrection")) return 0; + Int_t nrows = 105; + St_tpcExtraGainCorrection *tableSet = new St_tpcExtraGainCorrection("tpcExtraGainCorrection",nrows); + tpcExtraGainCorrection_st row[105] = { + { 0, 0, 22031042, 22031042,20, 30, 75, 81, 4, 22, 0}, /* Dead nruns = 1 */ + { 0, 0, 22031042, 22031042,10, 39, 20, 35, 3, 2, 0}, /* Dead nruns = 1*/ + { 0, 0, 22031042, 22033002, 4, -1, -1, -1, 3, 2, 0}, /* Dead nruns = 22*/ + { 0, 0, 22031042, 22031046, 7, -1, -1, -1, 3, 13, 0}, /* Dead nruns = 4*/ + { 0, 0, 22031042, 22031046, 7, -1, -1, -1, 3, 23, 0}, /* Dead nruns = 4*/ + { 0, 0, 22031042, 22033003, 7, -1, -1, -1, 4, 23, 0}, /* Dead nruns = 22*/ + { 0, 0, 22031042, 22033005, 7, 32, 37, 43, 3, 13, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033005, 7, 34, 32, 41, 3, 13, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002, 9, 33, 2, 19, 3, 12, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,10, 17, 3, 15, 2, 36, 0}, /* Dead nruns = 13*/ + { 0, 0, 22031042, 22032003,10, 37, 27, 38, 3, 2, 0}, /* Dead nruns = 13*/ + { 0, 0, 22031042, 22032003,10, 38, 27, 34, 3, 2, 0}, /* Dead nruns = 13*/ + { 0, 0, 22031042, 22033002,14, 22, 9, 25, 3, 28, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,14, 24, 2, 15, 3, 28, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,18, -1, -1, -1, 1, 51, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,19, 25, 49, 57, 4, 26, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,19, 37,104,111, 4, 6, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22031042,22, 35, 76, 83, 4, 10, 0}, /* Dead nruns = 1 iold = 5050 */ + { 0, 0, 22031042, 22031042,22, 37,102,111, 4, 6, 0}, /* Dead nruns = 1 iold = 5050 */ + { 0, 0, 22031042, 22031042,22, 39, 20, 29, 3, 2, 0}, /* Dead nruns = 1 iold = 5050 */ + { 0, 0, 22031042, 22033002,22, 35, 75, 83, 4, 10, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,22, 37,102,111, 4, 6, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,22, 39, 20, 29, 3, 2, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22031042, 22033002,23, 15, 12, 19, 2, 40, 0}, /* Dead nruns = 22 iold = 5071 */ + { 0, 0, 22032004, 22033002,10, 37, 27, 38, 3, 2, 0}, /* Dead nruns = 9 iold = 4524 */ + { 0, 0, 22032004, 22033002,10, 38, 27, 34, 3, 2, 0}, /* Dead nruns = 9 iold = 4524 */ + { 0, 0, 22032004, 22033002,10, 39, 20, 35, 3, 2, 0}, /* Dead nruns = 9 iold = 4524 */ + + { 0, 0, 22032013, 22033002, 3, -1, -1, -1, 1, 46, 0}, /* Dead nruns = 3 iold = 5071 */ + { 0, 0, 22032014, 22032014, 7, -1, -1, -1, 3, 13, 0}, /* Dead nruns = 1*/ + { 0, 0, 22032014, 22032014, 7, -1, -1, -1, 4, 23, 0}, /* Dead nruns = 1*/ + { 0, 0, 22035029, 22035029,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 22038017, 22038019, 3, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22038017, 22038019, 3, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22038017, 22038019, 4, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22038017, 22038019, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22039013, 22039013, 8, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 22068051, 22068051,22, -1, -1, -1, 5, 0, 1}, /* Alive nruns = 1 354.080 V*/ + + { 0, 0, 22090003, 22090003, 4, 66, 94,135, 8, 0, 0}, /* Dead nruns = 1 */ + { 0, 0, 22090003, 22090003, 4, 67, 95,137, 8, 0, 0}, /* Dead nruns = 1 iold = 6678 */ + { 0, 0, 22090003, 22090003, 4, 68, 96,139, 8, 0, 0}, /* Dead nruns = 1 iold = 6678 */ + { 0, 0, 22090003, 22090003, 4, 69, 97,141, 8, 0, 0}, /* Dead nruns = 1 iold = 6678 */ + { 0, 0, 22090003, 22090003, 4, 70, 97,141, 8, 0, 0}, /* Dead nruns = 1 iold = 6678 */ + { 0, 0, 22090003, 22090003, 4, 71, 97,141, 8, 0, 0}, /* Dead nruns = 1 iold = 6678 */ + { 0, 0, 22090003, 22090003, 4, 72, 97,141, 8, 0, 0}, /* Dead nruns = 1 */ + { 0, 0, 22090005, 22090005, 4, 65, 94,109, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 66, 94,109, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 67, 95,110, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 68, 96,111, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 69, 97,112, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 70, 97,112, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 71, 97,112, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22090005, 22090005, 4, 72, 97,112, 8, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 22091020, 22091022, 4, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 3*/ + { 0, 0, 22091020, 22091022, 4, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 3*/ + { 0, 0, 22091022, 22091022, 5, -1, -1, -1, 5, -1, 1}, /* Alive nruns = 1 */ + + { 0, 0, 22091021, 22091022,11, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 22091022, 22091022, 5, -1, -1, -1, 5, -1, 1}, /* Alive nruns = 1 */ + + { 0, 0, 22097016, 22097019, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 22097020, 22113015, 8, -1, -1, -1, 2, 45, 0}, /* Dead nruns = 511*/ + { 0, 0, 22115046, 22116015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 21*/ + { 0, 0, 22117017, 22117021,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5*/ + { 0, 0, 22117023, 22118015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 37*/ + { 0, 0, 22121046, 22123018,10, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 40*/ + { 0, 0, 22125002, 22125011,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 22128009, 22131014,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5*/ + { 0, 0, 22131014, 22131014, 8, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 1 whole dead */ + { 0, 0, 22131040, 22131054,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 22131064, 22132003,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 5*/ + { 0, 0, 22132026, 22132026,20, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 1 whole dead */ + { 0, 0, 22133019, 22133019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 22133022, 22133040,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 6*/ + { 0, 0, 22133037, 22133040, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3*/ + + { 0, 0, 22133043, 22133043, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 22133045, 22134001,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22133045, 22134001, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22134003, 22134019,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 14*/ + + { 0, 0, 22134003, 22174007, 8, -1, -1, -1, 2, 32, 0}, /* Dead nruns = 747*/ + { 0, 0, 22134032, 22163003,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 148*/ + + { 0, 0, 22137006, 22188007,11, -1, -1, -1, 4, 18, 0}, /* Dead nruns = 856*/ + { 0, 0, 22156032, 22157004,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 9*/ + + { 0, 0, 22163003, 22188007, 3, -1, -1, -1, 4, 30, 0}, /* Dead nruns = 400*/ + { 0, 0, 22163006, 22174007,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 240*/ + { 0, 0, 22163008, 22174007,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 239*/ + + { 0, 0, 22168037, 22168037, 3, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 22168037, 22168037, 3, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 22168037, 22168037, 5, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 */ + { 0, 0, 22168037, 22168037, 5, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 */ + + { 0, 0, 22174004, 22174007, 8, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1 ??*/ + { 0, 0, 22174004, 22174007, 8, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 1 ??*/ + { 0, 0, 22174011, 22174012,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22174011, 22174012,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22174011, 22174012, 8, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22174014, 22174014, 8, -1, -1, -1,-1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 22174014, 22178032,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 70*/ + { 0, 0, 22174014, 22178032,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 70*/ + + { 0, 0, 22174018, 22188007, 8, -1, -1, -1, 2, 32, 0}, /* Dead nruns = 156 iold = 8703 */ + { 0, 0, 22179020, 22182001,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 25*/ + { 0, 0, 22179020, 22182001,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 25*/ + + { 0, 0, 22181045, 22188007,13, -1, -1, -1, 2, 34, 0}, /* Dead nruns = 78 iold = 8703 */ + + { 0, 0, 22182007, 22187010,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 52*/ + { 0, 0, 22182007, 22187010,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 52*/ + { 0, 0, 22187023, 22187024,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22187023, 22187024,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 22187026, 22188007,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 8 iold = 8234 */ + { 0, 0, 22187026, 23001059,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 14*/ + }; + for (Int_t i = 0; i < nrows; i++) { + row[i].idx = i+1; + row[i].nrows = nrows; + tableSet->AddAt(&row[i]); + } + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2022.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2022.C new file mode 100644 index 00000000000..a108eb1a6f0 --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2022.C @@ -0,0 +1,172 @@ +#include "tables/St_tpcExtraGainCorrection_Table.h" + +TDataSet *CreateTable() { + // ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_tpcExtraGainCorrection")) return 0; + Int_t nrows = 145; + St_tpcExtraGainCorrection *tableSet = new St_tpcExtraGainCorrection("tpcExtraGainCorrection",nrows); + tpcExtraGainCorrection_st row[145] = { +#if 0 + { 0, 0, 23001002, 23001034, 4, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3 iold = 8237 */ + { 0, 0, 23001002, 23001034, 4, -1, -1, -1, 2, -1, 1}, /* Alive nruns = 4 */ +#endif + { 0, 0, 23001002, 23001034, 4, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3 iold = 8237 */ + { 0, 0, 23001002, 23001059,20, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 6*/ + { 0, 0, 23002024, 23003016,12, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 23002024, 23003016,20, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 23002024, 23003016,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 23003016, 23003016,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23032044, 23032065, 8, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23032044, 23032065, 8, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23007098, 23008017,10, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4 iold = 8255 */ + { 0, 0, 23007098, 23008017,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23007098, 23008017,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23008046, 23008058,10, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23008046, 23008058,10, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23008046, 23008058,10, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23008046, 23008058,10, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23008076, 23010009, 6, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 12 iold = 8271 */ + { 0, 0, 23008086, 23010009, 8, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 11 iold = 8271 */ + { 0, 0, 23098050, 23098050, 5, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23098050, 23098050, 5, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 1 iold = 9127 */ + { 0, 0, 23098050, 23098050, 6, -1, -1, -1, 7, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23098050, 23098050, 6, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 1*/ + + { 0, 0, 23001002, 23001034, 4, -1, -1, -1, 2, -1, 1}, /* Alive nruns = 4 */ + + { 0, 0, 23011011, 23013025,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 15*/ + { 0, 0, 23011011, 23013025,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 15*/ + { 0, 0, 23011029, 23012020, 4, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 23011062, 23012020,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23013016, 23013025, 6, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23013038, 23013038,22, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1 iold = 8290 */ + { 0, 0, 23013038, 23013038, 6, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23013038, 23027015,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 89*/ + { 0, 0, 23013038, 23027015,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 89*/ + { 0, 0, 23015034, 23016040,12, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 5 iold = 8299 */ + { 0, 0, 23016040, 23017017, 4, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 7*/ + { 0, 0, 23020006, 23020022,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23020006, 23020022, 8, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23020012, 23020022,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23020018, 23020022, 6, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23022009, 23027015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 46*/ + { 0, 0, 23022019, 23023016,12, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 10 iold = 8344 */ + { 0, 0, 23022038, 23023016,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 8*/ + { 0, 0, 23022053, 23023016, 4, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 6*/ + { 0, 0, 23022066, 23023016, 2, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 5 iold = 8344 */ + { 0, 0, 23023044, 23023044,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23023044, 23023044,14, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23023044, 23023044,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23023044, 23023044,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23023053, 23025021, 4, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 15*/ + { 0, 0, 23024063, 23025021, 8, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 6 iold = 8362 */ + { 0, 0, 23028007, 23037072,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 81*/ + { 0, 0, 23028007, 23037072,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 81*/ + { 0, 0, 23028007, 23037072,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 81*/ + { 0, 0, 23028055, 23029004,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23032029, 23032091,22, -1, -1, -1, 8, 0, 0}, /* Dead nruns = 6*/ + { 0, 0, 23032029, 23037072,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 43*/ + { 0, 0, 23032044, 23032065, 8, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23032044, 23032065, 8, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23032065, 23032091,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23038010, 23042016,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23038010, 23042016,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 23*/ + { 0, 0, 23038010, 23042016,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23038010, 23042016,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23038017, 23038032,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3 iold = 8465 */ + { 0, 0, 23039008, 23039021, 4, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3 iold = 8470 */ + { 0, 0, 23042030, 23042063,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 3*/ + { 0, 0, 23042030, 23042063,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23042030, 23042063,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23043020, 23043033,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23043020, 23043033,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23043020, 23043033,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23043020, 23043033,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23043033, 23043033,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 iold = 8494 */ + { 0, 0, 23043053, 23043061,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23043053, 23043061,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 3*/ + { 0, 0, 23043053, 23043061,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23043053, 23043061,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23043085, 23050015,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23043085, 23050015,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 23*/ + { 0, 0, 23043085, 23050015,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23043085, 23050015,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 23*/ + { 0, 0, 23050028, 23051032,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 10*/ + { 0, 0, 23050028, 23051032,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 10*/ + { 0, 0, 23050028, 23065066,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 93*/ + { 0, 0, 23050028, 23065066,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 93*/ + { 0, 0, 23050028, 23065066,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 93*/ + { 0, 0, 23050028, 23065066,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 93*/ + { 0, 0, 23050051, 23052041,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 14*/ + { 0, 0, 23052031, 23052041, 8, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2 iold = 8541 */ + { 0, 0, 23052049, 23065066,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 76*/ + { 0, 0, 23052049, 23065066,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 76*/ + { 0, 0, 23053023, 23053027,10, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 2*/ +#if 0 + { 0, 0, 23054015, 23054015,14, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23054015, 23054015,14, -1, -1, -1, 3, -1, 1}, /* Alive nruns = 1 */ +#endif + { 0, 0, 23066010, 23066010,12, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1 iold = 8619 */ + { 0, 0, 23066010, 23066010,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23066010, 23066010,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23066010, 23066010,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23066010, 23066010,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067024, 23067024,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067024, 23067024,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067024, 23067024,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067024, 23067024,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067036, 23067036,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067036, 23067036,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067036, 23067036,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23067036, 23067036,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23074018, 23074018,10, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 iold = 8634 */ + { 0, 0, 23074018, 23074018, 2, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1 iold = 8634 */ + { 0, 0, 23074018, 23074018, 6, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1 iold = 8634 */ + { 0, 0, 23074018, 23075014,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23074018, 23075014,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23074018, 23075014,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 4*/ + { 0, 0, 23074018, 23075014,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23074018, 23075014,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 4*/ + { 0, 0, 23077001, 23077018,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2 iold = 8641 */ + { 0, 0, 23077001, 23077018,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23077001, 23077018,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 3*/ + { 0, 0, 23077001, 23077018,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23077001, 23077018,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 3*/ + { 0, 0, 23077018, 23077018,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23078017, 23078029,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23078017, 23078029,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23078017, 23078029,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 2*/ + { 0, 0, 23078017, 23078029,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23078017, 23078029,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 2*/ + { 0, 0, 23093054, 23096012,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 20*/ + { 0, 0, 23093054, 23096012,16, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 20*/ + { 0, 0, 23093054, 23096012,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 20*/ + { 0, 0, 23093054, 23096012,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 20*/ + { 0, 0, 23093054, 23096012,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 20*/ + { 0, 0, 23093054, 23096012,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 20*/ + { 0, 0, 23096022, 23096022,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23096022, 23096022,16, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23096022, 23096022,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23096022, 23096022,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 1*/ + { 0, 0, 23096022, 23096022,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 1*/ + { 0, 0, 23096064, 23099039,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 29 iold = 8698 */ + { 0, 0, 23096064, 23099039,16, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 29*/ + { 0, 0, 23096064, 23099039,16, -1, -1, -1, 6, 0, 0}, /* Dead nruns = 29 iold = 8698 */ + { 0, 0, 23096064, 23099039,20, -1, -1, -1, 3, -1, 0}, /* Dead nruns = 29*/ + { 0, 0, 23096064, 23099039,22, -1, -1, -1, 5, 0, 0}, /* Dead nruns = 29*/ + { 0, 0, 23096064, 23099039,24, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 29 iold = 8698 */ + { 0, 0, 23096064, 23099039,24, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 29 iold = 8698 */ + { 0, 0, 23096072, 23099039,14, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 28 iold = 8698 */ + { 0, 0, 23096072, 23099039,14, -1, -1, -1, 4, -1, 0}, /* Dead nruns = 28 iold = 8698 */ + { 0, 0, 23097019, 23097033,22, -1, -1, -1, 5, -1, 0}, /* Dead nruns = 4 iold = 8676 */ + { 0, 0, 23097019, 23097033,22, -1, -1, -1, 1, -1, 0}, /* Dead nruns = 4 iold = 8676 */ + { 0, 0, 23098075, 23099034,10, -1, -1, -1, 2, -1, 0}, /* Dead nruns = 5 iold = 8697 */ + }; + for (Int_t i = 0; i < nrows; i++) { + row[i].idx = i+1; + row[i].nrows = nrows; + tableSet->AddAt(&row[i]); + } + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} diff --git a/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2023.C b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2023.C new file mode 120000 index 00000000000..cdf51d1f322 --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2023.C @@ -0,0 +1 @@ +tpcExtraGainCorrection.C \ No newline at end of file diff --git a/StarDb/Calibrations/tpc/tpcGainCorrection.C b/StarDb/Calibrations/tpc/tpcGainCorrection.C index 16763fce678..9cb3ea24c91 100644 --- a/StarDb/Calibrations/tpc/tpcGainCorrection.C +++ b/StarDb/Calibrations/tpc/tpcGainCorrection.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcCorrection")) return 0; tpcCorrection_st row; diff --git a/StarDb/Calibrations/tpc/tpcGas.C b/StarDb/Calibrations/tpc/tpcGas.C index b52b986c867..5c37c1f0521 100644 --- a/StarDb/Calibrations/tpc/tpcGas.C +++ b/StarDb/Calibrations/tpc/tpcGas.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcGas_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcGas")) return 0; St_tpcGas *tableSet = new St_tpcGas("tpcGas",1); diff --git a/StarDb/Calibrations/tpc/tpcGas.y2018.C b/StarDb/Calibrations/tpc/tpcGas.y2018.C index a70c09e7117..2f7485e318b 100644 --- a/StarDb/Calibrations/tpc/tpcGas.y2018.C +++ b/StarDb/Calibrations/tpc/tpcGas.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcGas_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/Calibrations/tpc/.tpcGas/tpcGas Allocated rows: 1 Used rows: 1 Row size: 64 bytes diff --git a/StarDb/Calibrations/tpc/tpcGasTemperature.C b/StarDb/Calibrations/tpc/tpcGasTemperature.C index 6150d79d5be..566ed51af84 100644 --- a/StarDb/Calibrations/tpc/tpcGasTemperature.C +++ b/StarDb/Calibrations/tpc/tpcGasTemperature.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcGridLeak.C b/StarDb/Calibrations/tpc/tpcGridLeak.C index be39b3d7fc3..a1f68ea6890 100644 --- a/StarDb/Calibrations/tpc/tpcGridLeak.C +++ b/StarDb/Calibrations/tpc/tpcGridLeak.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcGridLeak_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.tpcGridLeak/tpcGridLeak Allocated rows: 1 Used rows: 1 Row size: 72 bytes diff --git a/StarDb/Calibrations/tpc/tpcMethaneIn.C b/StarDb/Calibrations/tpc/tpcMethaneIn.C index 4f5ade390f1..b333d0f1325 100644 --- a/StarDb/Calibrations/tpc/tpcMethaneIn.C +++ b/StarDb/Calibrations/tpc/tpcMethaneIn.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcOmegaTau.C b/StarDb/Calibrations/tpc/tpcOmegaTau.C index 6f5c242045c..c5ee89b6f30 100644 --- a/StarDb/Calibrations/tpc/tpcOmegaTau.C +++ b/StarDb/Calibrations/tpc/tpcOmegaTau.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcOmegaTau_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.tpcOmegaTau/tpcOmegaTau Allocated rows: 1 Used rows: 1 Row size: 8 bytes diff --git a/StarDb/Calibrations/tpc/tpcPadGainT0.C b/StarDb/Calibrations/tpc/tpcPadGainT0.C index 26032565f32..10230138c05 100644 --- a/StarDb/Calibrations/tpc/tpcPadGainT0.C +++ b/StarDb/Calibrations/tpc/tpcPadGainT0.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadGainT0")) return 0; tpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/tpcPadGainT0.y2018.C b/StarDb/Calibrations/tpc/tpcPadGainT0.y2018.C index 26032565f32..10230138c05 100644 --- a/StarDb/Calibrations/tpc/tpcPadGainT0.y2018.C +++ b/StarDb/Calibrations/tpc/tpcPadGainT0.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadGainT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadGainT0")) return 0; tpcPadGainT0_st row; diff --git a/StarDb/Calibrations/tpc/tpcPadGainT0B.20180301.000000.C b/StarDb/Calibrations/tpc/tpcPadGainT0B.20180301.000000.C index ba7e8fab36c..6d555a714c3 100644 --- a/StarDb/Calibrations/tpc/tpcPadGainT0B.20180301.000000.C +++ b/StarDb/Calibrations/tpc/tpcPadGainT0B.20180301.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadGainT0B_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadGainT0B")) return 0; St_tpcPadGainT0B *tableSet = new St_tpcPadGainT0B("tpcPadGainT0B",24); diff --git a/StarDb/Calibrations/tpc/tpcPadGainT0B.C b/StarDb/Calibrations/tpc/tpcPadGainT0B.C index 7385837701d..d36604549ae 100644 --- a/StarDb/Calibrations/tpc/tpcPadGainT0B.C +++ b/StarDb/Calibrations/tpc/tpcPadGainT0B.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadGainT0B_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadGainT0B")) return 0; tpcPadGainT0B_st row; diff --git a/StarDb/Calibrations/tpc/tpcPadGainT0B.y2018.C b/StarDb/Calibrations/tpc/tpcPadGainT0B.y2018.C index ba7e8fab36c..6d555a714c3 100644 --- a/StarDb/Calibrations/tpc/tpcPadGainT0B.y2018.C +++ b/StarDb/Calibrations/tpc/tpcPadGainT0B.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadGainT0B_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadGainT0B")) return 0; St_tpcPadGainT0B *tableSet = new St_tpcPadGainT0B("tpcPadGainT0B",24); diff --git a/StarDb/Calibrations/tpc/tpcPadrowT0.C b/StarDb/Calibrations/tpc/tpcPadrowT0.C index 0762ab415c3..21c2fd7eb63 100644 --- a/StarDb/Calibrations/tpc/tpcPadrowT0.C +++ b/StarDb/Calibrations/tpc/tpcPadrowT0.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadrowT0_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_tpcPadrowT0")) return 0; tpcPadrowT0_st row; diff --git a/StarDb/Calibrations/tpc/tpcPressureB.C b/StarDb/Calibrations/tpc/tpcPressureB.C index 157716259e0..df881775235 100644 --- a/StarDb/Calibrations/tpc/tpcPressureB.C +++ b/StarDb/Calibrations/tpc/tpcPressureB.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcRDOMap.C b/StarDb/Calibrations/tpc/tpcRDOMap.C index 694978c1c37..f73969898de 100644 --- a/StarDb/Calibrations/tpc/tpcRDOMap.C +++ b/StarDb/Calibrations/tpc/tpcRDOMap.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOMap_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOMap")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcRDOMap.y2016.C b/StarDb/Calibrations/tpc/tpcRDOMap.y2016.C index 709b313c42a..311d2307152 100644 --- a/StarDb/Calibrations/tpc/tpcRDOMap.y2016.C +++ b/StarDb/Calibrations/tpc/tpcRDOMap.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOMap_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOMap")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcRDOT0offset.20180312.162439.C b/StarDb/Calibrations/tpc/tpcRDOT0offset.20180312.162439.C index bb058a0182a..67afa0266c5 100644 --- a/StarDb/Calibrations/tpc/tpcRDOT0offset.20180312.162439.C +++ b/StarDb/Calibrations/tpc/tpcRDOT0offset.20180312.162439.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOT0offset_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOT0offset")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcRDOT0offset.C b/StarDb/Calibrations/tpc/tpcRDOT0offset.C index a84b010649e..fc0454f7c14 100644 --- a/StarDb/Calibrations/tpc/tpcRDOT0offset.C +++ b/StarDb/Calibrations/tpc/tpcRDOT0offset.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOT0offset_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOT0offset")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcRDOT0offset.y2019.C b/StarDb/Calibrations/tpc/tpcRDOT0offset.y2019.C index a84b010649e..fc0454f7c14 100644 --- a/StarDb/Calibrations/tpc/tpcRDOT0offset.y2019.C +++ b/StarDb/Calibrations/tpc/tpcRDOT0offset.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOT0offset_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcRDOT0offset")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcSectorT0offset.C b/StarDb/Calibrations/tpc/tpcSectorT0offset.C index 10ab02a5e2a..0fe944f827a 100644 --- a/StarDb/Calibrations/tpc/tpcSectorT0offset.C +++ b/StarDb/Calibrations/tpc/tpcSectorT0offset.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcSectorT0offset_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.tpcSectorT0offset/tpcSectorT0offset Allocated rows: 1 Used rows: 1 Row size: 72 bytes diff --git a/StarDb/Calibrations/tpc/tpcSlewing.C b/StarDb/Calibrations/tpc/tpcSlewing.C index 9333e0d7194..acd50779b36 100644 --- a/StarDb/Calibrations/tpc/tpcSlewing.C +++ b/StarDb/Calibrations/tpc/tpcSlewing.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcSlewing_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcSlewing")) return 0; tpcSlewing_st row; diff --git a/StarDb/Calibrations/tpc/tpcStatus.C b/StarDb/Calibrations/tpc/tpcStatus.C index d2b35943818..2f8f0a6e35a 100644 --- a/StarDb/Calibrations/tpc/tpcStatus.C +++ b/StarDb/Calibrations/tpc/tpcStatus.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcStatus_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.tpcStatus/tpcStatus Allocated rows: 1 Used rows: 1 Row size: 72 bytes diff --git a/StarDb/Calibrations/tpc/tpcT0.C b/StarDb/Calibrations/tpc/tpcT0.C index 4e1c493cdbe..807756e2983 100644 --- a/StarDb/Calibrations/tpc/tpcT0.C +++ b/StarDb/Calibrations/tpc/tpcT0.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcT0_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tpc/.tpcT0/tpcT0 Allocated rows: 1 Used rows: 1 Row size: 72 bytes diff --git a/StarDb/Calibrations/tpc/tpcT0BX.C b/StarDb/Calibrations/tpc/tpcT0BX.C index b5ad91c7cb2..7ef39d70604 100644 --- a/StarDb/Calibrations/tpc/tpcT0BX.C +++ b/StarDb/Calibrations/tpc/tpcT0BX.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcT0BX_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!TClass::GetClass("St_tpcT0BX")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcTimeDependence.C b/StarDb/Calibrations/tpc/tpcTimeDependence.C index 687d4eab569..09618c64725 100644 --- a/StarDb/Calibrations/tpc/tpcTimeDependence.C +++ b/StarDb/Calibrations/tpc/tpcTimeDependence.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tpc/tpcWaterOut.C b/StarDb/Calibrations/tpc/tpcWaterOut.C index 861e9cd0789..ebd3693ac2e 100644 --- a/StarDb/Calibrations/tpc/tpcWaterOut.C +++ b/StarDb/Calibrations/tpc/tpcWaterOut.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcCorrection_Table.h" + TDataSet *CreateTable() { // ------ Test whether this table share library was loaded ------ if (!gROOT->GetClass("St_tpcCorrection")) return 0; diff --git a/StarDb/Calibrations/tracker/DefaultTrackingParameters.20010312.000011.C b/StarDb/Calibrations/tracker/DefaultTrackingParameters.20010312.000011.C index 32a37da26bc..a85eba55b46 100644 --- a/StarDb/Calibrations/tracker/DefaultTrackingParameters.20010312.000011.C +++ b/StarDb/Calibrations/tracker/DefaultTrackingParameters.20010312.000011.C @@ -1,3 +1,5 @@ +#include "tables/St_TrackingParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.DefaultTrackingParameters/DefaultTrackingParameters Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/Calibrations/tracker/DefaultTrackingParameters.C b/StarDb/Calibrations/tracker/DefaultTrackingParameters.C index 71691361701..2a683cad9b0 100644 --- a/StarDb/Calibrations/tracker/DefaultTrackingParameters.C +++ b/StarDb/Calibrations/tracker/DefaultTrackingParameters.C @@ -1,3 +1,5 @@ +#include "tables/St_TrackingParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.DefaultTrackingParameters/DefaultTrackingParameters Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2013.C b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2013.C index 6afcd0c7b66..a30918d5c1d 100644 --- a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2013.C +++ b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_KalmanTrackFinderParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tracker/.KalmanTrackFinderParameters/KalmanTrackFinderParameters Allocated rows: 1 Used rows: 1 Row size: 68 bytes diff --git a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2014.C b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2014.C index 9f93f24af21..737f886c906 100644 --- a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2014.C +++ b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2014.C @@ -1,3 +1,5 @@ +#include "tables/St_KalmanTrackFinderParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tracker/.KalmanTrackFinderParameters/KalmanTrackFinderParameters Allocated rows: 1 Used rows: 1 Row size: 68 bytes diff --git a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2015.C b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2015.C index 9f93f24af21..737f886c906 100644 --- a/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2015.C +++ b/StarDb/Calibrations/tracker/KalmanTrackFinderParameters.y2015.C @@ -1,3 +1,5 @@ +#include "tables/St_KalmanTrackFinderParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Calibrations/tracker/.KalmanTrackFinderParameters/KalmanTrackFinderParameters Allocated rows: 1 Used rows: 1 Row size: 68 bytes diff --git a/StarDb/Calibrations/tracker/KalmanTrackFitterParameters.C b/StarDb/Calibrations/tracker/KalmanTrackFitterParameters.C index 2c8f1969468..c52c542d6cc 100644 --- a/StarDb/Calibrations/tracker/KalmanTrackFitterParameters.C +++ b/StarDb/Calibrations/tracker/KalmanTrackFitterParameters.C @@ -1,3 +1,5 @@ +#include "tables/St_KalmanTrackFitterParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.KalmanTrackFitterParameters/KalmanTrackFitterParameters Allocated rows: 1 Used rows: 1 Row size: 8 bytes diff --git a/StarDb/Calibrations/tracker/LocalTrackSeedFinder.C b/StarDb/Calibrations/tracker/LocalTrackSeedFinder.C index 073c7d5a0ae..d47a34b34c4 100644 --- a/StarDb/Calibrations/tracker/LocalTrackSeedFinder.C +++ b/StarDb/Calibrations/tracker/LocalTrackSeedFinder.C @@ -1,3 +1,5 @@ +#include "tables/St_LocalTrackSeedFinder_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.LocalTrackSeedFinder/LocalTrackSeedFinder Allocated rows: 4 Used rows: 4 Row size: 52 bytes diff --git a/StarDb/Calibrations/tracker/PixelHitError.upgr01.C b/StarDb/Calibrations/tracker/PixelHitError.upgr01.C index 006b31efe8c..3202f04e5db 100644 --- a/StarDb/Calibrations/tracker/PixelHitError.upgr01.C +++ b/StarDb/Calibrations/tracker/PixelHitError.upgr01.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ssdHitError/ssdHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/PixelHitError.upgr15.C b/StarDb/Calibrations/tracker/PixelHitError.upgr15.C index 006b31efe8c..3202f04e5db 100644 --- a/StarDb/Calibrations/tracker/PixelHitError.upgr15.C +++ b/StarDb/Calibrations/tracker/PixelHitError.upgr15.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ssdHitError/ssdHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/PixelHitError.y2013.C b/StarDb/Calibrations/tracker/PixelHitError.y2013.C index 559e03c18d9..29d09c67810 100644 --- a/StarDb/Calibrations/tracker/PixelHitError.y2013.C +++ b/StarDb/Calibrations/tracker/PixelHitError.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ssdHitError/ssdHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr01.C b/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr01.C index 75a8ad92fba..e2eaecd2334 100644 --- a/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr01.C +++ b/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr01.C @@ -1,3 +1,5 @@ +#include "tables/St_TrackingParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ssdTrackingParameters/ssdTrackingParameters Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr15.C b/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr15.C index 2044fabdb51..fa43e213b70 100644 --- a/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr15.C +++ b/StarDb/Calibrations/tracker/PixelTrackingParameters.upgr15.C @@ -1,3 +1,5 @@ +#include "tables/St_TrackingParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ssdTrackingParameters/ssdTrackingParameters Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/Calibrations/tracker/StvIstHitErrs.C b/StarDb/Calibrations/tracker/StvIstHitErrs.C deleted file mode 100644 index a4b3d025554..00000000000 --- a/StarDb/Calibrations/tracker/StvIstHitErrs.C +++ /dev/null @@ -1,20 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// db/.data/StarDb/Calibrations/tracker/.ist3HitError/ist3HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes -// Table: HitError_st[0]--> HitError_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_HitError")) return 0; -HitError_st row; -St_HitError *tableSet = new St_HitError("StvIstHitErrs",1); -// - Double_t sigma_z = 1.11; - Double_t sigma_y = 0.0017; -memset(&row,0,tableSet->GetRowSize()); -// hit errors are squared ! - row.coeff[0] = sigma_y*sigma_y; // y intrinsic; - row.coeff[1] = sigma_z*sigma_z; // z intrinsic; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvKonst.C b/StarDb/Calibrations/tracker/StvKonst.C deleted file mode 100644 index 22bb663fa1a..00000000000 --- a/StarDb/Calibrations/tracker/StvKonst.C +++ /dev/null @@ -1,66 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 48 bytes -// Table: StvKonst_st[0]--> StvKonst_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvKonst")) return 0; -StvKonst_st row; -St_StvKonst *tableSet = new St_StvKonst("StvKonst",1); -// -memset(&row,0,tableSet->GetRowSize()); -// double myProb = TMath::Prob(30**3,2); - double myProb = TMath::Prob(30,2); -//double myFaktor = 3; - double myFaktor = 1; - row.mXi2Hit = ROOT::Math::chisquared_quantile_c(myProb,2) *myFaktor; //Xi2 to accept new hit - row.mXi2Trk = ROOT::Math::chisquared_quantile_c(myProb,30)/30*myFaktor;//Xi2 to accept new track - row.mXi2Vtx = ROOT::Math::chisquared_quantile_c(myProb,2); //Xi2 to accept vertex - row.mXi2Joi = ROOT::Math::chisquared_quantile_c(myProb,5)*myFaktor; //Xi2 in Refit join left & right subtrack - row.mXi2Hlx = row.mXi2Hit*9; //Xi2 in Helix, . - row.mDca2dZeroXY = 6.; //max 2d dca to X=Y=0 for primary track - row.mDca3dVertex = 3.; //max 3d dca to vertex for primary track - row.mMaxCurv = 1./33; //Maximal allowed curvature(33cm radius) - row.mMinP2 = 0.003*0.003; //Geant3 cut for too small momentum**2 - row.mMaxPti = 20; /*Maximal allowed 1/pt or Pt = 50MeV*/ - row.mMaxRes = 0.5; /*Maximal allowed residual */ - row.mCoeWindow= 9.; /*Maximal window to search hits in errors*/ - row.mMaxWindow= 10.; /*Maximal window to search hits in centimeters*/ - -// MidEta - row.mMinSeedHits = 5; /*Min number of seed hits allowed*/ - row.mMaxSeedHits =10; /*Max number of seed hits allowed*/ - row.mMinHits = 5; /*Min number of hits allowed*/ - row.mNorHits =10; /*Normal number of hits allowed*/ - row.mGoodHits =15; /*Good number of hits */ -// MidEta hitCount hitCount hitCount hitCount hitCount - row.mMinTotHits =3; /*Min number hits for track*/ - row.mMinGoodHits=3; /*Min number good hits for track*/ - row.mMinContHits=3; /*Min length of good hit sequence*/ -//row.mMaxContNits=15; /*Max length of acceptable non hit sequence*/ - row.mMaxContNits=10; /*Max length of acceptable non hit sequence*/ - row.mMaxTotNits =20; /*Max number of acceptable non hits*/ - - row.mRxyMax = 207; //Max radius for tracking - row.mZMax = 220; //Max Z for tracking -// ForwEta version - row.mMinSeedHitsFw = 4; /*Min number of seed hits allowed*/ - row.mMaxSeedHitsFw = 6; /*Max number of seed hits allowed*/ - row.mMinHitsFw = 4; /*Min number of hits allowed*/ - row.mNorHitsFw = 5; /*Normal number of hits allowed*/ - row.mGoodHitsFw =5; /*Good number of hits */ - -// ForwEta hitCount hitCount hitCount hitCount hitCount - row.mMinTotHitsFw =3; /*Min number hits for track*/ - row.mMinGoodHitsFw=3; /*Min number good hits for track*/ - row.mMinContHitsFw=3; /*Min length of good hit sequence*/ - row.mMaxContNitsFw=1; /*Max length of acceptable non hit sequence*/ - row.mMaxTotNitsFw =2; /*Max number of acceptable non hits*/ - row.mRxyMaxFw = 207; //Max radius for tracking - row.mZMaxFw = 700; //Max Z for tracking - - -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvPxlHitErrs.C b/StarDb/Calibrations/tracker/StvPxlHitErrs.C deleted file mode 100644 index 780440cee07..00000000000 --- a/StarDb/Calibrations/tracker/StvPxlHitErrs.C +++ /dev/null @@ -1,20 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// db/.data/StarDb/Calibrations/tracker/.ssdHitError/ssdHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes -// Table: HitError_st[0]--> HitError_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_HitError")) return 0; -HitError_st row; -St_HitError *tableSet = new St_HitError("StvPxlHitErrs",1); -// - Double_t sigma_y = 0.0012; // 12 mkm - Double_t sigma_z = 0.0012; // 12 mkm -memset(&row,0,tableSet->GetRowSize()); -// hit errors are squared ! - row.coeff[0] = sigma_y*sigma_y; // - row.coeff[1] = sigma_z*sigma_z; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20090315.000000.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20090315.000000.C deleted file mode 100644 index 7900c1c89bb..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20090315.000000.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.003112073; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.006408807; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.001792184; // Diffusion in XY direction ; - row.zzDiff = 0.009125377; // Diffusion in Z direction ; - row.yFact = 0.651482; // Error factor in Y-direction ; - row.zFact = 0.5302516; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20100101.000000.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20100101.000000.C deleted file mode 100644 index 06c4b9960b8..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.20100101.000000.C +++ /dev/null @@ -1,29 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -float yErrFact = 1; -float zErrFact = 1; -//yErrFact=1;zErrFact=1; - -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0003248401; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003155829; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.006162413; // Diffusion in XY direction ; - row.zzDiff = 0.008600485; // Diffusion in Z direction ; - row.yFact = 0.4891122; // Error factor in Y-direction ; - row.zFact = 0.5432013; // Error factor in Z-direction ; - row.yFact*=yErrFact; - row.zFact*=zErrFact; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.C deleted file mode 100644 index 4a4403173f0..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.C +++ /dev/null @@ -1,27 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -double myFactor = 3; -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0003248401; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003155829; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.006162413; // Diffusion in XY direction ; - row.zzDiff = 0.008600485; // Diffusion in Z direction ; - row.yFact = 0.4891122; // Error factor in Y-direction ; - row.zFact = 0.5432013; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -row.yFact*=myFactor; -row.zFact*=myFactor; - -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2009c.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2009c.C deleted file mode 100644 index b7e5eb1b127..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2009c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0003248401; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003155829; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.006162413; // Diffusion in XY direction ; - row.zzDiff = 0.008600485; // Diffusion in Z direction ; - row.yFact = 0.4891122; // Error factor in Y-direction ; - row.zFact = 0.5432013; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2010c.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2010c.C deleted file mode 100644 index b7e5eb1b127..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2010c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0003248401; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003155829; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.006162413; // Diffusion in XY direction ; - row.zzDiff = 0.008600485; // Diffusion in Z direction ; - row.yFact = 0.4891122; // Error factor in Y-direction ; - row.zFact = 0.5432013; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2011c.C b/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2011c.C deleted file mode 100644 index b7e5eb1b127..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerHitErrs.y2011c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcInnerHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0003248401; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003155829; // Intrinsic resolution, z direction ; - row.thkDet = 1.3225; // detector thickness , not fitted ; - row.yyDiff = 0.006162413; // Diffusion in XY direction ; - row.zzDiff = 0.008600485; // Diffusion in Z direction ; - row.yFact = 0.4891122; // Error factor in Y-direction ; - row.zFact = 0.5432013; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcInnerPromptErrs.C b/StarDb/Calibrations/tracker/StvTpcInnerPromptErrs.C deleted file mode 100644 index e0366e3ccc7..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcInnerPromptErrs.C +++ /dev/null @@ -1,17 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerPromptErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcPromptErrs_st[0]--> StvTpcPromptErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvHitErrs")) return 0; -StvHitErrs_st row; -St_StvHitErrs *tableSet = new St_StvHitErrs("StvTpcInnerPromptErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 4e-2; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 4e-2; // Intrinsic resolution, z direction ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20090315.000000.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20090315.000000.C deleted file mode 100644 index 366e46ce409..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20090315.000000.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.001025376; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.009810519; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.003210183; // Diffusion in XY direction ; - row.zzDiff = 0.0009121676; // Diffusion in Z direction ; - row.yFact = 0.4309839; // Error factor in Y-direction ; - row.zFact = 0.4151657; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20100101.000000.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20100101.000000.C deleted file mode 100644 index 71640e83072..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.20100101.000000.C +++ /dev/null @@ -1,28 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -float yErrFact = 1; -float zErrFact = 1; - -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0006493898; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003386928; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.004501354; // Diffusion in XY direction ; - row.zzDiff = 0.004859645; // Diffusion in Z direction ; - row.yFact = 0.4156496; // Error factor in Y-direction ; - row.zFact = 0.4108317; // Error factor in Z-direction ; - row.yFact*=yErrFact; - row.zFact*=zErrFact; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.C deleted file mode 100644 index f9526a647d5..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.C +++ /dev/null @@ -1,27 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -double myFactor = 3; -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0006493898; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003386928; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.004501354; // Diffusion in XY direction ; - row.zzDiff = 0.004859645; // Diffusion in Z direction ; - row.yFact = 0.4156496; // Error factor in Y-direction ; - row.zFact = 0.4108317; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -row.yFact*=myFactor; -row.zFact*=myFactor; - -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2009c.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2009c.C deleted file mode 100644 index 49366ab82e5..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2009c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0006493898; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003386928; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.004501354; // Diffusion in XY direction ; - row.zzDiff = 0.004859645; // Diffusion in Z direction ; - row.yFact = 0.4156496; // Error factor in Y-direction ; - row.zFact = 0.4108317; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2010c.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2010c.C deleted file mode 100644 index 49366ab82e5..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2010c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0006493898; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003386928; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.004501354; // Diffusion in XY direction ; - row.zzDiff = 0.004859645; // Diffusion in Z direction ; - row.yFact = 0.4156496; // Error factor in Y-direction ; - row.zFact = 0.4108317; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2011c.C b/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2011c.C deleted file mode 100644 index 49366ab82e5..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterHitErrs.y2011c.C +++ /dev/null @@ -1,23 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcOuterHitErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvTpcHitErrs")) return 0; -StvTpcHitErrs_st row; -St_StvTpcHitErrs *tableSet = new St_StvTpcHitErrs("StvTpcOuterHitErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 0.0006493898; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 0.003386928; // Intrinsic resolution, z direction ; - row.thkDet = 3.8025; // detector thickness , not fitted ; - row.yyDiff = 0.004501354; // Diffusion in XY direction ; - row.zzDiff = 0.004859645; // Diffusion in Z direction ; - row.yFact = 0.4156496; // Error factor in Y-direction ; - row.zFact = 0.4108317; // Error factor in Z-direction ; - row.zAB2 = 5.0293e-06; // Constant member in Z direction (a*b)**2 ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/StvTpcOuterPromptErrs.C b/StarDb/Calibrations/tracker/StvTpcOuterPromptErrs.C deleted file mode 100644 index 43a1d9eecf8..00000000000 --- a/StarDb/Calibrations/tracker/StvTpcOuterPromptErrs.C +++ /dev/null @@ -1,17 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// StvTpcInnerPromptErrs Allocated rows: 1 Used rows: 1 Row size: 64 bytes -// Table: StvTpcHitErrs_st[0]--> StvTpcHitErrs_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_StvHitErrs")) return 0; -StvHitErrs_st row; -St_StvHitErrs *tableSet = new St_StvHitErrs("StvTpcOuterPromptErrs",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.yErr = 4e-2; // Intrinsic resolution, padrow or Y direction ; - row.zErr = 4e-2; // Intrinsic resolution, z direction ; -tableSet->AddAt(&row); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Calibrations/tracker/ist1HitError.20050101.000000.C b/StarDb/Calibrations/tracker/ist1HitError.20050101.000000.C index 06e305c2a1a..73c72bcb013 100644 --- a/StarDb/Calibrations/tracker/ist1HitError.20050101.000000.C +++ b/StarDb/Calibrations/tracker/ist1HitError.20050101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ist1HitError/ist1HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/ist1HitError.20050101.000001.C b/StarDb/Calibrations/tracker/ist1HitError.20050101.000001.C index 1587fc9bcbb..f8dececbaca 100644 --- a/StarDb/Calibrations/tracker/ist1HitError.20050101.000001.C +++ b/StarDb/Calibrations/tracker/ist1HitError.20050101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ist1HitError/ist1HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/ist1HitError.upgr15.C b/StarDb/Calibrations/tracker/ist1HitError.upgr15.C index c358430730e..a0bbfbf99f9 100644 --- a/StarDb/Calibrations/tracker/ist1HitError.upgr15.C +++ b/StarDb/Calibrations/tracker/ist1HitError.upgr15.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ist1HitError/ist1HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/ist2HitError.20050101.000000.C b/StarDb/Calibrations/tracker/ist2HitError.20050101.000000.C index c1b4f12e236..2ab6b83e403 100644 --- a/StarDb/Calibrations/tracker/ist2HitError.20050101.000000.C +++ b/StarDb/Calibrations/tracker/ist2HitError.20050101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ist2HitError/ist2HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/ist3HitError.20050101.000000.C b/StarDb/Calibrations/tracker/ist3HitError.20050101.000000.C index 35a1cc11e5d..3a403344dad 100644 --- a/StarDb/Calibrations/tracker/ist3HitError.20050101.000000.C +++ b/StarDb/Calibrations/tracker/ist3HitError.20050101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.ist3HitError/ist3HitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tkf_tkfpar.20011201.000100.C b/StarDb/Calibrations/tracker/tkf_tkfpar.20011201.000100.C index a954fee0209..ef11c88719a 100644 --- a/StarDb/Calibrations/tracker/tkf_tkfpar.20011201.000100.C +++ b/StarDb/Calibrations/tracker/tkf_tkfpar.20011201.000100.C @@ -1,3 +1,5 @@ +#include "tables/St_tkf_tkfpar_Table.h" + TDataSet *CreateTable(){ // ----------------------------------------------------------------- // tkfpar Allocated rows: 1 Used rows: 1 Row diff --git a/StarDb/Calibrations/tracker/tkf_tkfpar.20050324.150000.C b/StarDb/Calibrations/tracker/tkf_tkfpar.20050324.150000.C index 3813d8fbe4e..603915b664d 100644 --- a/StarDb/Calibrations/tracker/tkf_tkfpar.20050324.150000.C +++ b/StarDb/Calibrations/tracker/tkf_tkfpar.20050324.150000.C @@ -1,3 +1,5 @@ +#include "tables/St_tkf_tkfpar_Table.h" + TDataSet *CreateTable(){ // ----------------------------------------------------------------- // tkfpar Allocated rows: 1 Used rows: 1 Row diff --git a/StarDb/Calibrations/tracker/tkf_tkfpar.C b/StarDb/Calibrations/tracker/tkf_tkfpar.C index a954fee0209..ef11c88719a 100644 --- a/StarDb/Calibrations/tracker/tkf_tkfpar.C +++ b/StarDb/Calibrations/tracker/tkf_tkfpar.C @@ -1,3 +1,5 @@ +#include "tables/St_tkf_tkfpar_Table.h" + TDataSet *CreateTable(){ // ----------------------------------------------------------------- // tkfpar Allocated rows: 1 Used rows: 1 Row diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.20091215.000003.C b/StarDb/Calibrations/tracker/tpcInnerHitError.20091215.000003.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.20091215.000003.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.20091215.000003.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.20100101.000000.C b/StarDb/Calibrations/tracker/tpcInnerHitError.20100101.000000.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.20100101.000000.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.20100101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.C b/StarDb/Calibrations/tracker/tpcInnerHitError.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.y2009c.C b/StarDb/Calibrations/tracker/tpcInnerHitError.y2009c.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.y2009c.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.y2009c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.y2010c.C b/StarDb/Calibrations/tracker/tpcInnerHitError.y2010c.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.y2010c.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.y2010c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcInnerHitError.y2011c.C b/StarDb/Calibrations/tracker/tpcInnerHitError.y2011c.C index cc9bc14b109..2a43c51cb72 100644 --- a/StarDb/Calibrations/tracker/tpcInnerHitError.y2011c.C +++ b/StarDb/Calibrations/tracker/tpcInnerHitError.y2011c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.20091215.000003.C b/StarDb/Calibrations/tracker/tpcOuterHitError.20091215.000003.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.20091215.000003.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.20091215.000003.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.20100101.000000.C b/StarDb/Calibrations/tracker/tpcOuterHitError.20100101.000000.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.20100101.000000.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.20100101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.C b/StarDb/Calibrations/tracker/tpcOuterHitError.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.y2009c.C b/StarDb/Calibrations/tracker/tpcOuterHitError.y2009c.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.y2009c.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.y2009c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.y2010c.C b/StarDb/Calibrations/tracker/tpcOuterHitError.y2010c.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.y2010c.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.y2010c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcOuterHitError.y2011c.C b/StarDb/Calibrations/tracker/tpcOuterHitError.y2011c.C index 1734f46706f..bb2d858c8f4 100644 --- a/StarDb/Calibrations/tracker/tpcOuterHitError.y2011c.C +++ b/StarDb/Calibrations/tracker/tpcOuterHitError.y2011c.C @@ -1,3 +1,5 @@ +#include "tables/St_HitError_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // someHitError Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Calibrations/tracker/tpcTrackingParameters.20010312.000011.C b/StarDb/Calibrations/tracker/tpcTrackingParameters.20010312.000011.C index 32a37da26bc..a85eba55b46 100644 --- a/StarDb/Calibrations/tracker/tpcTrackingParameters.20010312.000011.C +++ b/StarDb/Calibrations/tracker/tpcTrackingParameters.20010312.000011.C @@ -1,3 +1,5 @@ +#include "tables/St_TrackingParameters_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.data/StarDb/Calibrations/tracker/.DefaultTrackingParameters/DefaultTrackingParameters Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/Geometry/fst/fstOnTpc.20211110.000001.C b/StarDb/Geometry/fst/fstOnTpc.20211110.000001.C index 3b6965c076b..215e9355c83 100644 --- a/StarDb/Geometry/fst/fstOnTpc.20211110.000001.C +++ b/StarDb/Geometry/fst/fstOnTpc.20211110.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_Survey")) return 0; Survey_st row; diff --git a/StarDb/Geometry/fst/fstSensorOnWedge.20211110.000001.C b/StarDb/Geometry/fst/fstSensorOnWedge.20211110.000001.C index b145b957aff..6d283a743a3 100644 --- a/StarDb/Geometry/fst/fstSensorOnWedge.20211110.000001.C +++ b/StarDb/Geometry/fst/fstSensorOnWedge.20211110.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_Survey")) return 0; Survey_st row; diff --git a/StarDb/Geometry/fst/fstWedgeOnHss.20211110.000001.C b/StarDb/Geometry/fst/fstWedgeOnHss.20211110.000001.C index 1b6bc1b4fd0..2ba006d95a1 100644 --- a/StarDb/Geometry/fst/fstWedgeOnHss.20211110.000001.C +++ b/StarDb/Geometry/fst/fstWedgeOnHss.20211110.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_Survey")) return 0; Survey_st row; diff --git a/StarDb/Geometry/fst/hssOnFst.20211110.000001.C b/StarDb/Geometry/fst/hssOnFst.20211110.000001.C index 134e349d791..7825ecf19ce 100644 --- a/StarDb/Geometry/fst/hssOnFst.20211110.000001.C +++ b/StarDb/Geometry/fst/hssOnFst.20211110.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_Survey")) return 0; Survey_st row; diff --git a/StarDb/Geometry/ftpc/ftpcAsicMap.C b/StarDb/Geometry/ftpc/ftpcAsicMap.C index 124cf8b4abc..c4baaade9b1 100644 --- a/StarDb/Geometry/ftpc/ftpcAsicMap.C +++ b/StarDb/Geometry/ftpc/ftpcAsicMap.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcAsicMap_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ftpc/.ftpcAsicMap/ftpcAsicMap Allocated rows: 1 Used rows: 1 Row size: 4 bytes diff --git a/StarDb/Geometry/ftpc/ftpcClusterGeom.C b/StarDb/Geometry/ftpc/ftpcClusterGeom.C index e03f4182077..db3ef945219 100644 --- a/StarDb/Geometry/ftpc/ftpcClusterGeom.C +++ b/StarDb/Geometry/ftpc/ftpcClusterGeom.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcClusterGeom_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ftpc/.ftpcClusterGeom/ftpcClusterGeom Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/Geometry/ftpc/ftpcInnerCathode.C b/StarDb/Geometry/ftpc/ftpcInnerCathode.C index 1c13b6bc7c4..c3801b66b19 100644 --- a/StarDb/Geometry/ftpc/ftpcInnerCathode.C +++ b/StarDb/Geometry/ftpc/ftpcInnerCathode.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcInnerCathode_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ftpc/.ftpcInnerCathode/ftpcInnerCathode Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20131210.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20131210.000001.C index 45b27be2589..ef2a30d6493 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20131210.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20131210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20140101.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20140101.000001.C index 2e22abab2b7..397d2deec96 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20140101.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20140101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20141210.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20141210.000001.C index 45b27be2589..ef2a30d6493 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20141210.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20141210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20150101.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20150101.000001.C index 2fc9544e394..f69cf8a8e08 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20150101.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20150101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20151210.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20151210.000001.C index 45b27be2589..ef2a30d6493 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20151210.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20151210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/ist/istLadderOnIstMisalign.20160101.000001.C b/StarDb/Geometry/ist/istLadderOnIstMisalign.20160101.000001.C index 2fc9544e394..f69cf8a8e08 100644 --- a/StarDb/Geometry/ist/istLadderOnIstMisalign.20160101.000001.C +++ b/StarDb/Geometry/ist/istLadderOnIstMisalign.20160101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/ist/.istLadderOnIst/istLadderOnIstMisalign Allocated rows: 24 Used rows: 24 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20131210.000001.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20131210.000001.C index 269dbc68e08..97026e9bbda 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20131210.000001.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20131210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20140101.000000.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20140101.000000.C index 2d3e053d2bb..0ab2b7b630c 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20140101.000000.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20140101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20141210.000001.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20141210.000001.C index 269dbc68e08..97026e9bbda 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20141210.000001.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20141210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20150101.000001.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20150101.000001.C index bd822a70be2..4e425e8242f 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20150101.000001.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20150101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20151210.000001.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20151210.000001.C index 269dbc68e08..97026e9bbda 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20151210.000001.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20151210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20160101.000001.C b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20160101.000001.C index 7e57466b9b4..93118cc2dda 100644 --- a/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20160101.000001.C +++ b/StarDb/Geometry/pxl/pxlLadderOnSectorMisalign.20160101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/pxl/.pxlLadderOnSector/pxlLadderOnSectorMisalign Allocated rows: 40 Used rows: 40 Row size: 180 bytes diff --git a/StarDb/Geometry/ssd/SsdLaddersOnSectors.C b/StarDb/Geometry/ssd/SsdLaddersOnSectors.C index 015c8f8f215..3af395e6be7 100644 --- a/StarDb/Geometry/ssd/SsdLaddersOnSectors.C +++ b/StarDb/Geometry/ssd/SsdLaddersOnSectors.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2005.C b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2005.C index 015c8f8f215..3af395e6be7 100644 --- a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2005.C +++ b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2006.C b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2006.C index 015c8f8f215..3af395e6be7 100644 --- a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2006.C +++ b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2007.C b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2007.C index 015c8f8f215..3af395e6be7 100644 --- a/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2007.C +++ b/StarDb/Geometry/ssd/SsdLaddersOnSectors.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdOnGlobal.C b/StarDb/Geometry/ssd/SsdOnGlobal.C index 9e1fa36f4eb..e9b10500ea5 100644 --- a/StarDb/Geometry/ssd/SsdOnGlobal.C +++ b/StarDb/Geometry/ssd/SsdOnGlobal.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/ssd/SsdOnGlobal.y2005.C b/StarDb/Geometry/ssd/SsdOnGlobal.y2005.C index 9e1fa36f4eb..e9b10500ea5 100644 --- a/StarDb/Geometry/ssd/SsdOnGlobal.y2005.C +++ b/StarDb/Geometry/ssd/SsdOnGlobal.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/ssd/SsdOnGlobal.y2006.C b/StarDb/Geometry/ssd/SsdOnGlobal.y2006.C index 9e1fa36f4eb..e9b10500ea5 100644 --- a/StarDb/Geometry/ssd/SsdOnGlobal.y2006.C +++ b/StarDb/Geometry/ssd/SsdOnGlobal.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/ssd/SsdOnGlobal.y2007.C b/StarDb/Geometry/ssd/SsdOnGlobal.y2007.C index 9e1fa36f4eb..e9b10500ea5 100644 --- a/StarDb/Geometry/ssd/SsdOnGlobal.y2007.C +++ b/StarDb/Geometry/ssd/SsdOnGlobal.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.C b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.C index 744c067a508..e2fa95ee305 100644 --- a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.C +++ b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // SsdSectorsOnGlobal Allocated rows: 4 Used rows: 4 Row size: 180 bytes diff --git a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2005.C b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2005.C index 744c067a508..e2fa95ee305 100644 --- a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2005.C +++ b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // SsdSectorsOnGlobal Allocated rows: 4 Used rows: 4 Row size: 180 bytes diff --git a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2006.C b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2006.C index 744c067a508..e2fa95ee305 100644 --- a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2006.C +++ b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // SsdSectorsOnGlobal Allocated rows: 4 Used rows: 4 Row size: 180 bytes diff --git a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2007.C b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2007.C index 744c067a508..e2fa95ee305 100644 --- a/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2007.C +++ b/StarDb/Geometry/ssd/SsdSectorsOnGlobal.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // SsdSectorsOnGlobal Allocated rows: 4 Used rows: 4 Row size: 180 bytes diff --git a/StarDb/Geometry/ssd/SsdWafersOnLadders.C b/StarDb/Geometry/ssd/SsdWafersOnLadders.C index 73f0d1c51ac..ebec0634370 100644 --- a/StarDb/Geometry/ssd/SsdWafersOnLadders.C +++ b/StarDb/Geometry/ssd/SsdWafersOnLadders.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2005.C b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2005.C index 73f0d1c51ac..ebec0634370 100644 --- a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2005.C +++ b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2006.C b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2006.C index 73f0d1c51ac..ebec0634370 100644 --- a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2006.C +++ b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2007.C b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2007.C index 73f0d1c51ac..ebec0634370 100644 --- a/StarDb/Geometry/ssd/SsdWafersOnLadders.y2007.C +++ b/StarDb/Geometry/ssd/SsdWafersOnLadders.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20131210.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20131210.000001.C index 7bf09cc690c..20b5c2d1aec 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20131210.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20131210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20140101.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20140101.000001.C index b1c9a12e01b..50814dfaeb3 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20140101.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20140101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20141210.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20141210.000001.C index 7bf09cc690c..20b5c2d1aec 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20141210.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20141210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20150101.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20150101.000001.C index 4a43c8862ee..b41a9b7e47f 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20150101.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20150101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20151210.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20151210.000001.C index 7bf09cc690c..20b5c2d1aec 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20151210.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20151210.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20160101.000001.C b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20160101.000001.C index 00aec101ffc..830446a27c2 100644 --- a/StarDb/Geometry/sst/sstLadderOnSstMisalign.20160101.000001.C +++ b/StarDb/Geometry/sst/sstLadderOnSstMisalign.20160101.000001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/sst/.sstLadderOnSst/sstLadderOnSstMisalign Allocated rows: 20 Used rows: 20 Row size: 180 bytes diff --git a/StarDb/Geometry/svt/LadderOnShell.C b/StarDb/Geometry/svt/LadderOnShell.C index 07ea820b656..86e989f7a10 100644 --- a/StarDb/Geometry/svt/LadderOnShell.C +++ b/StarDb/Geometry/svt/LadderOnShell.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnShell.y2005.C b/StarDb/Geometry/svt/LadderOnShell.y2005.C index 07ea820b656..86e989f7a10 100644 --- a/StarDb/Geometry/svt/LadderOnShell.y2005.C +++ b/StarDb/Geometry/svt/LadderOnShell.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnShell.y2006.C b/StarDb/Geometry/svt/LadderOnShell.y2006.C index 07ea820b656..86e989f7a10 100644 --- a/StarDb/Geometry/svt/LadderOnShell.y2006.C +++ b/StarDb/Geometry/svt/LadderOnShell.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnShell.y2007.C b/StarDb/Geometry/svt/LadderOnShell.y2007.C index 07ea820b656..86e989f7a10 100644 --- a/StarDb/Geometry/svt/LadderOnShell.y2007.C +++ b/StarDb/Geometry/svt/LadderOnShell.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnSurvey.y2001.C b/StarDb/Geometry/svt/LadderOnSurvey.y2001.C index bf2a0777df7..6aaffc56aaf 100644 --- a/StarDb/Geometry/svt/LadderOnSurvey.y2001.C +++ b/StarDb/Geometry/svt/LadderOnSurvey.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnSurvey.y2005.C b/StarDb/Geometry/svt/LadderOnSurvey.y2005.C index bf2a0777df7..6aaffc56aaf 100644 --- a/StarDb/Geometry/svt/LadderOnSurvey.y2005.C +++ b/StarDb/Geometry/svt/LadderOnSurvey.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnSurvey.y2006.C b/StarDb/Geometry/svt/LadderOnSurvey.y2006.C index bf2a0777df7..6aaffc56aaf 100644 --- a/StarDb/Geometry/svt/LadderOnSurvey.y2006.C +++ b/StarDb/Geometry/svt/LadderOnSurvey.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/LadderOnSurvey.y2007.C b/StarDb/Geometry/svt/LadderOnSurvey.y2007.C index bf2a0777df7..6aaffc56aaf 100644 --- a/StarDb/Geometry/svt/LadderOnSurvey.y2007.C +++ b/StarDb/Geometry/svt/LadderOnSurvey.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/ShellOnGlobal.y2001.C b/StarDb/Geometry/svt/ShellOnGlobal.y2001.C index a463028fb81..8eb5266e8d1 100644 --- a/StarDb/Geometry/svt/ShellOnGlobal.y2001.C +++ b/StarDb/Geometry/svt/ShellOnGlobal.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/ShellOnGlobal.y2005.C b/StarDb/Geometry/svt/ShellOnGlobal.y2005.C index a463028fb81..8eb5266e8d1 100644 --- a/StarDb/Geometry/svt/ShellOnGlobal.y2005.C +++ b/StarDb/Geometry/svt/ShellOnGlobal.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/ShellOnGlobal.y2006.C b/StarDb/Geometry/svt/ShellOnGlobal.y2006.C index a463028fb81..8eb5266e8d1 100644 --- a/StarDb/Geometry/svt/ShellOnGlobal.y2006.C +++ b/StarDb/Geometry/svt/ShellOnGlobal.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/ShellOnGlobal.y2007.C b/StarDb/Geometry/svt/ShellOnGlobal.y2007.C index a463028fb81..8eb5266e8d1 100644 --- a/StarDb/Geometry/svt/ShellOnGlobal.y2007.C +++ b/StarDb/Geometry/svt/ShellOnGlobal.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/SvtOnGlobal.y2001.C b/StarDb/Geometry/svt/SvtOnGlobal.y2001.C index f1def4c5c73..ef5562fb909 100644 --- a/StarDb/Geometry/svt/SvtOnGlobal.y2001.C +++ b/StarDb/Geometry/svt/SvtOnGlobal.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/svt/SvtOnGlobal.y2005.C b/StarDb/Geometry/svt/SvtOnGlobal.y2005.C index f1def4c5c73..ef5562fb909 100644 --- a/StarDb/Geometry/svt/SvtOnGlobal.y2005.C +++ b/StarDb/Geometry/svt/SvtOnGlobal.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/svt/SvtOnGlobal.y2006.C b/StarDb/Geometry/svt/SvtOnGlobal.y2006.C index f1def4c5c73..ef5562fb909 100644 --- a/StarDb/Geometry/svt/SvtOnGlobal.y2006.C +++ b/StarDb/Geometry/svt/SvtOnGlobal.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/svt/SvtOnGlobal.y2007.C b/StarDb/Geometry/svt/SvtOnGlobal.y2007.C index f1def4c5c73..ef5562fb909 100644 --- a/StarDb/Geometry/svt/SvtOnGlobal.y2007.C +++ b/StarDb/Geometry/svt/SvtOnGlobal.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0,.1,.1,.1,.1,.1,.1,"ideal position"}; diff --git a/StarDb/Geometry/svt/WaferOnLadder.y2001.C b/StarDb/Geometry/svt/WaferOnLadder.y2001.C index eb14ff8667a..5da89a23287 100644 --- a/StarDb/Geometry/svt/WaferOnLadder.y2001.C +++ b/StarDb/Geometry/svt/WaferOnLadder.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/WaferOnLadder.y2005.C b/StarDb/Geometry/svt/WaferOnLadder.y2005.C index eb14ff8667a..5da89a23287 100644 --- a/StarDb/Geometry/svt/WaferOnLadder.y2005.C +++ b/StarDb/Geometry/svt/WaferOnLadder.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/WaferOnLadder.y2006.C b/StarDb/Geometry/svt/WaferOnLadder.y2006.C index eb14ff8667a..5da89a23287 100644 --- a/StarDb/Geometry/svt/WaferOnLadder.y2006.C +++ b/StarDb/Geometry/svt/WaferOnLadder.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/svt/WaferOnLadder.y2007.C b/StarDb/Geometry/svt/WaferOnLadder.y2007.C index eb14ff8667a..5da89a23287 100644 --- a/StarDb/Geometry/svt/WaferOnLadder.y2007.C +++ b/StarDb/Geometry/svt/WaferOnLadder.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // diff --git a/StarDb/Geometry/tpc/TpcHalfPosition.C b/StarDb/Geometry/tpc/TpcHalfPosition.C index ce1418916eb..7a1631ed4e2 100644 --- a/StarDb/Geometry/tpc/TpcHalfPosition.C +++ b/StarDb/Geometry/tpc/TpcHalfPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcHalfPosition.y2019.C b/StarDb/Geometry/tpc/TpcHalfPosition.y2019.C index ce1418916eb..7a1631ed4e2 100755 --- a/StarDb/Geometry/tpc/TpcHalfPosition.y2019.C +++ b/StarDb/Geometry/tpc/TpcHalfPosition.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcInnerSectorPosition.C b/StarDb/Geometry/tpc/TpcInnerSectorPosition.C index cbe23df3555..b3681f300df 100644 --- a/StarDb/Geometry/tpc/TpcInnerSectorPosition.C +++ b/StarDb/Geometry/tpc/TpcInnerSectorPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcInnerSectorPositionB.C b/StarDb/Geometry/tpc/TpcInnerSectorPositionB.C index cbe23df3555..b3681f300df 100644 --- a/StarDb/Geometry/tpc/TpcInnerSectorPositionB.C +++ b/StarDb/Geometry/tpc/TpcInnerSectorPositionB.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcInnerSectorPositionB.y2016.C b/StarDb/Geometry/tpc/TpcInnerSectorPositionB.y2016.C index cbe23df3555..b3681f300df 100755 --- a/StarDb/Geometry/tpc/TpcInnerSectorPositionB.y2016.C +++ b/StarDb/Geometry/tpc/TpcInnerSectorPositionB.y2016.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcOuterSectorPosition.C b/StarDb/Geometry/tpc/TpcOuterSectorPosition.C index 09c697028fa..aad8a00ab56 100644 --- a/StarDb/Geometry/tpc/TpcOuterSectorPosition.C +++ b/StarDb/Geometry/tpc/TpcOuterSectorPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcOuterSectorPositionB.C b/StarDb/Geometry/tpc/TpcOuterSectorPositionB.C index eb07da22fd4..ff6c2e22390 100644 --- a/StarDb/Geometry/tpc/TpcOuterSectorPositionB.C +++ b/StarDb/Geometry/tpc/TpcOuterSectorPositionB.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/Geometry/tpc/TpcPosition.C b/StarDb/Geometry/tpc/TpcPosition.C index 6ad4f9cf4f8..25d25a744f1 100644 --- a/StarDb/Geometry/tpc/TpcPosition.C +++ b/StarDb/Geometry/tpc/TpcPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/Geometry/tpc/TpcSuperSectorPosition.C b/StarDb/Geometry/tpc/TpcSuperSectorPosition.C index ca9dc8b0b7a..de38a263133 100644 --- a/StarDb/Geometry/tpc/TpcSuperSectorPosition.C +++ b/StarDb/Geometry/tpc/TpcSuperSectorPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = {0, 1,0,0, 0,1,0, 0,0,1, 0,0,0, 1e-5,1e-5,1e-4,4e-3,4e-3,4e-3,"Ideal"}; diff --git a/StarDb/Geometry/tpc/TpcSuperSectorPositionB.C b/StarDb/Geometry/tpc/TpcSuperSectorPositionB.C index 89b83696a20..88c852650ae 100644 --- a/StarDb/Geometry/tpc/TpcSuperSectorPositionB.C +++ b/StarDb/Geometry/tpc/TpcSuperSectorPositionB.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/Geometry/tpc/TpcSuperSectorPositionB.y2019.C b/StarDb/Geometry/tpc/TpcSuperSectorPositionB.y2019.C index 89b83696a20..88c852650ae 100755 --- a/StarDb/Geometry/tpc/TpcSuperSectorPositionB.y2019.C +++ b/StarDb/Geometry/tpc/TpcSuperSectorPositionB.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/Geometry/tpc/iTPCSurvey.C b/StarDb/Geometry/tpc/iTPCSurvey.C index 72546e8ef9c..5e823e9b0a2 100644 --- a/StarDb/Geometry/tpc/iTPCSurvey.C +++ b/StarDb/Geometry/tpc/iTPCSurvey.C @@ -1,3 +1,5 @@ +#include "tables/St_iTPCSurvey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_iTPCSurvey")) return 0; iTPCSurvey_st row[24] = { diff --git a/StarDb/Geometry/tpc/iTPCSurvey.y2019.C b/StarDb/Geometry/tpc/iTPCSurvey.y2019.C index 3adab08a82f..c07bbf72980 100644 --- a/StarDb/Geometry/tpc/iTPCSurvey.y2019.C +++ b/StarDb/Geometry/tpc/iTPCSurvey.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_iTPCSurvey_Table.h" + TDataSet *CreateTable() { /* Shanmuganathan Prashanth 11/14/18 Position iTPC-Sector diff --git a/StarDb/Geometry/tpc/itpcPadPlanes.C b/StarDb/Geometry/tpc/itpcPadPlanes.C index a4d87ebd5de..3c2d19e597b 100644 --- a/StarDb/Geometry/tpc/itpcPadPlanes.C +++ b/StarDb/Geometry/tpc/itpcPadPlanes.C @@ -1,3 +1,5 @@ +#include "tables/St_itpcPadPlanes_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/tpc/.itpcPadPlanes/itpcPadPlanes Allocated rows: 1 Used rows: 1 Row size: 1392 bytes diff --git a/StarDb/Geometry/tpc/tpcGlobalPosition.C b/StarDb/Geometry/tpc/tpcGlobalPosition.C index 9aa62d73367..74bd14c60c5 100644 --- a/StarDb/Geometry/tpc/tpcGlobalPosition.C +++ b/StarDb/Geometry/tpc/tpcGlobalPosition.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcGlobalPosition_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcGlobalPosition")) return 0; tpcGlobalPosition_st row; diff --git a/StarDb/Geometry/tpc/tpcPadConfig.C b/StarDb/Geometry/tpc/tpcPadConfig.C deleted file mode 100644 index e51b2f8592d..00000000000 --- a/StarDb/Geometry/tpc/tpcPadConfig.C +++ /dev/null @@ -1,14 +0,0 @@ -TDataSet *CreateTable() { - // ----------------------------------------------------------------- - // db/.const/StarDb/Geometry/tpc/.tpcPadConfig/tpcPadConfig Allocated rows: 1 Used rows: 1 Row size: 1392 bytes - // Table: tpcPadConfig_st[0]--> tpcPadConfig_st[0] - // ==================================================================== - // ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_tpcPadConfig")) return 0; - tpcPadConfig_st row; - St_tpcPadConfig *tableSet = new St_tpcPadConfig("tpcPadConfig",1); - for (Int_t i = 1; i <=24; i++) row.itpc[i-1] = 0; - tableSet->AddAt(&row); - // ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Geometry/tpc/tpcPadConfig.y2018.C b/StarDb/Geometry/tpc/tpcPadConfig.y2018.C deleted file mode 100644 index 76c36cf1083..00000000000 --- a/StarDb/Geometry/tpc/tpcPadConfig.y2018.C +++ /dev/null @@ -1,17 +0,0 @@ -TDataSet *CreateTable() { - // ----------------------------------------------------------------- - // db/.const/StarDb/Geometry/tpc/.tpcPadConfig/tpcPadConfig Allocated rows: 1 Used rows: 1 Row size: 1392 bytes - // Table: tpcPadConfig_st[0]--> tpcPadConfig_st[0] - // ==================================================================== - // ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_tpcPadConfig")) return 0; - tpcPadConfig_st row; - St_tpcPadConfig *tableSet = new St_tpcPadConfig("tpcPadConfig",1); - Int_t i = 0; - for (i = 1; i <=24; i++) row.itpc[i-1] = 0; - i = 20; - row.itpc[i-1] = 1; - tableSet->AddAt(&row); - // ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Geometry/tpc/tpcPadConfig.y2019.C b/StarDb/Geometry/tpc/tpcPadConfig.y2019.C deleted file mode 100644 index f9dfd73ed34..00000000000 --- a/StarDb/Geometry/tpc/tpcPadConfig.y2019.C +++ /dev/null @@ -1,15 +0,0 @@ -TDataSet *CreateTable() { - // ----------------------------------------------------------------- - // db/.const/StarDb/Geometry/tpc/.tpcPadConfig/tpcPadConfig Allocated rows: 1 Used rows: 1 Row size: 1392 bytes - // Table: tpcPadConfig_st[0]--> tpcPadConfig_st[0] - // ==================================================================== - // ------ Test whether this table share library was loaded ------ - if (!TClass::GetClass("St_tpcPadConfig")) return 0; - tpcPadConfig_st row; - St_tpcPadConfig *tableSet = new St_tpcPadConfig("tpcPadConfig",1); - Int_t i = 0; - for (i = 1; i <=24; i++) row.itpc[i-1] = 1; - tableSet->AddAt(&row); - // ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/Geometry/tpc/tpcPadPlanes.C b/StarDb/Geometry/tpc/tpcPadPlanes.C index 6cf30863c5c..33cc36f6c75 100644 --- a/StarDb/Geometry/tpc/tpcPadPlanes.C +++ b/StarDb/Geometry/tpc/tpcPadPlanes.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcPadPlanes_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/Geometry/tpc/.tpcPadPlanes/tpcPadPlanes Allocated rows: 1 Used rows: 1 Row size: 1392 bytes diff --git a/StarDb/RunLog/MagFactor.y2011.C b/StarDb/RunLog/MagFactor.y2011.C index 85c3d18893e..cfa38eebc52 100644 --- a/StarDb/RunLog/MagFactor.y2011.C +++ b/StarDb/RunLog/MagFactor.y2011.C @@ -1,3 +1,5 @@ +#include "tables/St_MagFactor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // StarDb/.data/StarDb/RunLog/MagFactor Allocated rows: 1 Used rows: 1 Row size: 4 bytes diff --git a/StarDb/RunLog/MagFactor.y2012.C b/StarDb/RunLog/MagFactor.y2012.C index 85c3d18893e..cfa38eebc52 100644 --- a/StarDb/RunLog/MagFactor.y2012.C +++ b/StarDb/RunLog/MagFactor.y2012.C @@ -1,3 +1,5 @@ +#include "tables/St_MagFactor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // StarDb/.data/StarDb/RunLog/MagFactor Allocated rows: 1 Used rows: 1 Row size: 4 bytes diff --git a/StarDb/RunLog/MagFactor.y2013.C b/StarDb/RunLog/MagFactor.y2013.C index 85c3d18893e..cfa38eebc52 100644 --- a/StarDb/RunLog/MagFactor.y2013.C +++ b/StarDb/RunLog/MagFactor.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_MagFactor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // StarDb/.data/StarDb/RunLog/MagFactor Allocated rows: 1 Used rows: 1 Row size: 4 bytes diff --git a/StarDb/RunLog/MagFactor.y2014.C b/StarDb/RunLog/MagFactor.y2014.C index 85c3d18893e..cfa38eebc52 100644 --- a/StarDb/RunLog/MagFactor.y2014.C +++ b/StarDb/RunLog/MagFactor.y2014.C @@ -1,3 +1,5 @@ +#include "tables/St_MagFactor_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // StarDb/.data/StarDb/RunLog/MagFactor Allocated rows: 1 Used rows: 1 Row size: 4 bytes diff --git a/StarDb/RunLog/onl/beamInfo.C b/StarDb/RunLog/onl/beamInfo.C index 77eb6ef4589..b594c12c484 100644 --- a/StarDb/RunLog/onl/beamInfo.C +++ b/StarDb/RunLog/onl/beamInfo.C @@ -1,3 +1,5 @@ +#include "tables/St_beamInfo_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/RunLog/onl/.beamInfo/beamInfo Allocated rows: 1 Used rows: 1 Row size: 120 bytes diff --git a/StarDb/RunLog/onl/starClockOnl.C b/StarDb/RunLog/onl/starClockOnl.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.C +++ b/StarDb/RunLog/onl/starClockOnl.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2001.C b/StarDb/RunLog/onl/starClockOnl.y2001.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2001.C +++ b/StarDb/RunLog/onl/starClockOnl.y2001.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2003.C b/StarDb/RunLog/onl/starClockOnl.y2003.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2003.C +++ b/StarDb/RunLog/onl/starClockOnl.y2003.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2004.C b/StarDb/RunLog/onl/starClockOnl.y2004.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2004.C +++ b/StarDb/RunLog/onl/starClockOnl.y2004.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2005.C b/StarDb/RunLog/onl/starClockOnl.y2005.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2005.C +++ b/StarDb/RunLog/onl/starClockOnl.y2005.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2006.C b/StarDb/RunLog/onl/starClockOnl.y2006.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2006.C +++ b/StarDb/RunLog/onl/starClockOnl.y2006.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2007.C b/StarDb/RunLog/onl/starClockOnl.y2007.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2007.C +++ b/StarDb/RunLog/onl/starClockOnl.y2007.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2008.C b/StarDb/RunLog/onl/starClockOnl.y2008.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2008.C +++ b/StarDb/RunLog/onl/starClockOnl.y2008.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2009.C b/StarDb/RunLog/onl/starClockOnl.y2009.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2009.C +++ b/StarDb/RunLog/onl/starClockOnl.y2009.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2010.C b/StarDb/RunLog/onl/starClockOnl.y2010.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2010.C +++ b/StarDb/RunLog/onl/starClockOnl.y2010.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2011.C b/StarDb/RunLog/onl/starClockOnl.y2011.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2011.C +++ b/StarDb/RunLog/onl/starClockOnl.y2011.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2012.C b/StarDb/RunLog/onl/starClockOnl.y2012.C index d978981e9d8..3e76df4076a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2012.C +++ b/StarDb/RunLog/onl/starClockOnl.y2012.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2013.C b/StarDb/RunLog/onl/starClockOnl.y2013.C index 2341853c622..c307d40e65a 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2013.C +++ b/StarDb/RunLog/onl/starClockOnl.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starClockOnl.y2014.C b/StarDb/RunLog/onl/starClockOnl.y2014.C index 3ef55b54330..944b7a2e766 100644 --- a/StarDb/RunLog/onl/starClockOnl.y2014.C +++ b/StarDb/RunLog/onl/starClockOnl.y2014.C @@ -1,3 +1,5 @@ +#include "tables/St_starClockOnl_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_starClockOnl")) return 0; starClockOnl_st row; diff --git a/StarDb/RunLog/onl/starMagOnl.C b/StarDb/RunLog/onl/starMagOnl.C index 316f981462f..2be6e1a0554 100644 --- a/StarDb/RunLog/onl/starMagOnl.C +++ b/StarDb/RunLog/onl/starMagOnl.C @@ -1,3 +1,5 @@ +#include "tables/St_starMagOnl_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // db/.const/StarDb/RunLog/onl/.starMagOnl/starMagOnl Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/RunLog/onl/tpcRDOMasks.C b/StarDb/RunLog/onl/tpcRDOMasks.C index a40502c19e9..a0683ff85a1 100644 --- a/StarDb/RunLog/onl/tpcRDOMasks.C +++ b/StarDb/RunLog/onl/tpcRDOMasks.C @@ -1,3 +1,5 @@ +#include "tables/St_tpcRDOMasks_Table.h" + TDataSet *CreateTable() { if (!TClass::GetClass("St_tpcRDOMasks")) return 0; tpcRDOMasks_st row; diff --git a/StarDb/RunLog/onl/triggerID.C b/StarDb/RunLog/onl/triggerID.C index 3987acb8e38..6e061f8000a 100644 --- a/StarDb/RunLog/onl/triggerID.C +++ b/StarDb/RunLog/onl/triggerID.C @@ -1,3 +1,5 @@ +#include "tables/St_triggerID_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // bfc/.make/db/.const/StarDb/RunLog/onl/.triggerID/triggerID Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/StMagF/MagFieldRotation.y2013.C b/StarDb/StMagF/MagFieldRotation.y2013.C index a31d3fa8a46..1ac09308ea7 100644 --- a/StarDb/StMagF/MagFieldRotation.y2013.C +++ b/StarDb/StMagF/MagFieldRotation.y2013.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/StMagF/MagFieldRotation.y2014.C b/StarDb/StMagF/MagFieldRotation.y2014.C index a31d3fa8a46..1ac09308ea7 100644 --- a/StarDb/StMagF/MagFieldRotation.y2014.C +++ b/StarDb/StMagF/MagFieldRotation.y2014.C @@ -1,3 +1,5 @@ +#include "tables/St_Survey_Table.h" + TDataSet *CreateTable() { if (!gROOT->GetClass("St_Survey")) return 0; Survey_st row = { diff --git a/StarDb/ctf/ctg/ctb.C b/StarDb/ctf/ctg/ctb.C index e6c49ccb2d2..edcf63e7010 100644 --- a/StarDb/ctf/ctg/ctb.C +++ b/StarDb/ctf/ctg/ctb.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_geo_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/ctb Allocated rows: 1 Used rows: 1 Row size: 68 bytes diff --git a/StarDb/ctf/ctg/ctb_slat.C b/StarDb/ctf/ctg/ctb_slat.C index c1f42698e3e..d36571676e8 100644 --- a/StarDb/ctf/ctg/ctb_slat.C +++ b/StarDb/ctf/ctg/ctb_slat.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // params/ctf/ctg/ctb_slat Allocated rows: 240 Used rows: 240 Row size: 32 bytes diff --git a/StarDb/ctf/ctg/ctb_slat_eta.C b/StarDb/ctf/ctg/ctb_slat_eta.C index 6e5ce69bf0b..5a78352c666 100644 --- a/StarDb/ctf/ctg/ctb_slat_eta.C +++ b/StarDb/ctf/ctg/ctb_slat_eta.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_eta_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/ctb_slat_eta Allocated rows: 4 Used rows: 4 Row size: 36 bytes diff --git a/StarDb/ctf/ctg/ctb_slat_phi.C b/StarDb/ctf/ctg/ctb_slat_phi.C index 42e7147778e..3778e198f1e 100644 --- a/StarDb/ctf/ctg/ctb_slat_phi.C +++ b/StarDb/ctf/ctg/ctb_slat_phi.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_phi_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/ctb_slat_phi Allocated rows: 60 Used rows: 60 Row size: 16 bytes diff --git a/StarDb/ctf/ctg/tof.C b/StarDb/ctf/ctg/tof.C index 8cb8290701d..56b1cf65675 100644 --- a/StarDb/ctf/ctg/tof.C +++ b/StarDb/ctf/ctg/tof.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_geo_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/tof Allocated rows: 1 Used rows: 1 Row size: 68 bytes diff --git a/StarDb/ctf/ctg/tof_slat.C b/StarDb/ctf/ctg/tof_slat.C index 69be2e8158c..686372af301 100644 --- a/StarDb/ctf/ctg/tof_slat.C +++ b/StarDb/ctf/ctg/tof_slat.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // params/ctf/ctg/tof_slat Allocated rows: 5400 Used rows: 5400 Row size: 32 bytes diff --git a/StarDb/ctf/ctg/tof_slat_eta.C b/StarDb/ctf/ctg/tof_slat_eta.C index cc79c23e6d4..f049a85802b 100644 --- a/StarDb/ctf/ctg/tof_slat_eta.C +++ b/StarDb/ctf/ctg/tof_slat_eta.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_eta_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/tof_slat_eta Allocated rows: 18 Used rows: 18 Row size: 36 bytes diff --git a/StarDb/ctf/ctg/tof_slat_phi.C b/StarDb/ctf/ctg/tof_slat_phi.C index 03007ded5ef..82401e6c8d5 100644 --- a/StarDb/ctf/ctg/tof_slat_phi.C +++ b/StarDb/ctf/ctg/tof_slat_phi.C @@ -1,3 +1,5 @@ +#include "tables/St_ctg_slat_phi_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ctg/tof_slat_phi Allocated rows: 300 Used rows: 300 Row size: 16 bytes diff --git a/StarDb/ctf/cts/cts_ctb.C b/StarDb/ctf/cts/cts_ctb.C index 3d91a214b89..3b45f2e2a5a 100644 --- a/StarDb/ctf/cts/cts_ctb.C +++ b/StarDb/ctf/cts/cts_ctb.C @@ -1,3 +1,5 @@ +#include "tables/St_cts_mpara_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cts/cts_ctb Allocated rows: 1 Used rows: 1 Row size: 1076 bytes diff --git a/StarDb/ctf/cts/cts_tof.C b/StarDb/ctf/cts/cts_tof.C index f5941ee3d6f..b8d356a7aec 100644 --- a/StarDb/ctf/cts/cts_tof.C +++ b/StarDb/ctf/cts/cts_tof.C @@ -1,3 +1,5 @@ +#include "tables/St_cts_mpara_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cts/cts_tof Allocated rows: 1 Used rows: 1 Row size: 1076 bytes diff --git a/StarDb/dEdxModel/PiDC/pidCorrection.19GeV_2019_P23id.C b/StarDb/dEdxModel/PiDC/pidCorrection.19GeV_2019_P23id.C new file mode 100644 index 00000000000..bc9897535ad --- /dev/null +++ b/StarDb/dEdxModel/PiDC/pidCorrection.19GeV_2019_P23id.C @@ -0,0 +1,50 @@ +TDataSet *CreateTable() { +// ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_pidCorrection")) return 0; + struct pid_t { // replace a[10] => a0, a1, ..., a9 for cint + Int_t idx; // row index > 0 if it is real + Int_t nrows; // total no. of real rows in the table; For Db interface (where nrows = 50) + Int_t type; // type = 0 polymonical fit, use only [min,max] + Int_t var; // fit variable: 0 => pmomL10, 1 => bgL10, + Int_t particle; // from StEvent/StPidParticleDefinition.h : kUndef = -1, kPidElectron = 0, Proton = 1, Kaon = 2, Pion = 3, Muon = 4, Deuteron = 5, Triton = 6, + // He3 = 7, Alpha = 8, He6 = 9, Li5 = 10, Li6,= 11, Li7 = 12, Be7 = 13, Be9 = 14, Be10 = 15, B11 = 16 + Int_t charge; // +/-1, 0 does not matter + Int_t pull; // != 0 calculated pull correction, == 0 to value + Int_t det; // from StdEdxY2Maker/StTrackPiD.h : kUndef = 0, kI70 = 1, kI70U = 2, kFit = 3, kFitU = 4, kdNdx = 5, kdNdxU = 6, kBTof -7 , kETof = 8, kMtd = 9, kBEmc = 10 + Int_t npar; // npar < 0, X = exp(x) paramterization; abs(npar) >= 100 cut on range [min.max] + Double_t OffSet; // for future use + Double_t min; // fit range + Double_t max; // + Double_t a0; // a[npar] + Double_t a1; // a[npar] + Double_t a2; // a[npar] + Double_t a3; // a[npar] + Double_t a4; // a[npar] + Double_t a5; // a[npar] + Double_t a6; // a[npar] + Double_t a7; // a[npar] + Double_t a8; // a[npar] + Double_t a9; // a[npar] + Char_t comment[32]; + }; + pid_t rows[] = { + //idx,nrows,type,var,part,ch,pull,det,npar,off, min, max, a[10] ,comment + { 0, 0, 0, 0, 3, 0, 0, 3, 4, 0,-0.40, 0.70, 0.0054041, -0.00632595, -0.0149973, -0.00102721, 0,0,0,0,0,0,"PionDEV_dEdx pol3"}, + { 0, 0, 0, 0, 3, 0, 0, 3, 5, 0,-1.10,-0.40, -0.365241, -2.71187, -6.99333, -7.441, -2.76148,0,0,0,0,0,"PionDEV_dEdx pol4"}, + { 0, 0, 0, 0, 1, 0, 0, 3, 4, 0,-0.20, 0.81, 0.0147197, -0.0258435, 0.0812796, -0.140962, 0,0,0,0,0,0,"ProtonDEV_dEdx pol3"}, + { 0, 0, 0, 0, 1, 0, 0, 3, 3, 0,-0.65,-0.20, 0.000859774, -0.110058, 0.0587036, 0,0,0,0,0,0,0,"ProtonDEV_dEdx pol2"}, + { 0, 0, 0, 0, 1, 0, 0, 3, 3, 0,-1.00,-0.65, -1.74183, -5.57528, -4.24693, 0,0,0,0,0,0,0,"ProtonDEV_dEdx pol2"}, + { 0, 0, 0, 0, 0, 0, 0, 3, 4, 0,-0.75, 0.45, 0.121418, 0.0562044, -0.0726388, -0.031316, 0,0,0,0,0,0,"EDEV_dEdx pol3"}, + { 0, 0, 0, 0, 0, 0, 0, 3, 4, 0,-0.85,-0.75, -0.150987, -0.309554, 0.196893, 0.330907, 0,0,0,0,0,0,"EDEV_dEdx pol3"}, + { 0, 0, 0, 0, 0, 0, 0, 3, 4, 0,-1.20,-0.85, -3.9045, -12.4966, -12.8273, -4.23391, 0,0,0,0,0,0,"EDEV_dEdx pol3"} + }; + Int_t nrows = sizeof(rows)/sizeof(pidCorrection_st); + St_pidCorrection *tableSet = new St_pidCorrection("pidCorrection",nrows); + for (Int_t i = 0; i < nrows; i++) { + rows[i].idx = i+1; + rows[i].nrows = nrows; + tableSet->AddAt(&rows[i].idx); + } + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} diff --git a/StarDb/dEdxModel/PiDC/pidCorrection.C b/StarDb/dEdxModel/PiDC/pidCorrection.C new file mode 100644 index 00000000000..9724719d734 --- /dev/null +++ b/StarDb/dEdxModel/PiDC/pidCorrection.C @@ -0,0 +1,44 @@ +TDataSet *CreateTable() { +// ------ Test whether this table share library was loaded ------ + if (!gROOT->GetClass("St_pidCorrection")) return 0; + struct pid_t { // replace a[10] => a0, a1, ..., a9 for cint + Int_t idx; // row index > 0 if it is real + Int_t nrows; // total no. of real rows in the table; For Db interface (where nrows = 50) + Int_t type; // type = 0 polymonical fit, use only [min,max] + Int_t var; // fit variable: 0 => pmomL10, 1 => bgL10, + Int_t particle; // from StEvent/StPidParticleDefinition.h : kUndef = -1, kPidElectron = 0, Proton = 1, Kaon = 2, Pion = 3, Muon = 4, Deuteron = 5, Triton = 6, + // He3 = 7, Alpha = 8, He6 = 9, Li5 = 10, Li6,= 11, Li7 = 12, Be7 = 13, Be9 = 14, Be10 = 15, B11 = 16 + Int_t charge; // +/-1, 0 does not matter + Int_t pull; // != 0 calculated pull correction, == 0 to value + Int_t det; // from StdEdxY2Maker/StTrackPiD.h : kUndef = 0, kI70 = 1, kI70U = 2, kFit = 3, kFitU = 4, kdNdx = 5, kdNdxU = 6, kBTof -7 , kETof = 8, kMtd = 9, kBEmc = 10 + Int_t npar; // npar < 0, X = exp(x) paramterization; abs(npar) >= 100 cut on range [min.max] + Double_t OffSet; // for future use + Double_t min; // fit range + Double_t max; // + Double_t a0; // a[npar] + Double_t a1; // a[npar] + Double_t a2; // a[npar] + Double_t a3; // a[npar] + Double_t a4; // a[npar] + Double_t a5; // a[npar] + Double_t a6; // a[npar] + Double_t a7; // a[npar] + Double_t a8; // a[npar] + Double_t a9; // a[npar] + Char_t comment[32]; + }; + pid_t rows[] = { + //idx,nrows,type,var,part,ch,pull,det,npar,off,min,max,a[10] + { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,""}, + { 0, 0, 0, 0, 0, 0, 1, 3, 0, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,""} + }; + Int_t nrows = sizeof(rows)/sizeof(pidCorrection_st); + St_pidCorrection *tableSet = new St_pidCorrection("pidCorrection",nrows); + for (Int_t i = 0; i < nrows; i++) { + rows[i].idx = i+1; + rows[i].nrows = nrows; + tableSet->AddAt(&rows[i].idx); + } + // ----------------- end of code --------------- + return (TDataSet *)tableSet; +} diff --git a/StarDb/dEdxModel/PiDC/pidCorrection.r2019.C b/StarDb/dEdxModel/PiDC/pidCorrection.r2019.C new file mode 120000 index 00000000000..d23473efe25 --- /dev/null +++ b/StarDb/dEdxModel/PiDC/pidCorrection.r2019.C @@ -0,0 +1 @@ +pidCorrection.19GeV_2019_P23id.C \ No newline at end of file diff --git a/StarDb/dEdxModel/dNdx_Bichsel.root b/StarDb/dEdxModel/dNdx_Bichsel.root index e197a13cf8a..804184cdfad 100644 Binary files a/StarDb/dEdxModel/dNdx_Bichsel.root and b/StarDb/dEdxModel/dNdx_Bichsel.root differ diff --git a/StarDb/dEdxModel/spline3LndNdxL10.C b/StarDb/dEdxModel/spline3LndNdxL10.C new file mode 100644 index 00000000000..6890be2658f --- /dev/null +++ b/StarDb/dEdxModel/spline3LndNdxL10.C @@ -0,0 +1,13 @@ +TDataSet *CreateTable() { + if (!gROOT->GetClass("St_spline3")) return 0; + Int_t nrows = 1; + St_spline3 *tableSet = new St_spline3("spline3LndNdxL10",nrows); + spline3_st row; + memset(&row,0,tableSet->GetRowSize()); + row.nknots = 14; + Double_t X[14] = {-2.05,-1.5,-1,-0.5,0,0.25,0.5,0.75,1,1.5,2,3,4,5.15}; + Double_t Y[14] = {10.8534,9.17952,7.2945,5.35299,3.83234,3.49396,3.39275,3.41151,3.46255,3.59647,3.67184,3.69744,3.70087,3.70114}; + for (Int_t i = 0; i < 14; i++) {row.Xknots[i] = X[i]; row.Yknots[i] = Y[i];} + tableSet->AddAt(&row); + return (TDataSet *)tableSet; +} diff --git a/StarDb/ebye/sca/sca_const.C b/StarDb/ebye/sca/sca_const.C index 2ef42f60287..88830b2a482 100644 --- a/StarDb/ebye/sca/sca_const.C +++ b/StarDb/ebye/sca/sca_const.C @@ -1,3 +1,5 @@ +#include "tables/St_sca_const_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/sca/sca_const Allocated rows: 1 Used rows: 1 Row size: 112 bytes diff --git a/StarDb/ebye/sca/sca_filter_const.C b/StarDb/ebye/sca/sca_filter_const.C index 6602aa039c1..ad8460614b8 100644 --- a/StarDb/ebye/sca/sca_filter_const.C +++ b/StarDb/ebye/sca/sca_filter_const.C @@ -1,3 +1,5 @@ +#include "tables/St_sca_filter_const_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/sca/sca_filter_const Allocated rows: 1 Used rows: 1 Row size: 28 bytes diff --git a/StarDb/ebye/sca/sca_switch.C b/StarDb/ebye/sca/sca_switch.C index e4fe71af735..28e62269c33 100644 --- a/StarDb/ebye/sca/sca_switch.C +++ b/StarDb/ebye/sca/sca_switch.C @@ -1,3 +1,5 @@ +#include "tables/St_sca_switch_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/sca/sca_switch Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/emc/cal/ems_cal_control.C b/StarDb/emc/cal/ems_cal_control.C index 04c3cf441ba..558e7f24090 100644 --- a/StarDb/emc/cal/ems_cal_control.C +++ b/StarDb/emc/cal/ems_cal_control.C @@ -1,3 +1,5 @@ +#include "tables/St_ems_cal_control_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/ems_cal_control Allocated rows: 1 Used rows: 1 Row size: 52 bytes diff --git a/StarDb/emc/cal/org_ped_bemc.C b/StarDb/emc/cal/org_ped_bemc.C index b8ca0da4c39..99063d27e9e 100644 --- a/StarDb/emc/cal/org_ped_bemc.C +++ b/StarDb/emc/cal/org_ped_bemc.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bemc Allocated rows: 4800 Used rows: 4800 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_bemc_h.C b/StarDb/emc/cal/org_ped_bemc_h.C index eb79a6b34a5..7e42e164066 100644 --- a/StarDb/emc/cal/org_ped_bemc_h.C +++ b/StarDb/emc/cal/org_ped_bemc_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bemc_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_ped_bprs.C b/StarDb/emc/cal/org_ped_bprs.C index a6b91e91589..5145fcfb92c 100644 --- a/StarDb/emc/cal/org_ped_bprs.C +++ b/StarDb/emc/cal/org_ped_bprs.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bprs Allocated rows: 4800 Used rows: 4800 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_bprs_h.C b/StarDb/emc/cal/org_ped_bprs_h.C index 884e40b83d3..7fd1063625f 100644 --- a/StarDb/emc/cal/org_ped_bprs_h.C +++ b/StarDb/emc/cal/org_ped_bprs_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bprs_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_ped_bsmde.C b/StarDb/emc/cal/org_ped_bsmde.C index d10c5c342f4..17083995cdb 100644 --- a/StarDb/emc/cal/org_ped_bsmde.C +++ b/StarDb/emc/cal/org_ped_bsmde.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bsmde Allocated rows: 18000 Used rows: 18000 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_bsmde_h.C b/StarDb/emc/cal/org_ped_bsmde_h.C index 60d49042e98..38a4d084a71 100644 --- a/StarDb/emc/cal/org_ped_bsmde_h.C +++ b/StarDb/emc/cal/org_ped_bsmde_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bsmde_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_ped_bsmdp.C b/StarDb/emc/cal/org_ped_bsmdp.C index a3aac06a465..937756fc6ae 100644 --- a/StarDb/emc/cal/org_ped_bsmdp.C +++ b/StarDb/emc/cal/org_ped_bsmdp.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bsmdp Allocated rows: 18000 Used rows: 18000 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_bsmdp_h.C b/StarDb/emc/cal/org_ped_bsmdp_h.C index fe81b1ab7a9..e12d79921f4 100644 --- a/StarDb/emc/cal/org_ped_bsmdp_h.C +++ b/StarDb/emc/cal/org_ped_bsmdp_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_bsmdp_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_ped_eemc.C b/StarDb/emc/cal/org_ped_eemc.C index 6d4940ea34a..5e392a3c2e4 100644 --- a/StarDb/emc/cal/org_ped_eemc.C +++ b/StarDb/emc/cal/org_ped_eemc.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_eemc Allocated rows: 1440 Used rows: 1440 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_eemc_h.C b/StarDb/emc/cal/org_ped_eemc_h.C index 13fbab92544..97f536438f2 100644 --- a/StarDb/emc/cal/org_ped_eemc_h.C +++ b/StarDb/emc/cal/org_ped_eemc_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_eemc_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_ped_eprs.C b/StarDb/emc/cal/org_ped_eprs.C index 64af4b0e69e..177e600d2a3 100644 --- a/StarDb/emc/cal/org_ped_eprs.C +++ b/StarDb/emc/cal/org_ped_eprs.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_pedestal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_eprs Allocated rows: 1440 Used rows: 1440 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_ped_eprs_h.C b/StarDb/emc/cal/org_ped_eprs_h.C index 7f00f7e6ba7..8931783a3e6 100644 --- a/StarDb/emc/cal/org_ped_eprs_h.C +++ b/StarDb/emc/cal/org_ped_eprs_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_ped_eprs_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_bemc.C b/StarDb/emc/cal/org_slp_bemc.C index 2745b4a329a..fe1800625f0 100644 --- a/StarDb/emc/cal/org_slp_bemc.C +++ b/StarDb/emc/cal/org_slp_bemc.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bemc Allocated rows: 4800 Used rows: 4800 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_bemc_h.C b/StarDb/emc/cal/org_slp_bemc_h.C index 8b15b7d7dc3..55514b0bf76 100644 --- a/StarDb/emc/cal/org_slp_bemc_h.C +++ b/StarDb/emc/cal/org_slp_bemc_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bemc_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_bprs.C b/StarDb/emc/cal/org_slp_bprs.C index 236cea7e4f5..9f412d5dcc5 100644 --- a/StarDb/emc/cal/org_slp_bprs.C +++ b/StarDb/emc/cal/org_slp_bprs.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bprs Allocated rows: 4800 Used rows: 4800 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_bprs_h.C b/StarDb/emc/cal/org_slp_bprs_h.C index 4bde731335f..e26ee89ab6b 100644 --- a/StarDb/emc/cal/org_slp_bprs_h.C +++ b/StarDb/emc/cal/org_slp_bprs_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bprs_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_bsmde.C b/StarDb/emc/cal/org_slp_bsmde.C index 783315b52b2..542c1c314a5 100644 --- a/StarDb/emc/cal/org_slp_bsmde.C +++ b/StarDb/emc/cal/org_slp_bsmde.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bsmde Allocated rows: 18000 Used rows: 18000 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_bsmde_h.C b/StarDb/emc/cal/org_slp_bsmde_h.C index 4efe97fc287..d4c00bf9ac0 100644 --- a/StarDb/emc/cal/org_slp_bsmde_h.C +++ b/StarDb/emc/cal/org_slp_bsmde_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bsmde_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_bsmdp.C b/StarDb/emc/cal/org_slp_bsmdp.C index 9ebfef3bd22..fe2067b2f71 100644 --- a/StarDb/emc/cal/org_slp_bsmdp.C +++ b/StarDb/emc/cal/org_slp_bsmdp.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bsmdp Allocated rows: 18000 Used rows: 18000 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_bsmdp_h.C b/StarDb/emc/cal/org_slp_bsmdp_h.C index 6706ea62404..dd4c98faf1b 100644 --- a/StarDb/emc/cal/org_slp_bsmdp_h.C +++ b/StarDb/emc/cal/org_slp_bsmdp_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_bsmdp_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_eemc.C b/StarDb/emc/cal/org_slp_eemc.C index 345c79380c9..a16a8ac7f68 100644 --- a/StarDb/emc/cal/org_slp_eemc.C +++ b/StarDb/emc/cal/org_slp_eemc.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_eemc Allocated rows: 1440 Used rows: 1440 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_eemc_h.C b/StarDb/emc/cal/org_slp_eemc_h.C index 375722dbffd..a4d067fc7e7 100644 --- a/StarDb/emc/cal/org_slp_eemc_h.C +++ b/StarDb/emc/cal/org_slp_eemc_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_eemc_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/cal/org_slp_eprs.C b/StarDb/emc/cal/org_slp_eprs.C index 272fa01efa3..33aacf7e54c 100644 --- a/StarDb/emc/cal/org_slp_eprs.C +++ b/StarDb/emc/cal/org_slp_eprs.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_adcslope_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_eprs Allocated rows: 1440 Used rows: 1440 Row size: 4 bytes diff --git a/StarDb/emc/cal/org_slp_eprs_h.C b/StarDb/emc/cal/org_slp_eprs_h.C index a4c81f56886..4fcf5c11fcb 100644 --- a/StarDb/emc/cal/org_slp_eprs_h.C +++ b/StarDb/emc/cal/org_slp_eprs_h.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_calib_header_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/cal/org_slp_eprs_h Allocated rows: 1 Used rows: 1 Row size: 24 bytes diff --git a/StarDb/emc/ems/control_toadc.C b/StarDb/emc/ems/control_toadc.C index 08e3646ac5e..d8ee067e924 100644 --- a/StarDb/emc/ems/control_toadc.C +++ b/StarDb/emc/ems/control_toadc.C @@ -1,3 +1,5 @@ +#include "tables/St_control_toadc_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ems/control_toadc Allocated rows: 1 Used rows: 1 Row size: 224 bytes diff --git a/StarDb/emc/ems/ems_control.C b/StarDb/emc/ems/ems_control.C index acb7c6bc515..1eb4020ccb0 100644 --- a/StarDb/emc/ems/ems_control.C +++ b/StarDb/emc/ems/ems_control.C @@ -1,3 +1,5 @@ +#include "tables/St_ems_control_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ems/ems_control Allocated rows: 1 Used rows: 1 Row size: 340 bytes diff --git a/StarDb/emc/jet/emc_egrid_par.C b/StarDb/emc/jet/emc_egrid_par.C index ce88173e4ac..b034dacd8b5 100644 --- a/StarDb/emc/jet/emc_egrid_par.C +++ b/StarDb/emc/jet/emc_egrid_par.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_egrid_par_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/jet/emc_egrid_par Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/emc/jet/emc_jetpar.C b/StarDb/emc/jet/emc_jetpar.C index ca5aec2271e..aa156ee496a 100644 --- a/StarDb/emc/jet/emc_jetpar.C +++ b/StarDb/emc/jet/emc_jetpar.C @@ -1,3 +1,5 @@ +#include "tables/St_emc_jetpar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/jet/emc_jetpar Allocated rows: 1 Used rows: 1 Row size: 76 bytes diff --git a/StarDb/emc/simulator/Simulator.C b/StarDb/emc/simulator/Simulator.C index 5d97512ec49..00e0acc70b6 100644 --- a/StarDb/emc/simulator/Simulator.C +++ b/StarDb/emc/simulator/Simulator.C @@ -1,3 +1,5 @@ +#include "tables/St_controlEmcPmtSimulator_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Simulator Allocated rows: 4 Used rows: 4 Row size: 32 bytes diff --git a/StarDb/emc/simulator/controlEmcSimulatorMaker.C b/StarDb/emc/simulator/controlEmcSimulatorMaker.C index 79d5b0044aa..81292c2270f 100644 --- a/StarDb/emc/simulator/controlEmcSimulatorMaker.C +++ b/StarDb/emc/simulator/controlEmcSimulatorMaker.C @@ -1,3 +1,5 @@ +#include "tables/St_controlEmcSimulatorMaker_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // controlEmcSimulatorMaker Allocated rows: 1 Used rows: 1 Row size: 10 bytes diff --git a/StarDb/ftpc/ftpcClusterPars.C b/StarDb/ftpc/ftpcClusterPars.C index b8eae2bb8fc..a580633e8c7 100644 --- a/StarDb/ftpc/ftpcClusterPars.C +++ b/StarDb/ftpc/ftpcClusterPars.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcClusterPars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcClusterPars Allocated rows: 1 Used rows: 1 Row size: 156 bytes diff --git a/StarDb/ftpc/ftpcFastSimGas.C b/StarDb/ftpc/ftpcFastSimGas.C index 110c12a3797..9f073fb2306 100644 --- a/StarDb/ftpc/ftpcFastSimGas.C +++ b/StarDb/ftpc/ftpcFastSimGas.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcFastSimGas_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcFastSimGas Allocated rows: 1 Used rows: 1 Row size: 100 bytes diff --git a/StarDb/ftpc/ftpcFastSimPars.C b/StarDb/ftpc/ftpcFastSimPars.C index 5b8c18c84e1..f337cb8393d 100644 --- a/StarDb/ftpc/ftpcFastSimPars.C +++ b/StarDb/ftpc/ftpcFastSimPars.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcFastSimPars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcFastSimPars Allocated rows: 1 Used rows: 1 Row size: 44 bytes diff --git a/StarDb/ftpc/ftpcSlowSimGas.C b/StarDb/ftpc/ftpcSlowSimGas.C index 0094a5ffcd8..709f7e2ca95 100644 --- a/StarDb/ftpc/ftpcSlowSimGas.C +++ b/StarDb/ftpc/ftpcSlowSimGas.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcSlowSimGas_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcSlowSimGas Allocated rows: 132 Used rows: 132 Row size: 24 bytes diff --git a/StarDb/ftpc/ftpcSlowSimPars.C b/StarDb/ftpc/ftpcSlowSimPars.C index a6bdc61ca3d..98a2e5301e9 100644 --- a/StarDb/ftpc/ftpcSlowSimPars.C +++ b/StarDb/ftpc/ftpcSlowSimPars.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcSlowSimPars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcSlowSimPars Allocated rows: 1 Used rows: 1 Row size: 44 bytes diff --git a/StarDb/ftpc/ftpcTrackingPars.C b/StarDb/ftpc/ftpcTrackingPars.C index dfe94b13127..b0782530ebd 100644 --- a/StarDb/ftpc/ftpcTrackingPars.C +++ b/StarDb/ftpc/ftpcTrackingPars.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcTrackingPars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcTrackingPars Allocated rows: 1 Used rows: 1 Row size: ??? bytes diff --git a/StarDb/ftpc/ftpcdEdxPars.C b/StarDb/ftpc/ftpcdEdxPars.C index 2aa79a373dd..71b26b57900 100644 --- a/StarDb/ftpc/ftpcdEdxPars.C +++ b/StarDb/ftpc/ftpcdEdxPars.C @@ -1,3 +1,5 @@ +#include "tables/St_ftpcdEdxPars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ftpcdEdxPars Allocated rows: 1 Used rows: 1 Row size: 40 bytes diff --git a/StarDb/global/vertices/ev0par2.19960101.000000.C b/StarDb/global/vertices/ev0par2.19960101.000000.C index 9a578a3289b..81f225cbedb 100644 --- a/StarDb/global/vertices/ev0par2.19960101.000000.C +++ b/StarDb/global/vertices/ev0par2.19960101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20011201.000000.C b/StarDb/global/vertices/ev0par2.20011201.000000.C index a8461f29af5..20164153111 100644 --- a/StarDb/global/vertices/ev0par2.20011201.000000.C +++ b/StarDb/global/vertices/ev0par2.20011201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20011201.000100.C b/StarDb/global/vertices/ev0par2.20011201.000100.C index e6289122ccb..3bcb9741fff 100644 --- a/StarDb/global/vertices/ev0par2.20011201.000100.C +++ b/StarDb/global/vertices/ev0par2.20011201.000100.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20020201.000000.C b/StarDb/global/vertices/ev0par2.20020201.000000.C index 9a578a3289b..81f225cbedb 100644 --- a/StarDb/global/vertices/ev0par2.20020201.000000.C +++ b/StarDb/global/vertices/ev0par2.20020201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20021115.000000.C b/StarDb/global/vertices/ev0par2.20021115.000000.C index a8461f29af5..20164153111 100644 --- a/StarDb/global/vertices/ev0par2.20021115.000000.C +++ b/StarDb/global/vertices/ev0par2.20021115.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20031201.000000.C b/StarDb/global/vertices/ev0par2.20031201.000000.C index 9a578a3289b..81f225cbedb 100644 --- a/StarDb/global/vertices/ev0par2.20031201.000000.C +++ b/StarDb/global/vertices/ev0par2.20031201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20040325.023200.C b/StarDb/global/vertices/ev0par2.20040325.023200.C index fa6c8c7d3d4..4bac7253104 100644 --- a/StarDb/global/vertices/ev0par2.20040325.023200.C +++ b/StarDb/global/vertices/ev0par2.20040325.023200.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20050324.150000.C b/StarDb/global/vertices/ev0par2.20050324.150000.C index a8461f29af5..20164153111 100644 --- a/StarDb/global/vertices/ev0par2.20050324.150000.C +++ b/StarDb/global/vertices/ev0par2.20050324.150000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20070301.000000.C b/StarDb/global/vertices/ev0par2.20070301.000000.C index 9a578a3289b..81f225cbedb 100644 --- a/StarDb/global/vertices/ev0par2.20070301.000000.C +++ b/StarDb/global/vertices/ev0par2.20070301.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/ev0par2.20071125.000000.C b/StarDb/global/vertices/ev0par2.20071125.000000.C index a8461f29af5..20164153111 100644 --- a/StarDb/global/vertices/ev0par2.20071125.000000.C +++ b/StarDb/global/vertices/ev0par2.20071125.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_ev0_ev0par2_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // ev0par2 Allocated rows: 6 Used rows: 6 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.19960101.000000.C b/StarDb/global/vertices/exipar.19960101.000000.C index 8b60a89c32f..179743949a7 100644 --- a/StarDb/global/vertices/exipar.19960101.000000.C +++ b/StarDb/global/vertices/exipar.19960101.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20011201.000000.C b/StarDb/global/vertices/exipar.20011201.000000.C index de5de42a9cf..a53654a9a0f 100644 --- a/StarDb/global/vertices/exipar.20011201.000000.C +++ b/StarDb/global/vertices/exipar.20011201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20011201.000100.C b/StarDb/global/vertices/exipar.20011201.000100.C index cac44858097..cbbe5ceef79 100644 --- a/StarDb/global/vertices/exipar.20011201.000100.C +++ b/StarDb/global/vertices/exipar.20011201.000100.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20020201.000000.C b/StarDb/global/vertices/exipar.20020201.000000.C index 8b60a89c32f..179743949a7 100644 --- a/StarDb/global/vertices/exipar.20020201.000000.C +++ b/StarDb/global/vertices/exipar.20020201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20021115.000000.C b/StarDb/global/vertices/exipar.20021115.000000.C index de5de42a9cf..a53654a9a0f 100644 --- a/StarDb/global/vertices/exipar.20021115.000000.C +++ b/StarDb/global/vertices/exipar.20021115.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20031201.000000.C b/StarDb/global/vertices/exipar.20031201.000000.C index 8b60a89c32f..179743949a7 100644 --- a/StarDb/global/vertices/exipar.20031201.000000.C +++ b/StarDb/global/vertices/exipar.20031201.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20040325.023200.C b/StarDb/global/vertices/exipar.20040325.023200.C index b347936a050..d0c17fad45a 100644 --- a/StarDb/global/vertices/exipar.20040325.023200.C +++ b/StarDb/global/vertices/exipar.20040325.023200.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20050324.150000.C b/StarDb/global/vertices/exipar.20050324.150000.C index de5de42a9cf..a53654a9a0f 100644 --- a/StarDb/global/vertices/exipar.20050324.150000.C +++ b/StarDb/global/vertices/exipar.20050324.150000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20070301.000000.C b/StarDb/global/vertices/exipar.20070301.000000.C index 8b60a89c32f..179743949a7 100644 --- a/StarDb/global/vertices/exipar.20070301.000000.C +++ b/StarDb/global/vertices/exipar.20070301.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/exipar.20071125.000000.C b/StarDb/global/vertices/exipar.20071125.000000.C index de5de42a9cf..a53654a9a0f 100644 --- a/StarDb/global/vertices/exipar.20071125.000000.C +++ b/StarDb/global/vertices/exipar.20071125.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_exi_exipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // exipar Allocated rows: 3 Used rows: 3 Row size: 32 bytes diff --git a/StarDb/global/vertices/stk_vtx.C b/StarDb/global/vertices/stk_vtx.C index 016feed97ff..c97df7c13e4 100644 --- a/StarDb/global/vertices/stk_vtx.C +++ b/StarDb/global/vertices/stk_vtx.C @@ -1,3 +1,5 @@ +#include "tables/St_stk_vtx_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/vertices/stk_vtx Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/global/vertices/stk_vtx_direct.C b/StarDb/global/vertices/stk_vtx_direct.C index 66ab6d4e10d..9b0e6f30384 100644 --- a/StarDb/global/vertices/stk_vtx_direct.C +++ b/StarDb/global/vertices/stk_vtx_direct.C @@ -1,3 +1,5 @@ +#include "tables/St_stk_vtx_direct_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/vertices/stk_vtx_direct Allocated rows: 1 Used rows: 1 Row size: 16 bytes diff --git a/StarDb/mwc/mwcpars/cal.C b/StarDb/mwc/mwcpars/cal.C index 20a527e93c1..21cdb07abae 100644 --- a/StarDb/mwc/mwcpars/cal.C +++ b/StarDb/mwc/mwcpars/cal.C @@ -1,3 +1,5 @@ +#include "tables/St_mwc_cal_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/mwcpars/cal Allocated rows: 384 Used rows: 384 Row size: 12 bytes diff --git a/StarDb/mwc/mwcpars/geom.C b/StarDb/mwc/mwcpars/geom.C index ea2b197b4ca..cfbc13880b8 100644 --- a/StarDb/mwc/mwcpars/geom.C +++ b/StarDb/mwc/mwcpars/geom.C @@ -1,3 +1,5 @@ +#include "tables/St_mwc_geo_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/mwcpars/geom Allocated rows: 1 Used rows: 1 Row size: 28 bytes diff --git a/StarDb/mwc/mwcpars/mpar.C b/StarDb/mwc/mwcpars/mpar.C index c7c1b0ce567..caeadf4b151 100644 --- a/StarDb/mwc/mwcpars/mpar.C +++ b/StarDb/mwc/mwcpars/mpar.C @@ -1,3 +1,5 @@ +#include "tables/St_mwc_mpar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/mwcpars/mpar Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/svt/sgrpars/pix_info.C b/StarDb/svt/sgrpars/pix_info.C index a03fda85729..baf2fcc1e32 100644 --- a/StarDb/svt/sgrpars/pix_info.C +++ b/StarDb/svt/sgrpars/pix_info.C @@ -1,3 +1,5 @@ +#include "tables/St_sgr_pixmap_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/sgrpars/pix_info Allocated rows: 4 Used rows: 4 Row size: 28 bytes diff --git a/StarDb/svt/sprpars/sprpar.C b/StarDb/svt/sprpars/sprpar.C index 0871bb1a8e9..76bd295711d 100644 --- a/StarDb/svt/sprpars/sprpar.C +++ b/StarDb/svt/sprpars/sprpar.C @@ -1,3 +1,5 @@ +#include "tables/St_spr_sprpar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/sprpars/sprpar Allocated rows: 1 Used rows: 1 Row size: 8 bytes diff --git a/StarDb/svt/srspars/srs_activea.C b/StarDb/svt/srspars/srs_activea.C index d9351ebdb1b..f17f450ad9b 100644 --- a/StarDb/svt/srspars/srs_activea.C +++ b/StarDb/svt/srspars/srs_activea.C @@ -1,3 +1,5 @@ +#include "tables/St_srs_activea_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/srspars/srs_activea Allocated rows: 4 Used rows: 4 Row size: 44 bytes diff --git a/StarDb/svt/srspars/srs_srspar.C b/StarDb/svt/srspars/srs_srspar.C index 07d85b1d831..a9687f59793 100644 --- a/StarDb/svt/srspars/srs_srspar.C +++ b/StarDb/svt/srspars/srs_srspar.C @@ -1,3 +1,5 @@ +#include "tables/St_srs_srspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/srspars/srs_srspar Allocated rows: 1 Used rows: 1 Row size: 84 bytes diff --git a/StarDb/svt/ssd/sce_ctrl.C b/StarDb/svt/ssd/sce_ctrl.C deleted file mode 100644 index 10f8208e7e7..00000000000 --- a/StarDb/svt/ssd/sce_ctrl.C +++ /dev/null @@ -1,36 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// sce_ctrl Allocated rows: 1 Used rows: 1 Row size: 84 bytes -// Table: sce_ctrl_st[0]--> sce_ctrl_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_sce_ctrl")) return 0; -sce_ctrl_st row; -St_sce_ctrl *tableSet = new St_sce_ctrl("sce_ctrl",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.TrueClusterP = 1; // nbre of true cluster; - row.GhostClusterP = 1; // nbre of ghost cluster; - row.LostClusterP = 1; // nbre of lost cluster; - row.TrueClusterN = 1; // nbre of true cluster; - row.GhostClusterN = 1; // nbre of ghost cluster; - row.LostClusterN = 1; // nbre of lost cluster; - row.TrueSpt11 = 1; // nbre of true space point from 1-1 case; - row.GhostSpt11 = 1; // nbre of ghost ; - row.LostSpt11 = 1; // nbre of lost ; - row.TrueSpt12 = 1; // nbre of true space point from 1-2 case; - row.GhostSpt12 = 1; // nbre of ghost ; - row.LostSpt12 = 1; // nbre of lost ; - row.TrueSpt22 = 1; // nbre of true space point from 2-2 case; - row.GhostSpt22 = 1; // nbre of ghost ; - row.LostSpt22 = 1; // nbre of lost ; - row.TrueSpt23 = 1; // nbre of true space point from 2-3 case; - row.GhostSpt23 = 1; // nbre of ghost ; - row.LostSpt23 = 1; // nbre of lost ; - row.TrueSpt33 = 1; // nbre of true space point from 3-3 case; - row.GhostSpt33 = 1; // nbre of ghost ; - row.LostSpt33 = 1; // nbre of lost ; -tableSet->AddAt(&row,0); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/svt/ssd/scf_ctrl.C b/StarDb/svt/ssd/scf_ctrl.C deleted file mode 100644 index eaccdb5046d..00000000000 --- a/StarDb/svt/ssd/scf_ctrl.C +++ /dev/null @@ -1,17 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// scf_ctrl Allocated rows: 1 Used rows: 1 Row size: 8 bytes -// Table: scf_ctrl_st[0]--> scf_ctrl_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_scf_ctrl")) return 0; -scf_ctrl_st row; -St_scf_ctrl *tableSet = new St_scf_ctrl("scf_ctrl",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.high_cut = 5; // high cut for central strip ; - row.testTolerance = 0.2; // set to 20% ; -tableSet->AddAt(&row,0); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/svt/ssd/scm_ctrl.C b/StarDb/svt/ssd/scm_ctrl.C deleted file mode 100644 index ffea9730300..00000000000 --- a/StarDb/svt/ssd/scm_ctrl.C +++ /dev/null @@ -1,19 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// scm_ctrl Allocated rows: 1 Used rows: 1 Row size: 16 bytes -// Table: scm_ctrl_st[0]--> scm_ctrl_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_scm_ctrl")) return 0; -scm_ctrl_st row; -St_scm_ctrl *tableSet = new St_scm_ctrl("scm_ctrl",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.clusterTreat = 13; // max number of cluster in a matched ; - row.AdcTolerance = 0.2; // set to 20% ; - row.matchMean = 0; // matching mean ; - row.matchSigma = 8; // matching sigma ; -tableSet->AddAt(&row,0); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/svt/ssd/sdm_calib_par.C b/StarDb/svt/ssd/sdm_calib_par.C index 624ae459d43..609c12f5c12 100644 --- a/StarDb/svt/ssd/sdm_calib_par.C +++ b/StarDb/svt/ssd/sdm_calib_par.C @@ -1,3 +1,5 @@ +#include "tables/St_sdm_calib_par_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // sdm_calib_par Allocated rows: 1 Used rows: 1 Row size: 52 bytes diff --git a/StarDb/svt/ssd/sdm_condition_par.C b/StarDb/svt/ssd/sdm_condition_par.C index 10f714abf6c..eb29c71d82d 100644 --- a/StarDb/svt/ssd/sdm_condition_par.C +++ b/StarDb/svt/ssd/sdm_condition_par.C @@ -1,3 +1,5 @@ +#include "tables/St_sdm_condition_par_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // sdm_condition_par Allocated rows: 1 Used rows: 1 Row size: 96 bytes diff --git a/StarDb/svt/ssd/sdm_geom_par.C b/StarDb/svt/ssd/sdm_geom_par.C index b151b18d4f7..8e488ff6463 100644 --- a/StarDb/svt/ssd/sdm_geom_par.C +++ b/StarDb/svt/ssd/sdm_geom_par.C @@ -1,3 +1,5 @@ +#include "tables/St_sdm_geom_par_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // sdm_geom_par Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/svt/ssd/sls_ctrl.C b/StarDb/svt/ssd/sls_ctrl.C deleted file mode 100644 index 10f813e05a8..00000000000 --- a/StarDb/svt/ssd/sls_ctrl.C +++ /dev/null @@ -1,28 +0,0 @@ -TDataSet *CreateTable() { -// ----------------------------------------------------------------- -// sls_ctrl Allocated rows: 1 Used rows: 1 Row size: 80 bytes -// Table: sls_ctrl_st[0]--> sls_ctrl_st[0] -// ==================================================================== -// ------ Test whether this table share library was loaded ------ - if (!gROOT->GetClass("St_sls_ctrl")) return 0; -sls_ctrl_st row; -St_sls_ctrl *tableSet = new St_sls_ctrl("sls_ctrl",1); -// -memset(&row,0,tableSet->GetRowSize()); - row.NElectronInAMip = 22500; // in electron unit; - row.ADCDynamic = 20; // in mip unit; - row.A128Dynamic = 12; // in mip unit; - row.NBitEncoding = 10; // number od adc bit for encoding; - row.NStripInACluster = 4; // ; - row.PairCreationEnergy = 3.6e-09; // energy to create a e+e-pair(GeV); - row.ParDiffP = 0.00123; // ; - row.ParDiffN = 0.00094; // ; - row.ParIndRightP = 0.021; // ; - row.ParIndRightN = 0.026; // ; - row.ParIndLeftP = 0.013; // ; - row.ParIndLeftN = 0.01; // ; - row.DAQCutValue = 3; // in "sigma unit"; -tableSet->AddAt(&row,0); -// ----------------- end of code --------------- - return (TDataSet *)tableSet; -} diff --git a/StarDb/svt/stkpars/stk_filler.C b/StarDb/svt/stkpars/stk_filler.C index 6eb04b3b631..5dffe7bed30 100644 --- a/StarDb/svt/stkpars/stk_filler.C +++ b/StarDb/svt/stkpars/stk_filler.C @@ -1,3 +1,5 @@ +#include "tables/St_stk_filler_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/stkpars/stk_filler Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/svt/svgpars/config.C b/StarDb/svt/svgpars/config.C index d783288dffd..b0ffb780482 100644 --- a/StarDb/svt/svgpars/config.C +++ b/StarDb/svt/svgpars/config.C @@ -1,3 +1,5 @@ +#include "tables/St_svg_config_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/svgpars/config Allocated rows: 1 Used rows: 1 Row size: 1168 bytes diff --git a/StarDb/svt/svgpars/geom.C b/StarDb/svt/svgpars/geom.C index 5eafa14a849..a9f64ebf220 100644 --- a/StarDb/svt/svgpars/geom.C +++ b/StarDb/svt/svgpars/geom.C @@ -1,3 +1,5 @@ +#include "tables/St_svg_geom_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/svgpars/geom Allocated rows: 536 Used rows: 536 Row size: 68 bytes diff --git a/StarDb/svt/svgpars/geomy1l.C b/StarDb/svt/svgpars/geomy1l.C index 15cc75f6e1f..ba62860b489 100644 --- a/StarDb/svt/svgpars/geomy1l.C +++ b/StarDb/svt/svgpars/geomy1l.C @@ -1,3 +1,5 @@ +#include "tables/St_svg_geom_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/svgpars/geom Allocated rows: 7 Used rows: 7 diff --git a/StarDb/svt/svgpars/shape.C b/StarDb/svt/svgpars/shape.C index ed1b4753e07..3bb315837fe 100644 --- a/StarDb/svt/svgpars/shape.C +++ b/StarDb/svt/svgpars/shape.C @@ -1,3 +1,5 @@ +#include "tables/St_svg_shape_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/svgpars/shape Allocated rows: 2 Used rows: 2 Row size: 88 bytes diff --git a/StarDb/tpc/fmtpars/fmtpar.C b/StarDb/tpc/fmtpars/fmtpar.C index 1468efb47cb..48fd8185881 100644 --- a/StarDb/tpc/fmtpars/fmtpar.C +++ b/StarDb/tpc/fmtpars/fmtpar.C @@ -1,3 +1,5 @@ +#include "tables/St_tfc_fmtpar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/fmtpars/fmtpar Allocated rows: 1 Used rows: 1 Row size: 88 bytes diff --git a/StarDb/tpc/tclpars/tclpar.C b/StarDb/tpc/tclpars/tclpar.C index a093b52c99d..cb35f54f826 100644 --- a/StarDb/tpc/tclpars/tclpar.C +++ b/StarDb/tpc/tclpars/tclpar.C @@ -1,3 +1,5 @@ +#include "tables/St_tcl_tclpar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tclpars/tclpar Allocated rows: 1 Used rows: 1 Row size: 48 bytes diff --git a/StarDb/tpc/tclpars/type.C b/StarDb/tpc/tclpars/type.C index 47c0c7c5af8..7f3761b63d4 100644 --- a/StarDb/tpc/tclpars/type.C +++ b/StarDb/tpc/tclpars/type.C @@ -1,3 +1,5 @@ +#include "tables/St_tcl_tpc_index_type_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tclpars/type Allocated rows: 1 Used rows: 1 Row size: 28 bytes diff --git a/StarDb/tpc/tfspars/tfs_fsctrl.C b/StarDb/tpc/tfspars/tfs_fsctrl.C index 61ce364cc4d..040b37f6289 100644 --- a/StarDb/tpc/tfspars/tfs_fsctrl.C +++ b/StarDb/tpc/tfspars/tfs_fsctrl.C @@ -1,3 +1,5 @@ +#include "tables/St_tfs_fsctrl_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tfspars/tfs_fsctrl Allocated rows: 1 Used rows: 1 Row size: 32 bytes diff --git a/StarDb/tpc/tfspars/tfs_fspar.C b/StarDb/tpc/tfspars/tfs_fspar.C index 1f6df12bd8c..a8a8140baa0 100644 --- a/StarDb/tpc/tfspars/tfs_fspar.C +++ b/StarDb/tpc/tfspars/tfs_fspar.C @@ -1,3 +1,5 @@ +#include "tables/St_tfs_fspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tfspars/tfs_fspar Allocated rows: 1 Used rows: 1 Row size: 160 bytes diff --git a/StarDb/tpc/tidpars/tdeparm.C b/StarDb/tpc/tidpars/tdeparm.C index d6d49c1fefb..ccaf0a1621b 100644 --- a/StarDb/tpc/tidpars/tdeparm.C +++ b/StarDb/tpc/tidpars/tdeparm.C @@ -1,3 +1,5 @@ +#include "tables/St_tdeparm_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tidpars/tdeparm Allocated rows: 1 Used rows: 1 Row size: 60 bytes diff --git a/StarDb/tpc/tidpars/tpipar.C b/StarDb/tpc/tidpars/tpipar.C index 7ad6f89975c..7dd2456dcfe 100644 --- a/StarDb/tpc/tidpars/tpipar.C +++ b/StarDb/tpc/tidpars/tpipar.C @@ -1,3 +1,5 @@ +#include "tables/St_tpipar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tidpars/tpipar Allocated rows: 1 Used rows: 1 Row size: 132 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.20000217.000000.C b/StarDb/tpc/tptpars/tpt_pars.20000217.000000.C index 59c8849f0c9..7bd7c34ef8e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.20000217.000000.C +++ b/StarDb/tpc/tptpars/tpt_pars.20000217.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.20000301.000005.C b/StarDb/tpc/tptpars/tpt_pars.20000301.000005.C index 59c8849f0c9..7bd7c34ef8e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.20000301.000005.C +++ b/StarDb/tpc/tptpars/tpt_pars.20000301.000005.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.er99.C b/StarDb/tpc/tptpars/tpt_pars.er99.C index a312ba5843a..4797a523692 100644 --- a/StarDb/tpc/tptpars/tpt_pars.er99.C +++ b/StarDb/tpc/tptpars/tpt_pars.er99.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.sd97.C b/StarDb/tpc/tptpars/tpt_pars.sd97.C index 702f81de730..e454bf2b3dd 100644 --- a/StarDb/tpc/tptpars/tpt_pars.sd97.C +++ b/StarDb/tpc/tptpars/tpt_pars.sd97.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.year_1a.C b/StarDb/tpc/tptpars/tpt_pars.year_1a.C index feabdc5ac4c..70259f5b52e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.year_1a.C +++ b/StarDb/tpc/tptpars/tpt_pars.year_1a.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.year_1c.C b/StarDb/tpc/tptpars/tpt_pars.year_1c.C index feabdc5ac4c..70259f5b52e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.year_1c.C +++ b/StarDb/tpc/tptpars/tpt_pars.year_1c.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.year_1h.C b/StarDb/tpc/tptpars/tpt_pars.year_1h.C index feabdc5ac4c..70259f5b52e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.year_1h.C +++ b/StarDb/tpc/tptpars/tpt_pars.year_1h.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_pars.year_2a.C b/StarDb/tpc/tptpars/tpt_pars.year_2a.C index feabdc5ac4c..70259f5b52e 100644 --- a/StarDb/tpc/tptpars/tpt_pars.year_2a.C +++ b/StarDb/tpc/tptpars/tpt_pars.year_2a.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_pars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_pars Allocated rows: 2 Used rows: 2 Row size: 160 bytes diff --git a/StarDb/tpc/tptpars/tpt_spars.C b/StarDb/tpc/tptpars/tpt_spars.C index 188180e7254..f599386e8ce 100644 --- a/StarDb/tpc/tptpars/tpt_spars.C +++ b/StarDb/tpc/tptpars/tpt_spars.C @@ -1,3 +1,5 @@ +#include "tables/St_tpt_spars_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tptpars/tpt_spars Allocated rows: 1 Used rows: 1 Row size: 216 bytes diff --git a/StarDb/tpc/tsspars/tsspar.19991216.000000.C b/StarDb/tpc/tsspars/tsspar.19991216.000000.C index a0e78312efd..96c6ea6c4ff 100644 --- a/StarDb/tpc/tsspars/tsspar.19991216.000000.C +++ b/StarDb/tpc/tsspars/tsspar.19991216.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.19991217.000000.C b/StarDb/tpc/tsspars/tsspar.19991217.000000.C index a0e78312efd..96c6ea6c4ff 100644 --- a/StarDb/tpc/tsspars/tsspar.19991217.000000.C +++ b/StarDb/tpc/tsspars/tsspar.19991217.000000.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.er99.C b/StarDb/tpc/tsspars/tsspar.er99.C index c68b15563ca..449ad5ea5a9 100644 --- a/StarDb/tpc/tsspars/tsspar.er99.C +++ b/StarDb/tpc/tsspars/tsspar.er99.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.es99.C b/StarDb/tpc/tsspars/tsspar.es99.C index c68b15563ca..449ad5ea5a9 100644 --- a/StarDb/tpc/tsspars/tsspar.es99.C +++ b/StarDb/tpc/tsspars/tsspar.es99.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.sd97.C b/StarDb/tpc/tsspars/tsspar.sd97.C index 6653282ea37..85eac65f160 100644 --- a/StarDb/tpc/tsspars/tsspar.sd97.C +++ b/StarDb/tpc/tsspars/tsspar.sd97.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.y2018.C b/StarDb/tpc/tsspars/tsspar.y2018.C index d6370d8e0f8..5dee2357d38 100644 --- a/StarDb/tpc/tsspars/tsspar.y2018.C +++ b/StarDb/tpc/tsspars/tsspar.y2018.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.y2019.C b/StarDb/tpc/tsspars/tsspar.y2019.C index a0e78312efd..96c6ea6c4ff 100644 --- a/StarDb/tpc/tsspars/tsspar.y2019.C +++ b/StarDb/tpc/tsspars/tsspar.y2019.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.year_1a.C b/StarDb/tpc/tsspars/tsspar.year_1a.C index d6370d8e0f8..5dee2357d38 100644 --- a/StarDb/tpc/tsspars/tsspar.year_1a.C +++ b/StarDb/tpc/tsspars/tsspar.year_1a.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/tsspars/tsspar.year_1c.C b/StarDb/tpc/tsspars/tsspar.year_1c.C index d6370d8e0f8..5dee2357d38 100644 --- a/StarDb/tpc/tsspars/tsspar.year_1c.C +++ b/StarDb/tpc/tsspars/tsspar.year_1c.C @@ -1,3 +1,5 @@ +#include "tables/St_tss_tsspar_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/tsspars/tsspar Allocated rows: 1 Used rows: 1 Row size: 240 bytes diff --git a/StarDb/tpc/ttepars/tte_control.C b/StarDb/tpc/ttepars/tte_control.C index de4ac38fa45..f2151333ae0 100644 --- a/StarDb/tpc/ttepars/tte_control.C +++ b/StarDb/tpc/ttepars/tte_control.C @@ -1,3 +1,5 @@ +#include "tables/St_tte_control_Table.h" + TDataSet *CreateTable() { // ----------------------------------------------------------------- // Top/ttepars/tte_control Allocated rows: 1 Used rows: 1 Row size: 12 bytes diff --git a/StarVMC/GeoTestMaker/CompareInvX0.C b/StarVMC/GeoTestMaker/CompareInvX0.C deleted file mode 100644 index 56d3861620e..00000000000 --- a/StarVMC/GeoTestMaker/CompareInvX0.C +++ /dev/null @@ -1,90 +0,0 @@ -int loaded=0; - -void Load(); - -void CompareInvX0(const char *m1, const char *m2) -{ - Load(); - const TProfile2D *P[3]={0}; - const char *M[2]={m1,m2}; - - for (int i=0;i<2;i++) { - int ierr=0; - { gROOT->Macro(M[i],&ierr);} - if (ierr) return; - TString myTs(M[i]); - myTs = gSystem->BaseName(myTs); - assert(myTs(0,2) == "C_"); - myTs.Replace(0,2,""); - int j=0; - for (j=1; jFindObject(myTs); - if (!P[i]) {printf("***ERROR: Histogram %s NOT FOUND***\n",myTs.Data());return;} - - printf("File %s && hist %s OK\n",M[i],myTs.Data()); - } - - int nX = P[0]->GetXaxis()->GetNbins(); - assert(nX==P[1]->GetXaxis()->GetNbins()); - - int nY = P[0]->GetYaxis()->GetNbins(); - assert(nY==P[1]->GetYaxis()->GetNbins()); - - double xLow=P[0]->GetXaxis()->GetXmin(); - double xUpp=P[0]->GetXaxis()->GetXmax(); - double xWid=P[0]->GetXaxis()->GetBinWidth(1); - double yLow=P[0]->GetYaxis()->GetXmin(); - double yUpp=P[0]->GetYaxis()->GetXmax(); - double yWid=P[0]->GetYaxis()->GetBinWidth(1); - - TString myTs("Compare_"); myTs += P[0]->GetName(); - myTs+="_And_"; myTs += P[1]->GetName(); - P[2] = new StTProfile2D(myTs,myTs,nX,xLow,xUpp,nY,yLow,yUpp); - for (int iX=1;iX<=nX;iX++) { - for (int iY=1;iY<=nY;iY++) { - double cont[2]; - cont[0] = P[0]->GetBinContent(iX,iY); - cont[1] = P[1]->GetBinContent(iX,iY); - double sum = cont[0] + cont[1]; - if (sum <1e-4) continue; - double del = cont[1] - cont[0]; - double err = pow(P[0]->GetBinError(iX,iY),2) - + pow(P[1]->GetBinError(iX,iY),2); - -// if (del*del < 9*err) continue; -// if (fabs(del)< 0.005*sum) continue; - if (fabs(del)< 0.001*sum) continue; - P[2]->Fill(xLow+0.5*xWid*(iX-1),yLow+0.5*yWid*(iY-1),del); - } } - - TString ts("C_"); ts +=P[2]->GetName(); - TCanvas *CC = new TCanvas(ts,ts,600,800); - P[2]->Draw("colz"); - CC->Print(".C"); - CC->Print(".png"); -} - -void Load() -{ - -TH1D h1d; h1d.GetPainter(); -gSystem->Load("libVMC.so"); -gSystem->Load("St_base.so"); -gSystem->Load("St_Tables.so"); -gSystem->Load("StUtilities.so"); -gSystem->Load("StChain.so"); -gSystem->Load("StarVMCApplication.so"); -gSystem->Load("libStarMiniCern.so"); -gSystem->Load("libgeant3.so"); -gSystem->Load("GeoTestMaker.so"); -loaded=1; - -} - diff --git a/StarVMC/GeoTestMaker/GCall.cxx b/StarVMC/GeoTestMaker/GCall.cxx deleted file mode 100644 index 1c67def1f35..00000000000 --- a/StarVMC/GeoTestMaker/GCall.cxx +++ /dev/null @@ -1,51 +0,0 @@ -// $Id: GCall.cxx,v 1.4 2010/04/29 03:05:27 perev Exp $ -// -// -// Class GCall -// ------------------ -// Base class for Magnetic field calculation - -#include -#include -#include -#include "TError.h" -#include "GCall.h" - -ClassImp(GCall) -//_____________________________________________________________________________ -GCall::GCall(const char *name,const char *tit) - : TNamed(name,tit),fMC(0),fMCA(0) -{ - fDebug=0;fMC = 0; fMCA=0;fStack = 0; -} -//_____________________________________________________________________________ - void GCall::SetInterfaces(TVirtualMCApplication *mca,TVirtualMC *mc,TVirtualMCStack *stk) -{ - fMC = mc; fMCA=mca;fStack = stk; -} -//_____________________________________________________________________________ -int GCall::FunDD(const Double_t*, Double_t* b) -{ - Error("FunDD","Empty method is called"); - assert(0); return 0; - - } -//_____________________________________________________________________________ -void GCall::Field(const Double_t*, Double_t* b) -{ - Error("Field","Empty method is called"); - assert(0); -} -//_____________________________________________________________________________ -int GCall::Fun() -{ - Error("Fun","Empty method is called"); - assert(0);return 0; -} -//_____________________________________________________________________________ -void GCall::Print(const Option_t*) const -{ - Error("Print","Empty method is called"); -} - - diff --git a/StarVMC/GeoTestMaker/GCall.h b/StarVMC/GeoTestMaker/GCall.h deleted file mode 100644 index c3e0f514058..00000000000 --- a/StarVMC/GeoTestMaker/GCall.h +++ /dev/null @@ -1,49 +0,0 @@ -// $Id: GCall.h,v 1.2 2009/06/07 02:28:36 perev Exp $ -// -// -// Class GCall -// ------------------ - - -#ifndef STMC_USER_H -#define STMC_USER_H - -#include -class TVirtualMC;// ......................... Interface to Monte Carlo -class TVirtualMCApplication;// .............. Interface to MonteCarlo application -class TVirtualMCStack; - -class GCall : public TNamed -{ - public: - GCall(const char *name="Empty",const char *tit=""); - virtual ~GCall(){} - // methods - void SetInterfaces(TVirtualMCApplication *mca - ,TVirtualMC *mc - ,TVirtualMCStack *stk); - virtual void Init() {}; - virtual int Fun (); - virtual int FunDD(const Double_t* d1, Double_t* d2); - virtual void Field(const Double_t* d1, Double_t* d2); - virtual void Print(const Option_t* opt=0) const; - virtual void Finish(const Option_t* opt=0) {if(opt){}}; - - int operator()(){return Fun();} - int operator()(const double* d1, double* d2) {return FunDD(d1,d2);} - void SetDebug(int db=1) {fDebug = db ;} - int GetDebug() const {return fDebug;} - - protected: - // data members - int fDebug; - TVirtualMC *fMC; // .............. Interface to Monte Carlo - TVirtualMCApplication *fMCA;// .............. Interface to MonteCarlo application - TVirtualMCStack *fStack; - - ClassDef(GCall,0) // Extended TParticle -}; - -#endif //STMC_USER_H - - diff --git a/StarVMC/GeoTestMaker/GeoTestChain.C b/StarVMC/GeoTestMaker/GeoTestChain.C deleted file mode 100644 index c0e16e02254..00000000000 --- a/StarVMC/GeoTestMaker/GeoTestChain.C +++ /dev/null @@ -1,39 +0,0 @@ -int loaded=0; - -void Load(); -void GeoTestChain(const char *gy="y2009a(TPCE)",int nEv = 10000) -{ -if (!loaded) Load(); - - -StChain *chain = new StChain; -TString tsy(gy); -gSystem->ExpandPathName(tsy); -StMaker *mk = new GeoTestMaker("GeoTest",tsy.Data(), nEv); -mk->SetAttr("nPrim",100); -// StMaker *mk = new GeoTestMaker("GeoTest",tsy.Data(),1); -// mk->SetAttr("EtaMin",0.50); -// mk->SetAttr("EtaMax",0.51); -// mk->SetAttr("SteppingDebug",1); - - chain->Init(); - chain->EventLoop(1); - chain->Finish(); - -} - -void Load() -{ -TH1D h1d; h1d.GetPainter(); -gSystem->Load("libVMC.so"); -gSystem->Load("St_base.so"); -gSystem->Load("St_Tables.so"); -gSystem->Load("StUtilities.so"); -gSystem->Load("StChain.so"); -gSystem->Load("StarVMCApplication.so"); -gSystem->Load("libStarMiniCern.so"); -gSystem->Load("libgeant3.so"); -gSystem->Load("GeoTestMaker.so"); -loaded=1; - -} diff --git a/StarVMC/GeoTestMaker/GeoTestLoad.C b/StarVMC/GeoTestMaker/GeoTestLoad.C deleted file mode 100644 index 4dfb6763971..00000000000 --- a/StarVMC/GeoTestMaker/GeoTestLoad.C +++ /dev/null @@ -1,16 +0,0 @@ -int loaded=0; -void GeoTestLoad() -{ -TH1D h1d; h1d.GetPainter(); -gSystem->Load("libVMC.so"); -gSystem->Load("St_base.so"); -gSystem->Load("St_Tables.so"); -gSystem->Load("StUtilities.so"); -gSystem->Load("StChain.so"); -gSystem->Load("StarVMCApplication.so"); -gSystem->Load("libStarMiniCern.so"); -gSystem->Load("libgeant3.so"); -gSystem->Load("GeoTestMaker.so"); -loaded=1; - -} diff --git a/StarVMC/GeoTestMaker/GeoTestMaker.cxx b/StarVMC/GeoTestMaker/GeoTestMaker.cxx deleted file mode 100644 index 2e91cada566..00000000000 --- a/StarVMC/GeoTestMaker/GeoTestMaker.cxx +++ /dev/null @@ -1,136 +0,0 @@ -//*-- Author : Victor Perev -// -// $Id: GeoTestMaker.cxx,v 1.5 2013/04/20 21:53:41 perev Exp $ -// $Log: GeoTestMaker.cxx,v $ -// Revision 1.5 2013/04/20 21:53:41 perev -// Rename StTGeoHelper ==> StTGeoProxy -// -// Revision 1.4 2010/01/27 23:02:57 perev -// Development -// -// Revision 1.3 2009/08/29 21:19:04 perev -// 100 * 10000 tracks -// -// Revision 1.2 2009/06/07 02:28:36 perev -// 1st reasonable version with orth2 -// -// Revision 1.1 2009/03/25 23:15:10 perev -// New VMC maker -// -// Revision 1.9 2009/02/03 15:55:44 fisyak -// synchronize with .DEV2 -// -// Revision 1.2 2009/01/24 00:21:43 fisyak -// Fix debug flag -// -// Revision 1.1.1.1 2008/12/10 20:45:49 fisyak -// Merge with macos version -// -// Revision 1.8 2008/03/05 13:15:56 fisyak -// comply Skip signuture with base class -// -// Revision 1.7 2007/04/07 19:33:09 perev -// Check for input file added -// -// Revision 1.6 2007/01/09 04:53:20 potekhin -// New input modes -// -// Revision 1.4 2005/09/13 21:34:29 fisyak -// Move initialization from Init to InitRun, add conversion TGeoVolume to TVolume for StEventDisplayMaker and TofMatchers -// -// Revision 1.3 2005/06/17 18:35:45 fisyak -// Add flow diagram -// -// Revision 1.2 2005/06/09 20:14:40 fisyak -// Set Run number (=1 D) -// -// Revision 1.1 2005/05/24 22:58:08 fisyak -// The first version -// -// -// Rewritten by V.Perev - -/* Flow diagram: - Load(); // shared libraries - GetVMC(); // define gGeoManager ------------------- -GeoTestMaker::Init() ------------------- - -*/ - -#include -#include "TROOT.h" -#include "TSystem.h" -#include "TGeometry.h" -#include "TGeoManager.h" -#include "TObjectSet.h" -#include "GeoTestMaker.h" -#include "Stiostream.h" -#include "StarMagField.h" -#include "StVMCApplication.h" -#include "StMCStack.h" -#include "StMessMgr.h" -#include "TVirtualMC.h" -#include "TGeant3TGeo.h" -#include "StMCInitApp.h" -//#include "StMCSteppingHist.h" -#include "StMCStepping2Hist.h" -#include "StTGeoProxy.h" - -ClassImp(GeoTestMaker); - -//_____________________________________________________________________________ -GeoTestMaker::GeoTestMaker(const char *name,const char *gy, int trig) - :StMaker(name),fNTrig(trig),fGeo(gy) -{ -gSystem->AddIncludePath("${STAR}2/StarDb/VmcGeometry"); -} - -//_____________________________________________________________________________ -int GeoTestMaker::Init() -{ - StVMCApplication *app = new StVMCApplication(fGeo, "StVMC application"); - StMCInitApp *ini = new StMCInitApp(); - - if (*SAttr("NPrim" )) {ini->SetNPrim(IAttr( "NPrim"));} - if (*SAttr("PtMin" )) {ini->SetPt (DAttr( "PtMin"),DAttr( "PtMax"));} - if (*SAttr("EtaMin")) {ini->SetEta(DAttr("EtaMin"),DAttr("EtaMax"));} - if (*SAttr("PhiMin")) {ini->SetEta(DAttr("PhiMin"),DAttr("PhiMax"));} - if (*SAttr("ZMin" )) {ini->SetZ (DAttr( "ZMin"),DAttr( "ZMax"));} - app->SetInit(ini); -//StMCSteppingHist *steps = new StMCSteppingHist(fGeo); - StMCStepping2Hist *steps = new StMCStepping2Hist(fGeo); - app->SetStepping(steps); - if (*SAttr("SteppingDebug")) {steps->SetDebug(IAttr("SteppingDebug"));} - - app->Init(); - - StTGeoProxy::Instance()->Init(1); - - return StMaker::Init(); -} -//_____________________________________________________________________________ -int GeoTestMaker::InitRun (int runumber) -{ - return kStOK; -} -//_____________________________________________________________________________ -int GeoTestMaker::Make() -{ - TVirtualMC::GetMC()->ProcessRun(fNTrig); - return kStOK; -} -//_____________________________________________________________________________ -int GeoTestMaker::Finish() -{ - // StMCSteppingHist::Instance()->Finish(); -//StMCSteppingHist::Instance()->Finish(); - StMCStepping2Hist::Instance()->Finish(); - return StMaker::Finish(); -} - -//________________________________________________________________________________ -void GeoTestMaker::SetDebug(int l) { - StMaker::SetDebug(l); -} diff --git a/StarVMC/GeoTestMaker/GeoTestMaker.h b/StarVMC/GeoTestMaker/GeoTestMaker.h deleted file mode 100644 index 9e85392090d..00000000000 --- a/StarVMC/GeoTestMaker/GeoTestMaker.h +++ /dev/null @@ -1,48 +0,0 @@ -// $Id: GeoTestMaker.h,v 1.2 2015/08/04 21:13:40 jwebb Exp $ - -#ifndef STAR_GeoTestMaker -#define STAR_GeoTestMaker - -/*! - * - * \class GeoTestMaker - * \author fisyak - * \date 2005/04/22 - * \brief virtual base class for Maker - * - * This commented block at the top of the header file is considered as - * the class description to be present on the this class Web page. - * - */ - -#include "StMaker.h" -#include "StVMCApplication.h" -#include "TGeant3TGeo.h" -class GeoTestMaker : public StMaker { - public: - GeoTestMaker(const char *name="GeoTest",const char *gy="y2009",int nTrig=100); - virtual ~GeoTestMaker() {} - int Init(); - int InitRun(int); - int Make(); - int Finish(); - void SetDebug(int l); - - private: - // Private method declaration if any - - protected: - int fNTrig; - TString fGeo; - public: - virtual const char *GetCVS() const { - static const char cvs[]="Tag $Name: $ $Id: GeoTestMaker.h,v 1.2 2015/08/04 21:13:40 jwebb Exp $ built " __DATE__ " " __TIME__ ; - return cvs; - } - - ClassDef(GeoTestMaker,0) // Makers -}; - -#endif - - diff --git a/StarVMC/GeoTestMaker/GeoTouch.C b/StarVMC/GeoTestMaker/GeoTouch.C deleted file mode 100644 index ccfa66dfe12..00000000000 --- a/StarVMC/GeoTestMaker/GeoTouch.C +++ /dev/null @@ -1,38 +0,0 @@ -int loaded=0; - -void Load(); -class StTGeoHelper; -StTGeoHelper *geoHelp=0; - -void GeoTouch(const char *gy="y2009") -{ -if (!loaded) Load(); - TString ts("$STAR/StarDb/VmcGeometry/"); ts +=gy; ts +=".h"; - gROOT->Macro(ts); - geoHelp = StTGeoHelper::Instance(); -} -void Show(double z,double rxy) -{ - geoHelp->ShootZR(z,rxy); -} - - - - - - -void Load() -{ -TH1D h1d; h1d.GetPainter(); -gSystem->Load("libVMC.so"); -gSystem->Load("St_base.so"); -gSystem->Load("St_Tables.so"); -gSystem->Load("StUtilities.so"); -gSystem->Load("StChain.so"); -gSystem->Load("StarVMCApplication.so"); -gSystem->Load("libStarMiniCern.so"); -gSystem->Load("libgeant3.so"); -gSystem->Load("GeoTestMaker.so"); -loaded=1; - -} diff --git a/StarVMC/GeoTestMaker/StMCConstructGeometry.cxx b/StarVMC/GeoTestMaker/StMCConstructGeometry.cxx deleted file mode 100644 index 4517ddc2d72..00000000000 --- a/StarVMC/GeoTestMaker/StMCConstructGeometry.cxx +++ /dev/null @@ -1,100 +0,0 @@ -// $Id: StMCConstructGeometry.cxx,v 1.6 2015/08/04 21:13:40 jwebb Exp $ -// -// -// Class StMCConstructGeometry -// ------------------ -// Base class for Magnetic field calculation - -#include -#include -#include "Stiostream.h" -//#include "StMessMgr.h" -#include "StMCConstructGeometry.h" -#include "TVirtualMC.h" -#include "TVirtualMCApplication.h" -#include "TROOT.h" -#include "TSystem.h" -#include "TGeoManager.h" -#include "TGeoShape.h" -#include "TGeoBBox.h" -#include "TGeoMatrix.h" -#include "TEnv.h" -#include "TRegexp.h" -#include "StMCStack.h" - -#include "StMessMgr.h" - -ClassImp(StMCConstructGeometry) - -//_____________________________________________________________________________ -StMCConstructGeometry::StMCConstructGeometry(const char *gy) - : GCall(gy,"StMCConstructGeometry") -{ -} -//_____________________________________________________________________________ -int StMCConstructGeometry::Fun() -{ - TString ts,tsn(GetName()),star("${STAR}"),top; - if (! gGeoManager) { - top = tsn(TRegexp("(.*)")); - if (top[0]=='(') {tsn.ReplaceAll(top,""); top = top(1, top.Length()-2); } - - if (tsn.Contains("yf")) { - star = "${STAR_PATH}/.DEV2"; - TString aaa(".include ${STAR_PATH}/.DEV2/StarDb/VmcGeometry"); - gSystem->ExpandPathName(aaa); - gROOT->ProcessLine(aaa); - aaa = gEnv->GetValue("Unix.*.Root.MacroPath",0); - aaa+= ":"; aaa+= star; aaa+="$/StarDb/VmcGeometry/"; - gEnv->SetValue("Unix.*.Root.MacroPath",aaa); - tsn.ReplaceAll("yf",""); - } - if (!ts.Contains(".C")) { - ts=star; - ts+="/StarDb/VmcGeometry/Geometry."; - ts+=tsn; ts+=".C"; - } - gSystem->ExpandPathName(ts); - int fail=gROOT->LoadMacro(ts); - //if (fail) Printf("operator()","fail=%d path=%s",fail,ts.Data()); - if (fail) LOG_FATAL << "operator() fail=" << fail << " path=" << ts.Data() << endm; - assert(fail==0); - gROOT->ProcessLine("CreateTable()"); - } - if (top.Length()) SetTop(top); - - gMC->SetRootGeometry(); - - return 0; -} -//_____________________________________________________________________________ -void StMCConstructGeometry::SetTop(const char *topName) -{ - TGeoVolume *vol= gGeoManager->GetVolume(topName); - assert(vol); - if (strcmp(topName,"CAVE")==0) {gGeoManager->SetTopVolume(vol);return;} - - TGeoMedium *meVac = gGeoManager->GetMedium("Vacuum"); - if(!meVac) { - const TGeoMaterial *maVac = gGeoManager->GetMaterial("Vacuum"); - if (!maVac) maVac = new TGeoMaterial("Vacuum", 0,0,0); - meVac = new TGeoMedium("Vacuum",1000000,maVac); - } - TGeoBBox *bb = (TGeoBBox*)vol->GetShape(); - bb->ComputeBBox(); - TString myName("."); myName+=vol->GetName(); - TGeoVolume *top = gGeoManager->MakeBox(myName,meVac - ,bb->GetDX(),bb->GetDY(),bb->GetDZ()); - - top->AddNode(vol,1,new TGeoTranslation(bb->GetOrigin()[0] - ,bb->GetOrigin()[1] - ,bb->GetOrigin()[2])); - gGeoManager->SetTopVolume(top); -} - - - - - - - diff --git a/StarVMC/GeoTestMaker/StMCConstructGeometry.h b/StarVMC/GeoTestMaker/StMCConstructGeometry.h deleted file mode 100644 index 5d54c51ef83..00000000000 --- a/StarVMC/GeoTestMaker/StMCConstructGeometry.h +++ /dev/null @@ -1,31 +0,0 @@ -// $Id: StMCConstructGeometry.h,v 1.2 2010/01/27 23:02:57 perev Exp $ -// -// -// Class StMCConstructGeometry -// ------------------ - - -#ifndef STMC_GENERATEPRIMARIES_H -#define STMC_GENERATEPRIMARIES_H - -#include "GCall.h" -class StMCConstructGeometry : public GCall -{ - public: - StMCConstructGeometry(const char *gy); - virtual ~StMCConstructGeometry(){} - // methods - int Fun(); - private: - void SetTop(const char *topName); - - protected: - // data members - - ClassDef(StMCConstructGeometry,0) // Extended TParticle -}; - -#endif //STMC_GENERATEPRIMARIES_H - - - diff --git a/StarVMC/GeoTestMaker/StMCInitApp.cxx b/StarVMC/GeoTestMaker/StMCInitApp.cxx deleted file mode 100644 index 1b18f87887b..00000000000 --- a/StarVMC/GeoTestMaker/StMCInitApp.cxx +++ /dev/null @@ -1,99 +0,0 @@ -// $Id: StMCInitApp.cxx,v 1.3 2009/10/13 17:19:35 perev Exp $ -// -// -// Class StMCInitApp -// ------------------ -// Base class for Magnetic field calculation - -#include -#include -#include "Stiostream.h" -#include "StMCInitApp.h" -#include "TVirtualMC.h" -#include "TVirtualMCApplication.h" -#include "TROOT.h" -#include "TSystem.h" -#include "TGeoManager.h" -#include "StVMCApplication.h" -#include "TGeant3TGeo.h" -#include "StMCStack.h" -#include "StMCConstructGeometry.h" -#include "StMCSimplePrimaryGenerator.h" -#include "StMCSteppingHist.h" - -ClassImp(StMCInitApp) - -//_____________________________________________________________________________ -StMCInitApp::StMCInitApp() -{ -fNPrim = 10; -fGCode = 48; -fPt [0] = 1; fPt [1] = 1; -fEta[0] = -6; fEta[1] = 6; -fPhi[0] = -180; fPhi[1] = 180; -fZ [0] = 0; fZ [1] = 0; -fOpt = "G"; -printf("*%p = %g %g\n",fPt,fPt [0],fPt [1]); - -} -//_____________________________________________________________________________ -int StMCInitApp::Fun() -{ - StVMCApplication *app = (StVMCApplication*)TVirtualMCApplication::Instance(); - new TGeant3TGeo("C++ Interface to Geant3"); - Info("Init","TGeant3TGeo has been created."); - StMCConstructGeometry *geo = new StMCConstructGeometry(app->GetName()); - app->SetConstructGeometry(geo); - - StMCSimplePrimaryGenerator *gen = new StMCSimplePrimaryGenerator( - fNPrim, fGCode, - fPt [0] ,fPt [1], - fEta[0] ,fEta[1], - fPhi[0] ,fPhi[1], - fZ [0] ,fZ [1], fOpt); - - app->SetPrimaryGenerator(gen); - - - gMC->SetStack(new StMCStack(100)); - gMC->Init(); - gMC->BuildPhysics(); - - Info("Init","switch off physics"); - gMC->SetProcess("DCAY", 0); - gMC->SetProcess("ANNI", 0); - gMC->SetProcess("BREM", 0); - gMC->SetProcess("COMP", 0); - gMC->SetProcess("HADR", 0); - gMC->SetProcess("MUNU", 0); - gMC->SetProcess("PAIR", 0); - gMC->SetProcess("PFIS", 0); - gMC->SetProcess("PHOT", 0); - gMC->SetProcess("RAYL", 0); - gMC->SetProcess("LOSS", 4); // no fluctuations - // gMC->SetProcess("LOSS 1"); // with delta electron above dcute - gMC->SetProcess("DRAY", 0); - gMC->SetProcess("MULS", 0); - gMC->SetProcess("STRA", 0); - gMC->SetCut("CUTGAM", 1e-3 ); - gMC->SetCut("CUTELE", 1e-3 ); - gMC->SetCut("CUTHAD", .001 ); - gMC->SetCut("CUTNEU", .001 ); - gMC->SetCut("CUTMUO", .001 ); - gMC->SetCut("BCUTE", .001 ); - gMC->SetCut("BCUTM", .001 ); - gMC->SetCut("DCUTE", 1e-3 ); - gMC->SetCut("DCUTM", .001 ); - gMC->SetCut("PPCUTM", .001 ); - gMC->SetCut("TOFMAX", 50.e-6); - - return 0; -} - - - - - - - - diff --git a/StarVMC/GeoTestMaker/StMCInitApp.h b/StarVMC/GeoTestMaker/StMCInitApp.h deleted file mode 100644 index 413d141e476..00000000000 --- a/StarVMC/GeoTestMaker/StMCInitApp.h +++ /dev/null @@ -1,46 +0,0 @@ -// $Id: StMCInitApp.h,v 1.2 2009/06/07 02:28:36 perev Exp $ -// -// -// Class StMCInitApp -// ------------------ - - -#ifndef STMC_INITAPP_H -#define STMC_INITAPP_H - -#include "GCall.h" -class StMCInitApp : public GCall -{ - public: - StMCInitApp(); - virtual ~StMCInitApp(){} - // methods - int Fun(); - -// Setters - void SetNPrim(int nTrk) {fNPrim =nTrk;} - void SetGCode(int gCode) {fGCode =gCode; fOpt="G";} - void SetPDG(int pCode) {fGCode =pCode; fOpt="" ;} - void SetPt (double ptMin,double ptMax) {fPt [0]=ptMin; fPt[1] =ptMax;} - void SetEta(double etMin,double etMax) {fEta[0]=etMin; fEta[1]=etMax;} - void SetPhi(double phMin,double phMax) {fPhi[0]=phMin; fPhi[1]=phMax;} - void SetZ (double zzMin,double zzMax) {fZ [0]=zzMin; fZ [1]=zzMax;} - - - protected: - // data members - int fNPrim; - int fGCode; -double fPt[2]; -double fEta[2]; -double fPhi[2]; -double fZ[2]; -TString fOpt; - - ClassDef(StMCInitApp,0) // Extended TParticle -}; - -#endif //STMC_GENERATEPRIMARIES_H - - - diff --git a/StarVMC/GeoTestMaker/StMCPrimaryGenerator.cxx b/StarVMC/GeoTestMaker/StMCPrimaryGenerator.cxx deleted file mode 100644 index c513b958089..00000000000 --- a/StarVMC/GeoTestMaker/StMCPrimaryGenerator.cxx +++ /dev/null @@ -1,56 +0,0 @@ -// $Id: StMCPrimaryGenerator.cxx,v 1.2 2009/10/13 17:19:35 perev Exp $ -// -// -// Class StMCPrimaryGenerator -// ------------------ -// Base class for Magnetic field calculation - -#include -#include -#include -#include "StMCPrimaryGenerator.h" -#include "TVirtualMC.h" -#include "TPDGCode.h" -#include "TRandom.h" - - - -ClassImp(StMCPrimaryGenerator) - -//_____________________________________________________________________________ -StMCPrimaryGenerator::StMCPrimaryGenerator(int ntrk,int pdg) - : GCall("StMCPrimaryGenerator","") -{ - SetNTrk(ntrk); SetPDG(pdg); memset(fVtx,0,sizeof(fVtx)); -} -//_____________________________________________________________________________ -void StMCPrimaryGenerator::SetVtx(const double *vtx) -{ - for (int i=0;i<3;i++){fVtx[i]=vtx[i];} -} -//_____________________________________________________________________________ -void StMCPrimaryGenerator::SetVtx(const float *vtx) -{ - for (int i=0;i<3;i++){fVtx[i]=vtx[i];} -} - -//_____________________________________________________________________________ -void StMCPrimaryGenerator::PushTrack( - int toBeDone, int parent, int pdg - ,double px, double py, double pz,double e - ,double vx, double vy, double vz,double tof - ,double polx,double poly,double polz - ,TMCProcess mech, int& ntr, double weight, int is) -{ - TVirtualMC::GetMC()->GetStack()->PushTrack( - toBeDone,parent,pdg,px, py, pz,e ,vx, vy, vz,tof - ,polx,poly,polz, mech, ntr, weight,is); -} - - - - - - - - diff --git a/StarVMC/GeoTestMaker/StMCPrimaryGenerator.h b/StarVMC/GeoTestMaker/StMCPrimaryGenerator.h deleted file mode 100644 index d9ddc440f92..00000000000 --- a/StarVMC/GeoTestMaker/StMCPrimaryGenerator.h +++ /dev/null @@ -1,39 +0,0 @@ -// $Id: StMCPrimaryGenerator.h,v 1.1 2009/03/25 23:15:10 perev Exp $ -// -// -// Class StMCPrimaryGenerator -// ------------------ - - -#ifndef STAR_StMCPrimaryGenerator_H -#define STAR_StMCPrimaryGenerator_H - -#include "GCall.h" -#include "TVirtualMCStack.h" -class StMCPrimaryGenerator : public GCall -{ - public: - StMCPrimaryGenerator(int ntrk=1,int pdg=0); - virtual ~StMCPrimaryGenerator(){} - // methods - void SetNTrk(int ntrk) {fNTrk=ntrk;} - void SetPDG (int pdg ) {fPDG =pdg ;} - void SetVtx (const double *vtx ); - void SetVtx (const float *vtx ); - void PushTrack(int toBeDone, int parent, int pdg - ,double px, double py, double pz,double e - ,double vx, double vy, double vz,double tof - ,double polx,double poly,double polz - ,TMCProcess mech, int& ntr, double weight, int is); - protected: - // data members - int fNTrk; - int fPDG; - double fVtx[3]; - ClassDef(StMCPrimaryGenerator,0) // Extended TParticle -}; - -#endif //STAR_StMCPrimaryGenerator_H - - - diff --git a/StarVMC/GeoTestMaker/StMCSimplePrimaryGenerator.cxx b/StarVMC/GeoTestMaker/StMCSimplePrimaryGenerator.cxx deleted file mode 100644 index e1bb4969ca5..00000000000 --- a/StarVMC/GeoTestMaker/StMCSimplePrimaryGenerator.cxx +++ /dev/null @@ -1,99 +0,0 @@ -// $Id: StMCSimplePrimaryGenerator.cxx,v 1.4 2012/06/11 16:17:42 fisyak Exp $ -#include -#include -#include "Riostream.h" -#include "StMCSimplePrimaryGenerator.h" -#include "TString.h" -#include "TDatabasePDG.h" -#include "TRandom.h" -#include "TMath.h" -using namespace std; -ClassImp(StMCSimplePrimaryGenerator); -//_____________________________________________________________________________ - StMCSimplePrimaryGenerator::StMCSimplePrimaryGenerator( - int nprim, int Id, - double pT_min, double pT_max, - double Eta_min, double Eta_max, - double Phi_min, double Phi_max, - double Z_min, double Z_max, const char *option) - :StMCPrimaryGenerator() -{ - SetGenerator( nprim ,Id, - pT_min ,pT_max, - Eta_min ,Eta_max, - Phi_min ,Phi_max, - Z_min ,Z_max , option); -} - -//_____________________________________________________________________________ -void StMCSimplePrimaryGenerator::SetGenerator(int nprim, int Id, - double pT_min,double pT_max, - double Eta_min, double Eta_max, - double Phi_min, double Phi_max, - double Z_min, double Z_max, const Char_t *option) { - fNTrk = nprim; fPDG = Id; - fpT_min = pT_min; - fpT_max = pT_max; - fEta_min = Eta_min; - fEta_max = Eta_max; - fPhi_min = Phi_min; - fPhi_max = Phi_max; - fZ_min = Z_min; - fZ_max = Z_max; - TString opt(option); - if (! opt.CompareTo("G",TString::kIgnoreCase)) fPDG = TDatabasePDG::Instance()->ConvertGeant3ToPdg(fPDG); - cout << "Generate " << fNTrk << " primary tracks of type " << fPDG << endl; - cout << fpT_min << " < pT < " << fpT_max << endl; - cout << fEta_min << " < eta < " << fEta_max << endl; - cout << fPhi_min<< " < phi < " << fPhi_max<< endl; - cout << fZ_min << " < zVer< " << fZ_max << endl; -} -//_____________________________________________________________________________ -void StMCSimplePrimaryGenerator::GenerateOnePrimary() { - // Add one primary particle to the user stack (derived from TVirtualMCStack). - // Track ID (filled by stack) - int ntr; - - // Option: to be tracked - int toBeDone = 1; - - // Particle type - int pdg = fPDG; - - // Polarization - double polx = 0.; - double poly = 0.; - double polz = 0.; - - // Position - double tof = 0.; - - // Energy (in GeV) - double pT = fpT_min + (fpT_max - fpT_min )*gRandom->Rndm(); - double eta = fEta_min + (fEta_max - fEta_min)*gRandom->Rndm(); - double phi = fPhi_min + (fPhi_max - fPhi_min)*gRandom->Rndm(); - phi *= M_PI/180; - - // Particle momentum - double px, py, pz; - px = pT*TMath::Cos(phi); - py = pT*TMath::Sin(phi); - pz = pT*TMath::SinH(eta); - // double kinEnergy = 0.050; - double mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass(); - if (mass<=0.) mass = 1e-8; - double e = TMath::Sqrt(mass*mass + pz*pz + pT*pT); - // Add particle to stack - assert(e>1e-6); - PushTrack(toBeDone, -1, pdg, px, py, pz, e - ,fVtx[0], fVtx[1],fVtx[2] - ,tof , polx ,poly, polz, - kPPrimary, ntr, 1., 0); -} -//_____________________________________________________________________________ -int StMCSimplePrimaryGenerator::Fun() { - - fVtx[2]=(fZ_min + (fZ_max-fZ_min)*gRandom->Rndm()); - for (int i=0; i -#include -#include "StMCStack.h" -#include -#include -#include - -class myTParticle : public TParticle { - public: -myTParticle(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2 - ,Int_t daughter1, Int_t daughter2 - ,Double_t px, Double_t py, Double_t pz - ,Double_t etot, Double_t vx, Double_t vy, Double_t vz - ,Double_t time) - :TParticle(pdg,status,mother1,mother2,daughter1, daughter2 - ,px,py,pz,etot,vx,vy,vz,time) - { fId=0;} - -~myTParticle(); - - int GetId() const {return fId;} - void SetId(int id) {fId = id ;} - void SetMother(myTParticle* particle) { fMother=particle;} - void AddDaughter(myTParticle* particle) { fDaughters.push_back(particle);} -//void Print(const Option_t *opt=0) const; - myTParticle* GetMother() const { return fMother;} - Int_t GetNDaughters() const { return fDaughters.size();} - myTParticle* GetDaughter(Int_t i) const; - - private: - // data members - int fId; - myTParticle *fMother; - std::vector fDaughters; -}; - -//_____________________________________________________________________________ -myTParticle* myTParticle::GetDaughter(Int_t i) const -{ - if (i < 0 || i >= (int)fDaughters.size()) - Fatal("GetDaughter", "Index out of range"); - return fDaughters[i]; -} - -//_____________________________________________________________________________ -myTParticle::~myTParticle() -{ - int n = fDaughters.size(); - for (int i=0;iSetPolarisation(polx, poly, polz); - particle->SetWeight(weight); - particle->SetUniqueID(mech); - - myTParticle* mother = 0; - int ID = GetNtrack(); - if (parent>=0 && toBeDone && mech != kPPrimary) { - mother = (myTParticle*)GetParticle(parent); - ID = mother->GetId(); - particle->SetId(ID); particle->SetMother(mother); - mother->AddDaughter(particle); - } - else { - particle->SetId(ID); - fParticles.push_back(particle); - } - if (mech == kPPrimary) fNPrimary++; - if (toBeDone) fStack.push(particle); -} -//_____________________________________________________________________________ -TParticle* StMCStack::PopNextTrack(int& itrack) { -// Gets next particle for tracking from the stack. -// --- - - fCurrentTrack = -1; - fCurrentParticle = 0; - itrack = fCurrentTrack; - if (fStack.empty()) return 0; - - fCurrentParticle = fStack.top(); - fStack.pop(); - - if (!fCurrentParticle) return 0; - - itrack = fCurrentParticle->GetId(); - fCurrentTrack = itrack; - - return fCurrentParticle; -} -//_____________________________________________________________________________ -void StMCStack::Print(const Option_t *opt) const { -// Print(const Option_t *opt=0)s info for all particles. -// --- - - printf("*** StMCStack Info ***\n"); - printf("Total number of particles: %d\n",GetNtrack()); - printf("Number of primary particles: %d\n",GetNprimary()); - for (int i=0; iPrint(); - } -} -//_____________________________________________________________________________ -void StMCStack::Clear(const char *) -{ - // Deletes contained particles, resets particles array and stack. - // --- - - // reset fStack should be empty by this time - assert(fStack.empty()); - fCurrentTrack = -1; - fNPrimary = 0; - for( int i=0; i<(int)fParticles.size();i++) {delete fParticles[i];} - fParticles.clear(); -} -//_____________________________________________________________________________ -TParticle* StMCStack::GetCurrentTrack() const -{ -// Gets the current track particle. -// --- - return GetParticle(fCurrentTrack); -} - -//_____________________________________________________________________________ -int StMCStack::GetCurrentParentTrackNumber() const -{ -// Returns the current track parent ID. -// --- - - myTParticle* current = GetParticle(fCurrentTrack); - - if (!current) return -1; - - myTParticle* mother = current->GetMother(); - - if (!mother) return -1; - - return mother->GetId(); -} - -//_____________________________________________________________________________ -myTParticle* StMCStack::GetParticle(int id) const -{ -// Returns id-th particle in fParticles. - if (id < 0 || id >= (int)fParticles.size()) - Fatal("GetParticle", "Index out of range"); - return fParticles[id]; -} - - diff --git a/StarVMC/GeoTestMaker/StMCStack.h b/StarVMC/GeoTestMaker/StMCStack.h deleted file mode 100644 index 761ee8feab6..00000000000 --- a/StarVMC/GeoTestMaker/StMCStack.h +++ /dev/null @@ -1,68 +0,0 @@ -// $Id: StMCStack.h,v 1.2 2010/04/29 03:05:28 perev Exp $ -// $Log: StMCStack.h,v $ -// Revision 1.2 2010/04/29 03:05:28 perev -// CleanUp -// -// Revision 1.1 2009/03/25 23:15:10 perev -// New VMC maker -// -// Revision 1.3 2005/06/09 20:13:47 fisyak -// It looks like that all hits in place (calorimeters have to be check for volumeid) -// -// Revision 1.2 2005/05/03 15:42:14 fisyak -// Adjust for bfc -// -// Revision 1.1 2005/04/25 20:44:28 fisyak -// StarVMCApplication with example in macros/starVMC.C -// - -#ifndef StMC_STACK_H -#define StMC_STACK_H - -#include "TVirtualMCStack.h" -#include "TObjArray.h" -#include - -class myTParticle; -class TParticle; - -class StMCStack : public TVirtualMCStack { -public: - StMCStack(int size = 0); - virtual ~StMCStack(); - - // methods - virtual void PushTrack(int toBeDone, int parent, int pdg, - double px, double py, double pz, double e, - double vx, double vy, double vz, double tof, - double polx, double poly, double polz, - TMCProcess mech, int& ntr,double weight, - int is) ; - virtual TParticle* PopNextTrack(int& track); - virtual TParticle* PopPrimaryForTracking(int i); - void Print(const char* opt=0) const; - void Clear(const char* opt=0); - private: - - virtual void SetCurrentTrack(int track) {fCurrentTrack = track;} - virtual int GetNtrack() const {return fParticles.size();} - virtual int GetNprimary() const {return fNPrimary;} - virtual TParticle* GetCurrentTrack() const; - virtual int GetCurrentTrackNumber() const {return fCurrentTrack;} - virtual int GetCurrentTrackId() const {return GetCurrentTrackNumber()+1;} - virtual int GetCurrentParentTrackNumber()const; - myTParticle* GetParticle(int id) const; - myTParticle* GetCurrentParticle() {return fCurrentParticle;} - private: - // data members - std::stack fStack; //! - std::vector fParticles; - int fCurrentTrack; - int fNPrimary; - myTParticle* fCurrentParticle; - ClassDef(StMCStack,0) // StMCStack -}; - -#endif - - diff --git a/StarVMC/GeoTestMaker/StMCStepping.cxx b/StarVMC/GeoTestMaker/StMCStepping.cxx deleted file mode 100644 index 1ec9c63c800..00000000000 --- a/StarVMC/GeoTestMaker/StMCStepping.cxx +++ /dev/null @@ -1,336 +0,0 @@ -// $Id: StMCStepping.cxx,v 1.10 2014/08/20 02:31:58 perev Exp $ -// -// -// Class StMCStepping -// ------------------ - -#include -#include -#include -#include "StMCStepping.h" -#include "TPDGCode.h" -#include "TVirtualMC.h" -#include "TGeoManager.h" -#include "TGeoNode.h" -#include "TGeoVolume.h" -#include "TGeoMedium.h" -#include "TGeant3.h" - -static TVirtualMC *myMC=0; - -ClassImp(StMCStepping) -int SteppingCasesI[] = { - StMCStepping::kNewTrack , - StMCStepping::kTrackAlive, - StMCStepping::kTrackDisappeared, - StMCStepping::kTrackEntering, - StMCStepping::kTrackExiting, - StMCStepping::kTrackInside, - StMCStepping::kTrackOut, - StMCStepping::kTrackStop, - 0}; - -const char *SteppingCasesC[] = { - "NewTrack", - "TrackAlive", - "TrackDisappeared", - "TrackEntering", - "TrackExiting", - "TrackInside", - "TrackOut", - "TrackStop", - 0}; - -int SteppingKazesI[] = { - StMCStepping::kNEWtrack, - StMCStepping::kENTERtrack, - StMCStepping::kCONTINUEtrack, - StMCStepping::kEXITtrack, - StMCStepping::kENDEDtrack, - StMCStepping::kOUTtrack, - StMCStepping::kIgnore, - 0}; - -const char *SteppingKazesC[] = { - "NEWtrack", - "ENTERtrack", - "CONTINUEtrack", - "EXITtrack", - "ENDEDtrack", - "OUTtrack", - "Ignore", - 0}; - -class MyAux -{ -public: -float fLen,fP,fEdep; -}; - -static std::vector gAux; - -//_____________________________________________________________________________ -StMCStepping::StMCStepping(const char *name,const char *tit) - : GCall(name,tit) -{ - memset(fBeg,0,fEnd-fBeg+1); - fKazePrev = -1; - myMC = 0; - fDir = 1; -} -//_____________________________________________________________________________ -void StMCStepping::Print(const Option_t*) const -{ - double lenTot = 0,eTot=0; - for (int i=0;i<(int)gAux.size();i++) { - MyAux &M = gAux[i]; - eTot+=M.fEdep; - double T = sqrt(M.fP*M.fP+fMass*fMass)-fMass; - T = (fDir)? T+M.fEdep: T-M.fEdep; - printf("%6.3f eTot=%g T=%g dL=%g dE=%g dEdX=%g\n" - ,lenTot,eTot,T,M.fLen,M.fEdep,M.fEdep/(M.fLen+1e-11)); - lenTot += M.fLen; - } - printf(" totLen=%g totE=%g\n",lenTot,eTot); - - - -} -//_____________________________________________________________________________ -TString StMCStepping::CaseAsString(int kase) -{ - TString ts; - for (int i=0;SteppingCasesI[i];i++) - { - if (!(kase&SteppingCasesI[i])) continue; - if (ts.Length()) ts +="&"; - ts += SteppingCasesC[i]; - } - return ts; -} -//_____________________________________________________________________________ -TString StMCStepping::KazeAsString(int kase) -{ - TString ts; - for (int i=0;SteppingKazesI[i];i++) - { - if (!(kase&SteppingKazesI[i])) continue; - if (ts.Length()) ts +="&"; - ts += SteppingKazesC[i]; - } - return ts; -} - - -//_____________________________________________________________________________ -void StMCStepping::Case() -{ -static int nCall = 0; nCall++; - fSteps++; - fNode = gGeoManager->GetCurrentNode(); - fVolume = fNode->GetVolume(); - fMedium = fVolume->GetMedium(); - fMaterial = fMedium->GetMaterial(); - fX0 = fMaterial->GetRadLen(); - myMC = gMC; - fCase = 0; - if(myMC->IsNewTrack ()) fCase |= kNewTrack; -//if(myMC->TrackLength() == 0 ) fCase |= kNewTrack; -//if(myMC->IsTrackAlive ()) fCase |= kTrackAlive; - if(myMC->IsTrackDisappeared ()) fCase |= kTrackDisappeared; - if(myMC->IsTrackEntering ()) fCase |= kTrackEntering; - if(myMC->IsTrackExiting ()) fCase |= kTrackExiting; - if(myMC->IsTrackInside ()) fCase |= kTrackInside; - if(myMC->IsTrackOut ()) fCase |= kTrackOut; - if(myMC->IsTrackStop ()) fCase |= kTrackStop; - - fKaze=0; - if(!fKaze && fCase&kNewTrack) fKaze = kNEWtrack; - if(!fKaze && fCase&kTrackEntering) fKaze = kENTERtrack; - if(!fKaze && fCase&kTrackInside) fKaze = kCONTINUEtrack; - if( fCase&kTrackExiting) fKaze = kEXITtrack; - if( fCase&kTrackStop) fKaze = kENDEDtrack; - if( fCase&kTrackDisappeared) fKaze = kENDEDtrack; - if( fCase&kTrackOut) fKaze = kOUTtrack; - int kaze = fKaze; -// if(fKazePrev==fKaze && fKaze !=kCONTINUEtrack) fKaze= kIgnore; - fKazePrev=kaze; -//vp fCasName = CaseAsString(fCase); -//vp fKazName = KazeAsString(fKaze); - - myMC->TrackPosition(fCurrentPosition); - myMC->TrackMomentum(fCurrentMomentum); - assert(fCurrentMomentum[3]>1e-6); - fCurrentLength = myMC->TrackLength(); - fCharge = myMC->TrackCharge(); - fMass = myMC->TrackMass(); - fEtot = myMC->Etot(); - - switch (fKaze) { - - case kNEWtrack: - fSteps=0; - fTrackNumber++; - fStartPosition = fCurrentPosition; - fStartMomentum = fCurrentMomentum; - gAux.clear(); - case kENTERtrack:; - { - fEnterPosition = fCurrentPosition; - fEnterMomentum = fCurrentMomentum; - fEnterLength = fCurrentLength; - fEdep = 0; - break;} - - case kCONTINUEtrack:; - case kEXITtrack:; - case kOUTtrack: - fEdep = myMC->Edep(); - fEtot = myMC->Etot(); - RecovEloss(); - myMC->TrackPosition(fCurrentPosition); - myMC->TrackMomentum(fCurrentMomentum); - break; - - case kENDEDtrack: - break; - - case kIgnore:; - assert(0 && "Ignore case??"); - break; - - default: - Error("Case","Unexpected case %d == %s",fKaze,fCasName.Data()); - assert(0); - } - fPrevLength = fCurrentLength; - fPrevPosition = fCurrentPosition; - fPrevMomentum = fCurrentMomentum; -} -//_____________________________________________________________________________ -int StMCStepping::Fun() -{ - Case(); - switch (fCase) { - case kNewTrack|kTrackEntering:; - case kNewTrack:; - fPrevLength =0; - case kTrackEntering:; - printf("\n\nStepping %s\n",fCasName.Data()); - printf("Vol= %s Mat=%s Med=%s\n" - ,fVolume->GetName() - ,fMaterial->GetName() - ,fMedium->GetName()); -// printf("Track %s\t Mass(%d) = %g Pos= %g %g %g Mom=%g %g %g\n" -// ,fParName.Data(),fPDG,fMass -// ,fCurrentPosition[0],fCurrentPosition[1],fCurrentPosition[2] -// ,fCurrentMomentum[0],fCurrentMomentum[1],fCurrentMomentum[2]); - - break; - - case kTrackInside|kTrackDisappeared: - case kTrackInside|kTrackStop: - case kTrackDisappeared: - case kTrackExiting: - case kTrackInside: - case kTrackOut: - case kTrackStop: - case kTrackDisappeared|kTrackOut: - printf("Continue %s\n",fCasName.Data()); - printf("Track dLen= %g Pos= %g %g %g Mom=%g %g %g\n" - ,fCurrentLength-fEnterLength - ,fCurrentPosition[0],fCurrentPosition[1],fCurrentPosition[2] - ,fCurrentMomentum[0],fCurrentMomentum[1],fCurrentMomentum[2]); - break; - - default: - Error("Case","Unexpected case %x == %s",fCase,fCasName.Data()); - assert(0); - } - return 0; -} -//_____________________________________________________________________________ -void StMCStepping::RecovEloss() -{ -// Update directly Geant3 common when we moving bacward the track -// and energy loss is negative - - -static int nCall = 0; nCall++; -static int debu = 0; - enum {kX=0,kY,kZ,kDx,kDy,kDz,kP}; - -static Gctrak_t *gGctrak=((TGeant3*)TVirtualMC::GetMC())->Gctrak(); -static float *vect = gGctrak->vect; -static Float_t &getot = gGctrak->getot; -static Float_t &gekin = gGctrak->gekin; - - - do { -// if (fEdep=0); - if (dLgekin); - ((TGeant3*)gMC)->Gekbin(); - vect[kP] = sqrt(gekin*(getot+fMass)); - - } while(0); - myMC->TrackPosition(fCurrentPosition); - myMC->TrackMomentum(fCurrentMomentum); - gAux.back().fP=fCurrentMomentum.P(); - -///??????????????????????????????????? - if (fEdep -#include -#include -#include -#include "TROOT.h" -#include "TColor.h" -#include "TVirtualMC.h" -#include "StMCStepping2Hist.h" -#include "StTGeoProxy.h" -#include "TObjArray.h" -#include "TNamed.h" -#include "TH1F.h" -#include "THStack.h" - -#include "TGeoManager.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoBBox.h" -#include "TGeoTube.h" -#include "TProfile.h" -#include "TProfile2D.h" -#include "TLegend.h" -#include "TStyle.h" -#include "TCanvas.h" -#include "TSystem.h" -#include "StTProfile2D.h" -#include "StiELossTrk.h" - -void Break(int ii) { -static int myII=-1946; -if (ii != myII) return; -printf ("Break %d\n",ii); -} - -StMCStepping2Hist *StMCStepping2Hist::fThis=0; - -static TH1D *Convert(const TProfile *tp,const char *suff="th1d") -{ - int nx = tp->GetXaxis()->GetNbins(); - double xl = tp->GetXaxis()->GetXmin(); - double xu = tp->GetXaxis()->GetXmax(); - - TString ts(tp->GetName());ts += "_"; ts+=suff; - TH1D *hh = new TH1D(ts,tp->GetTitle(),nx,xl,xu); - double ents=0; - for (int i=1;i<=nx;i++) { - double cont = tp->GetBinContent(i); - hh->SetBinContent(i, cont); - ents += cont; - } - hh->SetEntries(ents); - hh->SetFillColor(tp->GetFillColor()); - return hh; -} - -//_____________________________________________________________________________ -class My2Hist -{ -enum {kMAXNODE=1000,kMAXMODU=20}; -public: -class Node_t { -public: -TString name; -double radL; -double ort2; -double rxy; -double z; -double len; -double mcs[3]; - int ihit; - -}; - -private: -class From_t { -public: - From_t(){ ort2=0;radL=0;nTims=0;} - -public: -TString name; -double radL; -double ort2; -int nTims; -}; - -class Modu_t { -public: -Modu_t() {memset(mybeg,0,myend-mybeg+1);} -From_t *GetFrom(const char *name); -void Add2From(const char *name,double radl,double ort2); -public: -TString name; -char mybeg[1]; -double radL; -double ort2; -double rMax; -double zMax; -int ihit; -int kolo; -TProfile *prof[4]; -int nfrom; -char myend[1]; -From_t from[kMAXMODU]; -}; - -public: - My2Hist(const char *tit); -const char *GetName() const {return mName.Data();} -void SetEta(double eta){ mEta = eta;} -Node_t &AddNode(); - - -void Fill(double rxy0,double rxy1,double z0,double z1,double radL); -void Update(); -void Paint(); -void Save(); -void PrintFrom(); -Modu_t &GetModu(const TString &name); -void Clear(); -void PadClean(TPad *pad); - -private: -char mFist[1]; -int mNModu; //number of modules used -int mNNode; //number of nodees used -int mNBins; //number of bins in profile -double mLimt[2];//limits of profile -double mEta; - - -THStack *mStk[3][2]; -TCanvas *mC[3][2],*mC2,*mCt; -TLegend *mL[3][2],*mL2; - -StTProfile2D *mP2; -TH1D *mHt; -double mDelta2Z; -double mDelta2R; -char mLast[1]; - -Node_t mNode[kMAXNODE]; -Modu_t mModu[kMAXMODU]; -TString mName; //Name - -}; - -//_____________________________________________________________________________ -My2Hist::From_t *My2Hist::Modu_t::GetFrom(const char *name) -{ - int i; - for (i=0;inTims++; - fr->radL +=radl; - fr->ort2 +=ort2; -} -//_____________________________________________________________________________ -My2Hist::My2Hist(const char *tit) -{ - gStyle->SetPalette(1); - if (!gROOT->GetColor(1000)) new TColor(1000,1,1,1); - - - memset(mFist,0,mLast-mFist); - mNBins = 60; - mLimt[0]= -6; - mLimt[1]= 6; - mName = tit; - TString ts("P2_");ts+=mName; ts+="_ZR"; - double zLow=-2000,zUpp=2000; - double rLow=0 ,rUpp=500; - int nZ=400,nR=250; - mDelta2Z = (zUpp-zLow)/nZ; - mDelta2R = (rUpp-rLow)/nR; - mP2 = new StTProfile2D(ts,"invX0(Z,Rxy)",nZ,zLow,zUpp,nR,rLow,rUpp); - mHt = new TH1D("OldStar","TrackLen(Rxy)",100,1./200,1./60); -} - -//_____________________________________________________________________________ -My2Hist::Node_t &My2Hist::AddNode() -{ - return mNode[mNNode++]; -} -//_____________________________________________________________________________ -void My2Hist::Fill(double r0,double r1,double z0,double z1,double radL) -{ - if (radL <=0.) radL = 3e33; - double dR = r1-r0,dZ = z1 - z0; - double Delta2R = (dR<0) ? -mDelta2R:mDelta2R; - double Delta2Z = (dZ<0) ? -mDelta2Z:mDelta2Z; - double tau,dau; - double dQ = sqrt(dR*dR+dZ*dZ); - double rA=r0,zA=z0; - while(1) { - double rB = int((rA+Delta2R)/mDelta2R)*mDelta2R; - tau = (r1-rA)/dR; - dau = (rB-rA)/dR; - if (tau>dau) tau = dau; - - double zB = int((zA+Delta2Z)/mDelta2Z)*mDelta2Z; - dau = (z1 -zA)/dZ; - if (tau>dau) tau = dau; - dau = (zB -zA)/dZ; - if (tau>dau) tau = dau; - if (tau<1e-6) break; - rB = rA + dR*tau; - zB = zA + dZ*tau; - double dL = dQ*tau; - mP2->Fill(0.5*(zA+zB),0.5*(rA+rB),1./radL,dL); - if (fabs(z0) <200 && fabs(z1) <200 && r1<200) { mHt->Fill(1/(0.5*(rA+rB)),dL);} - rA = rB; zA = zB; - } - -} -//_____________________________________________________________________________ -void My2Hist::Update() -{ - if (!mNNode) return; - int idxLst; - for (idxLst=mNNode-1;idxLst>=0;idxLst--) {if(mNode[idxLst].ihit) break;} - if (idxLst<0) {mNNode=0; Clear(); return;} - - TString ts(mNode[idxLst].name); - for (;idxLst>=0;idxLst--) {if(mNode[idxLst].name!=ts) break;} - if (idxLst<0) {mNNode=0; Clear(); return;} - - - for (int idx=0;idx<=idxLst;idx++) { - Modu_t &modu = GetModu(mNode[idx].name); - modu.radL += mNode[idx].radL; - assert(modu.radL<100); - modu.ihit += mNode[idx].ihit; - if (modu.rMax< mNode[idx].rxy) modu.rMax = mNode[idx].rxy; - if (modu.zMax< mNode[idx].z ) modu.zMax = mNode[idx].z ; - } - - for (int idx=0;idxFill(mEta,mModu[idx].radL); - } - - TString prevName("****"); - for (int ihi=0;ihiFill(mEta,radL[1]); - hitm.prof[2]->Fill(mEta,sqrt(ort2[1])); - } } - - Clear(); - -} - -//_____________________________________________________________________________ -void My2Hist::Paint() -{ - enum {nKols=12}; -// Magenta= red anilin (sirenevyj) -// Cian = light blue (goluboj) -// Spring = light green -// Teal = Blue Green -// Sort by aver rxy - Modu_t swap; - - do { swap.prof[0]=0; - for (int i=1;i= mModu[i-1].rMax) continue; - swap = mModu[i]; mModu[i]=mModu[i-1]; mModu[i-1]=swap; - } - } while(swap.prof[0]); - - for (int i=0,kol=-1;iGetEntries(); - int nEnt1 = (int)mModu[i].prof[1]->GetEntries(); - if (nEnt0+nEnt1<=0) continue; - kol++; - mModu[i].kolo = gStyle->GetColorPalette((kol*23)); - const char *cens = (mModu[i].ihit)? "*":" "; - printf (" Modu=%s%s \tRxy=%g \tradL=%g \tEnt=%d/%d \tColor=%d\n" - ,(const char*)mModu[i].name,cens - ,mModu[i].rMax - ,mModu[i].prof[0]->GetMaximum() - ,nEnt0,nEnt1 - ,mModu[i].kolo - ); - } -static const char *ParaName[3]={"RadL" ,"RadL","Ort"}; -static const char *SmallBig[2]={"Small","Big" }; -static const char *FromInto[3]={"ThisToAll" ,"AllToThis","AllToThis"}; -static const double myMax[3]={ 3 ,3 , 3 }; - for (int jk=0;jk<3; jk++) { - - for (int sb=0;sb<2; sb++) { - TString namS("HS_"); namS+=ParaName[jk];namS+=SmallBig[sb]; namS+=FromInto[jk]; - TString namH(namS); namH.Replace(1,1,"1"); - TString tit(SmallBig[sb]); tit+=" "; tit+=ParaName[jk]; - tit+="(Eta) contribution "; tit+=FromInto[jk]; - THStack *ths = new THStack(namS,tit); - TLegend *tl = new TLegend(0.6,0.6,0.9,0.9); - mL[jk][sb] = tl; - tl->SetFillStyle(4050); - mStk[jk][sb] = ths; - for (int ih = 0;ihGetEntries()) continue; - if ((sb) != (mModu[ih].prof[jk]->GetMaximum()>myMax[jk])) continue; - // assert(kolSetFillColor(mModu[ih].kolo); - ths->Add(Convert(mModu[ih].prof[jk],namH)); - tl->AddEntry(mModu[ih].prof[jk],"","f"); - }// end ih - if (!ths->GetHists()) continue; - TString ts("C_"); ts+=mName; ts+=ParaName[jk]; - ts+=SmallBig[sb] ; ts +=FromInto[jk]; - - mC[jk][sb] = new TCanvas(ts,tit,600,800); - ths->Draw(); tl->Draw(); - mC[jk][sb]->Update(); - - }//end sb - }//end jk - - mP2->SupressZeros(1e-5); - TString ts("C_"); ts+=mName; ts+="_ZR"; - mCt = new TCanvas("OldStar","TrakLen(Rxy)" ,600,800); - mHt->Draw(); - mCt->Modified(); mCt->Update(); - - mC2 = new TCanvas(ts ,"invX0(Z,Rxy)" ,600,800); - mC2->Divide(1,3); - mC2->cd(1); mP2->Draw("colz"); - ts="P_"; ts+=mName; ts+="_Z"; - TProfile *pz = mP2->ProfileX(ts,1,-1); - pz->SetFillStyle(3026); - pz->SetLineColor(2); - pz->SetLineWidth(3); - - ts="P_"; ts+=mName; ts+="_R"; - TProfile *pr = mP2->ProfileY(ts,1,-1); - pr->SetFillStyle(3026); - pr->SetLineColor(2); - pr->SetLineWidth(3); - - mC2->cd(2); pz->Draw(""); - mC2->cd(3); pr->Draw(""); - - mC2->Modified(); mC2->Update(); -} -//_____________________________________________________________________________ -void My2Hist::Save() -{ - for (int i=0;i<7;i++) { - if(!mC[0][i]) continue; - mC[0][i]->Update(); - mC[0][i]->Print(".png"); - PadClean(mC[0][i]); - mC[0][i]->Print(".C"); - if (i>5) continue; - } -} -//_____________________________________________________________________________ -My2Hist::Modu_t &My2Hist::GetModu(const TString &name) -{ -static int idx = -1; - if (idx>=0 && name == mModu[idx].name) return mModu[idx]; - -//search by name - for (idx=0; idx < mNModu ; idx++) {if (name==mModu[idx].name) break;} - - if (idx==mNModu) { - mModu[mNModu].name = name; - TString ts(name); ts+="_"; - mModu[mNModu].prof[0] = new TProfile(name,name,mNBins,mLimt[0],mLimt[1]); - ts+="_"; - mModu[mNModu].prof[1] = new TProfile(ts ,name,mNBins,mLimt[0],mLimt[1]); - ts+="_"; - mModu[mNModu].prof[2] = new TProfile(ts ,name,mNBins,mLimt[0],mLimt[1]); - mNModu++; assert(mNModu<100); - } - return mModu[idx]; -} -//_____________________________________________________________________________ -void My2Hist::Clear() -{ - mNNode = 0; - for (int idx=0;idxGetListOfPrimitives(); - if (!tl) return; - TObject *to; - TObjLink *lnkNex = tl->FirstLink(),*lnk=0; - while (lnkNex) { - lnk = lnkNex; lnkNex = lnk->Next(); - to = lnk->GetObject(); if (!to) continue; - if (to->InheritsFrom(TPad::Class())) { PadClean((TPad*)to); continue;} - if (to->InheritsFrom(TH1F::Class())) { tl->Remove(lnk);/* delete to;*/} - } - -} -//_____________________________________________________________________________ -void My2Hist::PrintFrom() -{ -#define QWE(x) (int(x*1000)/1000.) - TString ts(GetName()); ts+=".tab"; - FILE *ftab = fopen(ts.Data(),"w"); - assert (ftab); - - - fprintf(ftab,"\n\n PrintFrom() %s contributions\n\n",GetName()); - - for (int im=0;imSetPalette(1); - assert(!fThis); - memset(fFist,0,fLast-fFist); - TString tsName(GetName()); - int yf = tsName.Contains(".DEV2"); - tsName = gSystem->BaseName(tsName.Data()); - tsName.ReplaceAll(".C",""); - tsName.ReplaceAll("Geometry.",""); - if (yf) tsName += "yf"; - fThis = this; - fMy2Hist = new My2Hist(tsName); - fELossTrk[0] = new StiELossTrk; - fELossTrk[1] = new StiELossTrk; -} -//_____________________________________________________________________________ -StMCStepping2Hist::~StMCStepping2Hist() -{ - fThis=0; -} -//_____________________________________________________________________________ -void StMCStepping2Hist::Print(const Option_t*) const -{ - StTGeoProxy::Instance()->Print(KazeAsString(fKaze)); - printf("RadLen=%g fCurrentLength=%g Rxy=%g Z=%g\n\n" - , fTotRadL,fCurrentLength,fCurrentPosition.Perp(),fCurrentPosition.Z()); -} -//_____________________________________________________________________________ -int StMCStepping2Hist::Fun() -{ -static int nCall = 0; -nCall++; - -if (!fHitShape) fHitShape = StTGeoProxy::Instance()->GetHitShape(); - - const TGeoVolume *modu = 0; TString ts,modName; - Case(); -// Sensitive volume - - if (fSensMaxZ < fabs(fCurrentPosition.Z())) fSensMaxZ = fabs(fCurrentPosition.Z()); - if (fSensMaxR < fCurrentPosition.Perp() ) fSensMaxR = fCurrentPosition.Perp(); -// - - assert(fCurrentLength< 10000); - assert(fEnterLength < 10000); - -// StTGeoProxy::Instance()->Print(KazeAsString(fKaze)); -// printf("fEnterLength=%g fCurrentLength=%g Rxy=%g Z=%g\n\n" -// , fEnterLength, fCurrentLength,fCurrentPosition.Perp(),fCurrentPosition.Z()); -SWITCH: int myKaze = fKaze; -if (GetDebug()) {printf("%d - ",nCall); Print();} -if (strcmp(fVolume->GetName(),"TPAD")==0) Break(1); - - - switch (fKaze) { - case kNEWtrack:; - fELossTrk[0]->Reset(); - fMy2Hist->Update(); - fTotRadL=0; - fModName=""; - - case kENTERtrack:; - if (strcmp(fVolume->GetName(),"HALL")==0) fKaze=kENDEDtrack; - if (fHitShape->Outside(fCurrentPosition.Z(),fCurrentPosition.Perp())) - fKaze=kENDEDtrack; - break; - - case kCONTINUEtrack: - case kIgnore: - break; - - case kOUTtrack: - case kENDEDtrack: - fMy2Hist->Update(); - TVirtualMC::GetMC()->StopTrack(); - break; - - case kEXITtrack: - { - fVolHits = (StTGeoProxy::Instance()->IsSensitive(fVolume))? 1:0; - if (fX0<=0) break; - double dL = fCurrentLength-fEnterLength; - fVolRadL = fabs(dL)/fX0; - fTotRadL += fVolRadL; -//?? assert(fTotRadL<100); - modu = StTGeoProxy::Instance()->GetModu(); - fModName = (modu)? modu->GetName(): "CAVE"; - fModName = Alias(fModName); - fELossTrk[0]->Add(dL,fX0); - fELossTrk[1]->Reset();; - fELossTrk[1]->Add(dL,fX0); - fTotOrt2 = fELossTrk[0]->GetOrt2(); - FillHist(1); - - } - break; - - default: - Error("Case","Unexpected case %x == %s",fCase,fCasName.Data()); - assert(0); - } - if (fKaze!=myKaze) goto SWITCH; - - return 0; -} - -//_____________________________________________________________________________ -void StMCStepping2Hist::Finish(const char *) -{ - printf("\nMaxSensVolu: Rxy=%g aZ=%g\n\n",fSensMaxR,fSensMaxZ); - - - fMy2Hist->Paint(); - fMy2Hist->Save(); - fMy2Hist->PrintFrom(); -} - -//_____________________________________________________________________________ -void StMCStepping2Hist::FillHist(int flag) -{ - - switch(flag) { - - case 0: break; - - case 1: - { - double r1 = fEnterPosition.Perp(); - double r2 = fCurrentPosition.Perp(); - double eta = fCurrentMomentum.Eta(); - double phi = fCurrentMomentum.Phi()/M_PI*180; if(phi){} - double z1 = fEnterPosition[2]; - double z2 = fCurrentPosition[2]; - - fMy2Hist->SetEta(eta); - My2Hist::Node_t &node = fMy2Hist->AddNode(); - node.name = fModName; - node.len = fEnterLength; - node.radL =fVolRadL; - node.z =z2; - node.ort2 =fTotOrt2; - node.rxy =r2; - node.ihit =fVolHits; - fELossTrk[1]->GetCoef(node.mcs); - fMy2Hist->Fill(r1,r2,z1,z2,fX0); - break; - } - } - -} -//_____________________________________________________________________________ -const char *StMCStepping2Hist::Alias(const char *modu) -{ - const char *inp[] = {"IBSH","IBSG","IBSF","IBSE","IBSD" - ,"IBSC","IBCC","IBAC","IBSB","IBSA" - ,"IBEM" - ,"FTMO" - ,"FBOX","FBO1","FBO2",0}; - - const char *out[] = {"VPDD","VPDD","VPDD","VPDD","VPDD" - ,"VPDD","VPDD","VPDD","VPDD","VPDD" - ,"VPDD" - ,"FTPC" - ,"FPDM","FPDM","FPDM",0}; - - for (int i=0;inp[i];i++) { - if (strcmp(modu,inp[i])==0) return out[i]; - } - return modu; -} diff --git a/StarVMC/GeoTestMaker/StMCStepping2Hist.h b/StarVMC/GeoTestMaker/StMCStepping2Hist.h deleted file mode 100644 index aad0037a1c2..00000000000 --- a/StarVMC/GeoTestMaker/StMCStepping2Hist.h +++ /dev/null @@ -1,57 +0,0 @@ -// $Id: StMCStepping2Hist.h,v 1.3 2013/04/20 21:54:07 perev Exp $ -// -// -// Class StMCStepping2Hist -// ------------------ - - -#ifndef STMC_STEPPING2HIST_H -#define STMC_STEPPING2HIST_H - -#include "TString.h" -#include "TArrayF.h" -#include "TLorentzVector.h" -#include "StMCStepping.h" - -class StTGeoProxy; -class StTGeoHitShape; -class My2Hist; -class StiELossTrk; - -class StMCStepping2Hist : public StMCStepping -{ -public: - StMCStepping2Hist(const char *name="",const char *tit=""); -virtual ~StMCStepping2Hist(); - // methods -virtual int Fun(); -virtual void Print (const Option_t* opt=0) const; -virtual void Finish(const Option_t* opt=0); -static StMCStepping2Hist *Instance() {return fThis;} -private: -static const char *Alias(const char *modu); -void FillHist(int flag); -protected: -char fFist[1]; -double fSensMaxR; -double fSensMaxZ; -double fTotRadL; -double fTotOrt2; -double fVolRadL; - int fVolHits; - - StiELossTrk *fELossTrk[2]; - My2Hist *fMy2Hist; -const StTGeoHitShape *fHitShape ; -char fLast[1]; -TString fModName; - -private: -void FillHist(); - -static StMCStepping2Hist *fThis; - -ClassDef(StMCStepping2Hist,0) // -}; -#endif //STMC_STEPPING2HIST_H - diff --git a/StarVMC/GeoTestMaker/StMCSteppingHist.cxx b/StarVMC/GeoTestMaker/StMCSteppingHist.cxx deleted file mode 100644 index c9699ebe31f..00000000000 --- a/StarVMC/GeoTestMaker/StMCSteppingHist.cxx +++ /dev/null @@ -1,413 +0,0 @@ -// $Id: StMCSteppingHist.cxx,v 1.3 2009/10/13 17:19:35 perev Exp $ -// -// -// Class StMCSteppingHist -// ------------------ -// Base class for Magnetic field calculation - -#include -#include -#include -#include -#include "StMCSteppingHist.h" -#include "TObjArray.h" -#include "TNamed.h" -#include "TH1F.h" - -#include "TGeoManager.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoBBox.h" -#include "TGeoTube.h" -#include "TProfile.h" -#include "TProfile2D.h" -#include "StTProfile2D.h" -#include "TStyle.h" -#include "TCanvas.h" -#include "TSystem.h" - -#include "StarRoot/TH1Helper.h" - -StMCSteppingHist *StMCSteppingHist::fThis=0; -int Kount[10]={0,0,0,0,0,0,0,0,0,0}; -double hMin[4] = {99,99,99,99}; -double hMax[4] = {0}; -class MyHolder : public TNamed -{ -public: - MyHolder(const char *name,const char *tit):TNamed(name,tit) - {memset(&fEps,0,(char*)&fLast-(char*)&fEps);} - - double fEps; - double fEpz; - int fEnt; - int fTot; - double fS[2]; - double fSA[2]; - double fSR[2]; - - TH1F *fH[2]; - int fLast; -}; - - - -ClassImp(StMCSteppingHist) - -//_____________________________________________________________________________ -StMCSteppingHist::StMCSteppingHist(const char *name,const char *tit) - : StMCStepping(name,tit) -{ - gStyle->SetPalette(1); - assert(!fThis); - memset(&fFist,0,&fLast-&fFist); - TString tsName(GetName()); - int yf = tsName.Contains(".DEV2"); - tsName = gSystem->BaseName(tsName.Data()); - tsName.ReplaceAll(".C",""); - tsName.ReplaceAll("Geometry.",""); - if (yf) tsName += "yf"; - fThis = this; - fVols = new TObjArray(); - fMats = new TObjArray(); - const char *hNam[]= {"Star_dRadL_1","Star_dRadL_2","Star_dRadL_3" - ,"Tpce_dRadL_1","Tpce_dRadL_2","Tpce_dRadL_3" - ,"Star__RadL_1","Star__RadL_2","Star__RadL_3" - ,"Tpce__RadL_1","Tpce__RadL_2","Tpce__RadL_3",0}; - - const char *hTit[]= {"STAR dRadL(eta,rxy)" - ,"STAR dRadL(phi,rxy)" - ,"STAR dRadL(phi,eta)" - ,"TPC dRadL(eta,rxy)" - ,"TPC dRadL(phi,rxy)" - ,"TPC dRadL(phi,eta)" - ,"STAR RadL(eta,rxy)" - ,"STAR RadL(phi,rxy)" - ,"STAR RadL(phi,eta)" - ,"TPC RadL(eta,rxy)" - ,"TPC RadL(phi,rxy)" - ,"TPC RadL(phi,eta)",0}; - -const double hPar[][6]= {{60, 0, 3, 110,0,220} - ,{30,-15,15, 110,0,220} - ,{30,-15,15, 60,0, 3} - ,{60, 0, 3, 110,0,220} - ,{30,-15,15, 110,0,220} - ,{30,-15,15, 60,0, 3} - ,{60, 0, 3, 110,0,220} - ,{30,-15,15, 110,0,220} - ,{30,-15,15, 60,0, 3} - ,{60, 0, 3, 110,0,220} - ,{30,-15,15, 110,0,220} - ,{30,-15,15, 60,0, 3}}; - - rStep = int(hPar[0][5]/hPar[0][3]+0.0001); - - for (int i=0;hNam[i];i++) { - TString tsn(tsName); tsn+="_"; tsn+=hNam[i]; - TString tst(tsName); tst+=":"; tst+=hTit[i]; - - mH[i] = new StTProfile2D(tsn.Data(),tst.Data() - ,(int)hPar[i][0],hPar[i][1],hPar[i][2] - ,(int)hPar[i][3],hPar[i][4],hPar[i][5]); - mC[i] = new TCanvas(tsn.Data(),tst.Data(),600,800); - mC[i]->Divide(1,3); - mC[i]->cd(1); gPad->SetLogz();mH[i]->Draw("colZ"); - } - - - -} -//_____________________________________________________________________________ -StMCSteppingHist::~StMCSteppingHist() -{ - fVols ->Delete(); delete fVols; fVols =0; - fMats ->Delete(); delete fMats; fMats =0; - fThis=0; -} -//_____________________________________________________________________________ -void StMCSteppingHist::Print(const Option_t*) const -{ - fVols->ls(); - fMats->ls(); -} -//_____________________________________________________________________________ -int StMCSteppingHist::Fun() -{ - Case(); - assert(fCurrentLength< 10000); - assert(fEnterLength < 10000); - switch (fKaze) { - case kNEWtrack:; - FillVolMat(); - mRadL=0; - case kENTERtrack:; - TestTGeo(); - break; - - case kCONTINUEtrack: - case kOUTtrack: - case kIgnore: - break; - - case kEXITtrack: - case kENDEDtrack: - { - SummArr(); - FillHist(); - } - break; - - default: - Error("Case","Unexpected case %x == %s",fCase,fCasName.Data()); - assert(0); - } - return 0; -} -//_____________________________________________________________________________ -void StMCSteppingHist::Fill(TObjArray *arr) -{ - - MyHolder *mh = 0; - int n = arr->GetSize(); - for (int idx=1;idxAt(idx); - if (!mh) continue; - if (!mh->fS[0]) continue; - mh->fEnt++; - for (int j=0;j<2;j++) { - double val = mh->fS[j]; - mh->fS[j]=0; - mh->fSA[j]+=val; - mh->fSR[j]+=(val*val); - } - } -} -//_____________________________________________________________________________ -void StMCSteppingHist::Sort(TObjArray *arr) -{ - arr->Compress(); - arr->Sort(); - int n = arr->GetSize(); - for (int i=0;iAt(i+0); - if (!t0) break; - TNamed *t1=(TNamed*)arr->At(i+1); - if (!t1) break; - const char *n0 = t0->GetName(); - const char *n1 = t1->GetName(); - if (*n0 != *n1) continue; - int l0 = strcspn(n0,"#"); - int l1 = strcspn(n1,"#"); - if (l0!=l1) continue; - if (strncmp(n0,n1,l0)) continue; - TString ts(n0);ts.Insert(l0,"_"); - t0->SetName(ts.Data()); - } - arr->Sort(); -} - -//_____________________________________________________________________________ -void StMCSteppingHist::SummArr() -{ - for (int iarr=0;iarr<2;iarr++) { - TObjArray *arr = (&fVols)[iarr]; - - int n = arr->GetSize(); - int id = ((iarr==0)? fVolume->GetNumber():fMaterial->GetIndex()); - MyHolder *mh=0; - if (id < n) mh = (MyHolder*)arr->At(id); - if (!mh) { - TString ts = (!iarr)? fVolume->GetName():fMedium->GetName(); - ts+="#"; ts+=id; - mh = new MyHolder(ts.Data(),fMedium->GetName()); - for (int i=0;i<2;i++) { - TH1F *h = new TH1F(ts.Data(), "", 100, 0., 1.); - TH1Helper::SetCanRebin(h); - h->SetDirectory(0); - mh->fH[i] = h; - } - arr->AddAtAndExpand(mh,id); - } - mh->fTot++; - double eps = fPrevEps+fMedium->GetParam(kEpsil); - mh->fEps+=eps; - double cl=fCurrentLength; - double el=fEnterLength; - double s = cl-el; - double sz = s*(cl*cl+cl*el+el*el); - mh->fEpz += 3.*(cl*cl*fMedium->GetParam(kEpsil)+el*el*fPrevEps); - mh->fS[0] += s; - mh->fS[1] += sz; - }//end of for - fPrevEps = fMedium->GetParam(kEpsil); -} - -//_____________________________________________________________________________ -void StMCSteppingHist::FillVolMat() -{ - Fill(fVols); - Fill(fMats); - fPrevEps=0; -} - -//_____________________________________________________________________________ -void StMCSteppingHist::Finish(const char *opt) -{ -// *** MinMax[0] = 1.01188e-08 82.2315 -// *** MinMax[1] = 1.01188e-08 1.38347 -// *** MinMax[2] = 6.65619e-06 269.674 -// *** MinMax[3] = 0.00645718 10.036 -// Print(opt); - - for (int i=0;i<4;i++) { - printf (" *** MinMax[%d] = %g %g\n",i,hMin[i],hMax[i]); - } - - double myMin[4]={1e-6,1e-6,5e-6,5e-3}; - double myMax[4]={1e+2,5e+0,1e+2,1e+1}; - TString ts; - int idx; - for (int i=0;mH[i];i++) { - mH[i]->SetMinimum(myMin[i/3]); - mH[i]->SetMaximum(myMax[i/3]); - TProfile *hx = mH[i]->ProfileX(); - ts = hx->GetTitle(); - idx = ts.Index(","); - ts.Replace(idx,4,""); - hx->SetTitle(ts); - TProfile *hy = mH[i]->ProfileY(); - ts = hy->GetTitle(); - idx = ts.Index(","); - ts.Replace(idx-3,4,""); - hy->SetTitle(ts); - mC[i]->cd(2);hx->Draw("logy"); - mC[i]->cd(3);hy->Draw("logy"); - mC[i]->Modified(); mC[i]->Update(); - } - -#if 0 - static const char* ext[]={".volu",".mate",0}; - FillVolMat(); - Sort(fVols); - Sort(fMats); - for (int iar=0;iar<2; iar++) { - TObjArray *arr = (&fVols)[iar]; - TString file(GetName()); file +="MCStep"; file += ext[iar]; - - FILE *f = fopen(file.Data(),"w"); - - int n = arr->GetSize(); - for (int i=0; iAt(i); - if(!mh) continue; - int nent = mh->fEnt; - if (nent<10) continue; - double aver = mh->fSA[0]/nent; - double rms = (mh->fSR[0]/nent-aver*aver); - rms = sqrt(rms/(nent-1)); - double eps = mh->fEps/nent; - rms = rms + eps; - double fak = (nent/fTrackNumber)*(4./3)*3.141592; - eps = mh->fEpz/nent; - double sz = mh->fSA[1]/nent; - double sze = mh->fSR[1]/nent-sz*sz; - sz = (sz*fak); - sze = (sqrt(sze/(nent-1))+eps)*fak; - sz /= 1000.; sze /=1000.; - fprintf(f,"%20s.%s \tnent=%d \taver=%g +- %g \tsize= %g +- %g\n" - ,mh->GetName(),GetName(),nent,aver,rms,sz,sze); - } - } -#endif //0 -// printf("Kount[0-2] = %d %d %d\n",Kount[0],Kount[1],Kount[2]); - - while(!gSystem->ProcessEvents()){}; - for (int i=0;mC[i];i++) {mC[i]->Print(".C");} - for (int i=0;mC[i];i++) {mC[i]->Print(".png");} - -} - -//_____________________________________________________________________________ -void StMCSteppingHist::TestTGeo() -{ -#if 0 - double par[9]; - if (!gGeoManager) return; - TGeoVolume *gv = gGeoManager->GetCurrentVolume(); - assert(gv); - assert(fVolName == gv->GetName()); - if (fMatName != "TPCE_SENSITIVE_GAS") return; - - TGeoShape *sh = gv->GetShape(); - if (strcmp("TGeoTube",sh->GetName())== 0) { - TGeoTube *tube = (TGeoTube *)sh; - par[0] = tube->GetRmin(); - par[1] = tube->GetRmax(); - par[2] = tube->GetDz();} - - else if (strcmp("TGeoBBox",sh->GetName())== 0) { - TGeoBBox *bbox = (TGeoBBox *)sh; - par[0] = bbox->GetDX(); - par[1] = bbox->GetDY(); - par[2] = bbox->GetDZ(); - } else { return;} - - printf("TestTGeo: %s::%s %g %g %g\n",gv->GetName(),sh->GetName(),par[0],par[1],par[2]); -#endif //0 -} -//_____________________________________________________________________________ -void StMCSteppingHist::FillHist() -{ - int inTPC=0; - for (int i=1;1;i++) { - TGeoNode *n = gGeoManager->GetMother(i); - if(!n) break; - TGeoVolume *v=n->GetVolume(); - if (!v) continue; - if (strcmp(v->GetName(),"TPCE")) continue; - inTPC=1; break; - } - - double r1 = fEnterPosition.Perp(); - double r2 = fCurrentPosition.Perp(); - double eta = fCurrentMomentum.Eta(); - double phi = fCurrentMomentum.Phi()/M_PI*180; -// printf("vol=%s.%s radL=%g\n",fVolume->GetName(),fMaterial->GetName(),fMaterial->GetRadLen()); - double radl = fMaterial->GetRadLen(); if (radl<=0) return; - radl = fabs(fCurrentLength-fEnterLength)/radl; - for (int iDet=0;iDet<=inTPC*3; iDet+=3) { - double jl = r1,jr; - while(1) { - jr=int(jl+rStep); if (jr >r2) jr=r2; - double dr = jr-jl; - double myRadLen = radl*dr/(r2-r1); - assert(myRadLen>=0); - mH[iDet+0]->Fill(eta,jr ,myRadLen); - mH[iDet+1]->Fill(phi,jr ,myRadLen); - mH[iDet+2]->Fill(phi,eta,myRadLen); - - mRadL += 0.5*myRadLen; - mH[iDet+6]->Fill(eta,jr ,mRadL); - mH[iDet+7]->Fill(phi,jr ,mRadL); - mH[iDet+8]->Fill(phi,eta,mRadL); - mRadL += 0.5*myRadLen; - if (myRadLen > 1e-8) { - int jDet = iDet/3; - if (hMin[jDet]>myRadLen) hMin[jDet]=myRadLen; - if (hMax[jDet]mRadL) hMin[jDet]=mRadL; - if (hMax[jDet]=r2) break; - } - } -} - - - - - - diff --git a/StarVMC/GeoTestMaker/StMCSteppingHist.h b/StarVMC/GeoTestMaker/StMCSteppingHist.h deleted file mode 100644 index 08c0577def5..00000000000 --- a/StarVMC/GeoTestMaker/StMCSteppingHist.h +++ /dev/null @@ -1,52 +0,0 @@ -// $Id: StMCSteppingHist.h,v 1.1 2009/03/25 23:15:11 perev Exp $ -// -// -// Class StMCSteppingHist -// ------------------ - - -#ifndef STMC_STEPPINGHIST_H -#define STMC_STEPPINGHIST_H - -#include "TString.h" -#include "TArrayF.h" -#include "TLorentzVector.h" -#include "StMCStepping.h" -class TProfile2D; -class TCanvas; -class TObjArray; -class StMCSteppingHist : public StMCStepping -{ -public: - StMCSteppingHist(const char *name="",const char *tit=""); -virtual ~StMCSteppingHist(); - // methods -virtual int Fun(); -virtual void Print (const Option_t* opt=0) const; -virtual void Finish(const Option_t* opt=0); -static StMCSteppingHist *Instance() {return fThis;} -void TestTGeo(); -protected: -char fFist; -TObjArray *fVols; -TObjArray *fMats; -double fPrevEps; -TProfile2D *mH[20]; -TCanvas *mC[20]; -int rStep; -double mRadL; -char fLast; -private: -void Fill(TObjArray *arr); -void Sort(TObjArray *arr); -void SummArr(); -void FillVolMat(); -void FillHist(); - -static StMCSteppingHist *fThis; - -ClassDef(StMCSteppingHist,0) // -}; - -#endif //STMC_STEPPINGHIST_H - diff --git a/StarVMC/GeoTestMaker/StStepping.cxx.C b/StarVMC/GeoTestMaker/StStepping.cxx.C deleted file mode 100644 index 5f35761e018..00000000000 --- a/StarVMC/GeoTestMaker/StStepping.cxx.C +++ /dev/null @@ -1,408 +0,0 @@ -#include -#include -#include "Stiostream.h" -#include "StarVMCApplication.h" -#include "StarMCHits.h" -#include "TGeoManager.h" -#include "TGeant3TGeo.h" -#if ROOT_VERSION_CODE < 331013 -#include "TCL.h" -#else -#include "TCernLib.h" -#endif -#include "TDataSetIter.h" -#include "TPDGCode.h" -#include "TVirtualMC.h" -#include "TArrayI.h" -#include "TObjArray.h" -#include "TObjString.h" -#include "TClass.h" -#include "TROOT.h" -#include "TRandom.h" -#include "TLorentzVector.h" -#include "TFile.h" -#ifdef __ROOT__ -#include "StMaker.h" -#endif -#include "St_g2t_Chair.h" -#include "tables/St_g2t_event_Table.h" -#include "tables/St_g2t_pythia_Table.h" -#include "tables/St_g2t_track_Table.h" -#include "tables/St_g2t_vertex_Table.h" -#include "tables/St_particle_Table.h" -//#include "tables/St_g2t_run_Table.h" -#include "tables/St_g2t_gepart_Table.h" -#include "StEnumerations.h" -StarMCHits *StarMCHits::fgInstance = 0; -ClassImp(StarMCHits); -struct Detector_G2T_t { - StDetectorId kType; - Char_t *Name; - Char_t *G2T_type; - Char_t *G2T_name; - Char_t *G2T_sys; - Char_t *G2T_geom; -}; -static const Detector_G2T_t g2t[] = { - // type(cd) name sys geom version - { kTofId, "BCSB","g2t_ctf_hit","g2t_tof_hit","BTOF","btof_btog"}, // ++ - { kTofId, "BRSG","g2t_ctf_hit","g2t_tfr_hit","BTOF","btof_btog"}, // ++ - { kCtbId, "BXSA","g2t_ctf_hit","g2t_ctb_hit","BTOF","btof_btog"}, // ++ - { kUnknownId, "BPOL","g2t_ctf_hit","g2t_bbc_hit","BBCM","" }, // ++ - { kBarrelEmcPreShowerId,"CSDA","g2t_emc_hit","g2t_smd_hit","CALB","" }, // + - { kBarrelEmcTowerId, "CSUP","g2t_emc_hit","g2t_emc_hit","CALB","" }, // + - { kEndcapEmcPreShowerId,"EHMS","g2t_emc_hit","g2t_esm_hit","ECAL","ecal_emcg"}, // + - { kUnknownId, "ELGR","g2t_emc_hit","g2t_eem_hit","ECAL","" }, // + - { kUnknownId, "EPCT","g2t_emc_hit","g2t_eem_hit","ECAL","" }, // + - { kEndcapEmcTowerId, "ESCI","g2t_emc_hit","g2t_eem_hit","ECAL","ecal_emcg"}, // + - { kEndcapEmcPreShowerId,"EXSE","g2t_emc_hit","g2t_esm_hit","ECAL","" }, // + - { kFgtId, "FGSC","g2t_fgt_hit","g2t_fgt_hit","FGTD","" }, // + - { kUnknownId, "FHMS","g2t_emc_hit","g2t_fpd_hit","FPDH","" }, - { kUnknownId, "FLGR","g2t_emc_hit","g2t_fpd_hit","FPDH","" }, - { kUnknownId, "FPCT","g2t_emc_hit","g2t_fpd_hit","FPDH","" }, - { kUnknownId, "FSCI","g2t_emc_hit","g2t_fpd_hit","FPDH","" }, - { kUnknownId, "FREO","g2t_rch_hit","g2t_rch_hit","RICH","" }, // + - { kFtpcWestId, "FSEC","g2t_ftp_hit","g2t_ftp_hit","FTPC","ftpc_ftpg"}, // + - { kIstId, "IBSS","g2t_ist_hit","g2t_ist_hit","ISTB","" }, // + - { kUnknownId, "OQUA","g2t_rch_hit","g2t_rch_hit","RICH","" }, - { kPxlId, "PLAC","g2t_pix_hit","g2t_pix_hit","PIXL","" }, // + - { kPhmdId, "PDGS","g2t_pmd_hit","g2t_pmd_hit","PHMD","" }, // + - { kZdcWestId, "QSCI","g2t_emc_hit","g2t_zdc_hit","ZCAL","" }, // + - { kUnknownId, "QUAR","g2t_rch_hit","g2t_rch_hit","RICH","" }, // + - { kUnknownId, "RCSI","g2t_rch_hit","g2t_rch_hit","RICH","" }, // + - { kUnknownId, "RGAP","g2t_rch_hit","g2t_rch_hit","RICH","" }, // + - { kSsdId, "SFSD","g2t_svt_hit","g2t_ssd_hit","SISD","" }, // ++ - { kSvtId, "SVTD","g2t_svt_hit","g2t_svt_hit","SVTT","svtt_svtg"}, // ++ - { kSvtId, "svtd","g2t_svt_hit","g2t_svt_hit","SVTT","svtt_svtg"}, // ++ - { kMwpcWestId, "TMSE","g2t_mwc_hit","g2t_mwc_hit","TPCE","" }, // ++ - { kTpcId, "TPAD","g2t_tpc_hit","g2t_tpc_hit","TPCE","tpce_tpcg"}, // ++ - { kTpcId, "tpad","g2t_tpc_hit","g2t_tpc_hit","TPCE","tpce_tpcg"}, // ++ - { kUnknownId, "VRAD","g2t_vpd_hit","g2t_vpd_hit","VPDD","vpdd_vpdg"} // + -}; -static const Int_t No_g2t = sizeof(g2t)/sizeof(Detector_G2T_t); -//________________________________________________________________________________ -StarMCHits::StarMCHits(const Char_t *name,const Char_t *title) : - TDataSet(name,title), fDetectors(0), fDetList(0), - fVolUserInfo(0), fCurrentDetector(0), fDebug(0), fSeed(0), fEventNumber(0) -{ - fgInstance = this; fHitHolder = this; -} -//________________________________________________________________________________ -Int_t StarMCHits::Init() { - cout << "StarMCHits::Init() -I- Get Detectors" <GetDataBase("VmcGeometry/Index"); - assert(fDetectors); - // Make list of detector elements - TDataSetIter next( fDetectors , 99); - TDataSet *set = 0; - if (fDetList) delete fDetList; - fDetList = new THashList(100,0); - Int_t N = 0; - while ((set = next())) { - StarVMCDetector *det = dynamic_cast(set); - if (! det ) continue; - if (TString(det->GetName()) == "FPCT") continue; // ignore fpd - if (TString(det->GetName()) == "BRSG") continue; // ignore tfr - fDetList->Add(det); - N++; - } - fDetList->Rehash(N); - cout << "StarMCHits::Init() -I- Get Volume Info" << endl; - // TObjArray *UniqueVolumes = gGeoManager->GetListOfUVolumes(); - TObjArray *Volumes = gGeoManager->GetListOfUVolumes(); - Int_t Nids = Volumes->GetEntriesFast(); - if (! fVolUserInfo ) fVolUserInfo = new TObjArray(256); - for (Int_t i = 0; i < Nids; i++) { - TGeoVolume *vol = (TGeoVolume *) Volumes->At(i); - if (! vol) continue; - Int_t uid = vol->GetNumber(); -#if 0 - cout << "Volume:\t" << i << "\t" << vol->GetName() << "\t" << vol->GetTitle() << "\t" << uid; -#endif - TString title(vol->GetName(),4); - TObject *det = fDetList->FindObject(title.Data()); -#if 0 - if (det) cout << "\tDetector: " << det->GetName();// << "\t" << det->GetTitle(); -#endif - fVolUserInfo->AddAtAndExpand(det,uid); -#if 0 - cout << endl; -#endif - } - return 0; -} -//________________________________________________________________________________ -void StarMCHits::Step() { - // static Int_t Idevt0 = -1; - static Double_t Gold = 0; -#if 0 - if (Debug() && gMC->IsA()->InheritsFrom("TGeant3TGeo")) { - TGeant3TGeo *geant3 = (TGeant3TGeo *)gMC; - geant3->Gdebug(); - } -#endif - // cout << "Call StarMCHits::Step" << endl; - TGeoNode *nodeT = gGeoManager->GetCurrentNode(); - assert(nodeT); - TGeoVolume *volT = nodeT->GetVolume(); - assert(volT); - const TGeoMedium *med = volT->GetMedium(); - /* fParams[0] = isvol; - fParams[1] = ifield; - fParams[2] = fieldm; - fParams[3] = tmaxfd; - fParams[4] = stemax; - fParams[5] = deemax; - fParams[6] = epsil; - fParams[7] = stmin; */ - Int_t Isvol = (Int_t) med->GetParam(0); - fCurrentDetector = 0; - if (Isvol <= 0) return; - fCurrentDetector = (StarVMCDetector *) fVolUserInfo->At(volT->GetNumber()); - if (! fCurrentDetector) { - volT = nodeT->GetMotherVolume(); - fCurrentDetector = (StarVMCDetector *) fVolUserInfo->At(volT->GetNumber()); - if (! fCurrentDetector) { - TString path(gGeoManager->GetPath()); - TObjArray *obj = path.Tokenize("_/"); - Int_t N = obj->GetEntries(); - for (Int_t i = N-2; i >= 0; i -= 2) { - TObjString *o = (TObjString *) obj->At(i); - const Char_t *name = o->GetName(); - volT = gGeoManager->GetVolume(name); - assert (volT); - fCurrentDetector = (StarVMCDetector *) fVolUserInfo->At(volT->GetNumber()); - if (fCurrentDetector) break; - } - delete obj; - } - } - if (Isvol && ! fCurrentDetector && Debug()) { - cout << "Active medium:" << med->GetName() << "\t for volume " << volT->GetName() - << " has no detector description" << endl; - } - // Int_t Idevt = gMC->CurrentEvent(); - gMC->TrackPosition(fHit.Current.Global.xyzT); - gMC->TrackMomentum(fHit.Current.Global.pxyzE); - TGeoHMatrix *matrixC = gGeoManager->GetCurrentMatrix(); - fHit.Current.Global2Local(matrixC); - if (gMC->IsTrackEntering()) { - fHit.Detector= fCurrentDetector; - fHit.Entry = fHit.Current; - fHit.Sleng = gMC->TrackLength(); - fHit.Charge = (Int_t) gMC->TrackCharge(); - fHit.Mass = gMC->TrackMass(); - fHit.AdEstep = fHit.AStep = 0; - return; - } - Double_t GeKin = fHit.Current.Global.pxyzE.E() - fHit.Mass; - fHit.Sleng = gMC->TrackLength(); - if (fHit.Sleng == 0.) Gold = GeKin; - Double_t dEstep = gMC->Edep(); - Double_t Step = gMC->TrackStep(); - fHit.iPart = gMC->TrackPid(); - fHit.iTrack = StarVMCApplication::Instance()->GetStack()->GetCurrentTrackId(); // GetCurrentTrackNumber() + 1 to be consistent with g2t - // - - - - - - - - - - - - - energy correction - - - - - - - - - - - if (gMC->IsTrackStop() && TMath::Abs(fHit.iPart) == kElectron) { - TArrayI proc; - Int_t Nproc = gMC->StepProcesses(proc); - Int_t Mec = 0; - for (Int_t i = 0; i < Nproc; i++) if (proc[i] == kPAnnihilation || proc[i] == kPStop) Mec = proc[i]; - Int_t Ngkine = gMC->NSecondaries(); - if (fHit.iPart == kElectron && Ngkine == 0 && Mec == kPStop) dEstep = Gold; - else { - if (fHit.iPart == kPositron && Ngkine < 2 && Mec == kPAnnihilation) { - dEstep = Gold + 2*fHit.Mass; - if (Ngkine == 1) { - TLorentzVector x; - TLorentzVector p; - Int_t IpartSec; - gMC->GetSecondary(0,IpartSec,x,p); - dEstep -= p.E(); - } - } - } - } - // - - - - - - - - - - - - - - - - user - - - - - - - - - - - - - - - - // user step - // - - - - - - - - - - - - - - - sensitive - - - - - - - - - - - - - - fHit.AdEstep += dEstep; - fHit.AStep += Step; - if (fHit.AdEstep == 0) return; - if (! gMC->IsTrackExiting() && ! gMC->IsTrackStop()) return; - fHit.Exit = fHit.Current; - fHit.Middle = fHit.Entry; - fHit.Middle += fHit.Exit; - fHit.Middle *= 0.5; - if (! fCurrentDetector) return; - fHit.VolumeId = fCurrentDetector->GetVolumeId(gGeoManager->GetPath()); - FillG2Table(); -} -//________________________________________________________________________________ -void StarMCHits::FillG2Table() { - St_g2t_Chair *chair = fCurrentDetector->GetChair(); - assert(chair); - chair->Fill(fHit); -} -//________________________________________________________________________________ -void StarMCHits::FinishEvent() { - static const Double_t pEMax = 1 - 1.e-10; - TDataSet *m_DataSet = StarMCHits::instance()->GetHitHolder(); - if (! m_DataSet) return; - St_g2t_event *g2t_event = new St_g2t_event("g2t_event",1); - m_DataSet->Add(g2t_event); - g2t_event_st event; - memset (&event, 0, sizeof(g2t_event_st)); - fEventNumber++; - event.n_event = fEventNumber;//IHEAD(2) - event.ge_rndm[0] = fSeed;//IHEAD(3) - event.ge_rndm[1] = 0;//IHEAD(4) - event.n_run = 1; - event.n_track_eg_fs = StarVMCApplication::Instance()->GetStack()->GetNtrack(); - event.n_track_prim = StarVMCApplication::Instance()->GetStack()->GetNprimary(); - event.prim_vertex_p = 1; - event.b_impact = 99; - event.phi_impact = 0.5; - g2t_event->AddAt(&event); - Int_t NoVertex = 1; - St_g2t_vertex *g2t_vertex = new St_g2t_vertex("g2t_vertex",NoVertex); - m_DataSet->Add(g2t_vertex); - g2t_vertex_st vertex; - Int_t NTracks = StarVMCApplication::Instance()->GetStack()->GetNtrack(); - St_g2t_track *g2t_track = new St_g2t_track ("g2t_track",NTracks); - m_DataSet->Add(g2t_track); - g2t_track_st track; - StarMCParticle *particle = 0; - Int_t iv = 0; - TLorentzVector oldV(0,0,0,0); - TLorentzVector newV(0,0,0,0); - TLorentzVector devV(0,0,0,0); - for (Int_t it = 0; it GetStack()->GetParticle(it); - TParticle *part = (TParticle *) particle->GetParticle(); - part->ProductionVertex(newV); - devV = newV - oldV; - if (iv == 0 || devV.Mag() > 1.e-7) { - if (iv > 0) g2t_vertex->AddAt(&vertex); - memset (&vertex, 0, sizeof(g2t_vertex_st)); - iv++; - vertex.id = iv ;// primary key - vertex.event_p = 0 ;// pointer to event - vertex.eg_label = 0 ;// generator label (0 if GEANT) - vertex.eg_tof = 0 ;// vertex production time - vertex.eg_proc = 0 ;// event generator mechanism - memcpy(vertex.ge_volume," ",4); ;// GEANT volume name - vertex.ge_medium = 0 ;// GEANT Medium - vertex.ge_tof = 0 ;// GEANT vertex production time - vertex.ge_proc = 0 ;// GEANT mechanism (0 if eg) - vertex.ge_x[0] = newV.X() ;// GEANT vertex coordinate - vertex.ge_x[1] = newV.Y() ; - vertex.ge_x[2] = newV.Z() ; - vertex.ge_tof = newV.T() ; - vertex.n_parent = 0 ;// number of parent tracks - vertex.parent_p = 0 ;// first parent track - vertex.is_itrmd = 0 ;// flags intermediate vertex - vertex.next_itrmd_p = 0 ;// next intermedate vertex - vertex.next_prim_v_p= 0 ;// next primary vertex - oldV = newV; - } - vertex.n_daughter++; - track.id = it+1; - track.eg_label = particle->GetIdGen(); - track.eg_pid = part->GetPdgCode(); - track.ge_pid = gMC->IdFromPDG(track.eg_pid); - track.start_vertex_p = iv; - track.p[0] = part->Px(); - track.p[1] = part->Py(); - track.p[2] = part->Pz(); - track.ptot = part->P(); - track.e = part->Energy(); - track.charge = part->GetPDG()->Charge()/3; - Double_t ratio = part->Pz()/part->Energy(); - ratio = TMath::Min(1.-1e-10,TMath::Max(-1.+1e-10, ratio)); - track.rapidity = TMath::ATanH(ratio); - track.pt = part->Pt(); - ratio = part->Pz()/part->P(); - ratio = TMath::Min(pEMax,TMath::Max(-pEMax, ratio)); - track.eta = TMath::ATanH(ratio); - g2t_track->AddAt(&track); - } - g2t_vertex->AddAt(&vertex); -} -//________________________________________________________________________________ -void StarMCHits::Clear(const Option_t* opt) { - TObjArrayIter next(fVolUserInfo); - StarVMCDetector *desc = 0; - while ((desc = (StarVMCDetector *) next())) { desc->Clear(); } - if (gRandom) fSeed = gRandom->GetSeed(); -} -//_____________________________________________________________________________ -void StarMCHits::MakeDetectorDescriptors() { - if (! gGeoManager) { - cout << "No gGeoManager" << endl; - return; - } - TDataSet *Detectors = StMaker::GetChain()->GetDataBase("VmcGeometry/Index"); - if (! Detectors) { - cout << "No Detectors found in VmcGeometry/Index" << endl; - } - // Make List of sensitive volumes - TObjArray *vols = gGeoManager->GetListOfVolumes(); - Int_t nvol = vols->GetEntriesFast(); - Int_t nSensVol = 0; - Int_t nsize = 100; - TArrayI Indx(nsize); Int_t *indx = Indx.GetArray(); - for (Int_t i = 0; i < nvol; i++) { - TGeoVolume *vol = (TGeoVolume *) vols->At(i); - if (! vol) continue; - TGeoMedium *med = vol->GetMedium(); - if (! med) continue; - Int_t isvol = (Int_t) med->GetParam(0); - if (! isvol) continue; - indx[nSensVol] = i; - nSensVol++; - if (nSensVol >= nsize) { - nsize *= 2; - Indx.Set(nsize); - indx = Indx.GetArray(); - } - TString Path(MakeDetectorDescriptor(vol->GetName())); - if (Detectors) { - // Check consistency - StarVMCDetector *det = (StarVMCDetector *) Detectors->Find(vol->GetName()); - if (! det) { - cout << "Detector description for " << vol->GetName() << "\t" << vol->GetTitle() << " is missing" << endl; - } else { - TString FMT = det->GetFMT(); - cout << "Found path:\t" << Path.Data() << endl; - cout << "Set path:\t" << FMT.Data(); - if (Path == FMT) cout << " are the same" << endl; - else cout << " are the different" << endl; - } - } - - } -} -//_____________________________________________________________________________ -const Char_t *StarMCHits::MakeDetectorDescriptor(const Char_t *det) { - enum Limits {nlvMAX=15,nskMAX=20,nvMAX=20}; - static TString path; - return path.Data(); -} -//________________________________________________________________________________ -void StarMCHits::SetDebug(Int_t m) { - if (fDebug == m) return; - fDebug = m; - if (gMC && gMC->IsA()->InheritsFrom("TGeant3TGeo")) { - TGeant3TGeo *geant3 = (TGeant3TGeo *)gMC; - Gcflag_t* cflag = geant3->Gcflag(); - cflag->idebug = Debug(); - cflag->idemax = 10000; - cflag->iswit[0] = 2; - cflag->iswit[1] = 2; - } -} diff --git a/StarVMC/GeoTestMaker/StStepping.h.C b/StarVMC/GeoTestMaker/StStepping.h.C deleted file mode 100644 index c4d2d0371b7..00000000000 --- a/StarVMC/GeoTestMaker/StStepping.h.C +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef StarMCHits_h -#define StarMCHits_h -#include "StarVMCDetector.h" -#include "St_g2t_Chair.h" -#include "StarHitVector.h" - -class StarMCHits : public TDataSet { - public: - virtual ~StarMCHits() {SafeDelete(fDetList); SafeDelete(fVolUserInfo);} - static StarMCHits *instance(const Char_t *name="", - const Char_t *title="") { - if (fgInstance) return fgInstance; - return new StarMCHits(name, title); - } - virtual StarMCHits *Instance() const {return fgInstance;} - virtual Int_t Init(); - virtual void Clear(const Option_t* opt = ""); - virtual void Step(); -#if 0 - virtual Float_t GetHitK(Int_t k); -#endif - virtual void SetHitHolder(TDataSet *m) {fHitHolder = m;} - virtual void SetDebug(Int_t m=0); - virtual TDataSet *GetDetectors() {return fDetectors;} - virtual TObjArray *GetVolUserInfo() {return fVolUserInfo;} - virtual TDataSet *GetHitHolder() {return fHitHolder;} - virtual StarVMCDetector *GetCurrentDetector() {return fCurrentDetector;} - virtual void FillG2Table(); - virtual void FinishEvent(); - virtual Int_t Debug() { return fDebug;} - static void MakeDetectorDescriptors(); - static const Char_t *MakeDetectorDescriptor(const Char_t *det); - private: - StarMCHits(const Char_t *name="StarMCHits",const Char_t *title=""); - static StarMCHits *fgInstance; - GHit_t fHit; - TDataSet *fDetectors; - THashList *fDetList; - TObjArray *fVolUserInfo; - TDataSet *fHitHolder; - StarVMCDetector *fCurrentDetector; - Int_t fDebug; - UInt_t fSeed; - Int_t fEventNumber; - ClassDef(StarMCHits,1) -}; -#endif diff --git a/StarVMC/GeoTestMaker/StTGeoProxy.cxx b/StarVMC/GeoTestMaker/StTGeoProxy.cxx deleted file mode 100644 index f4b01dafab5..00000000000 --- a/StarVMC/GeoTestMaker/StTGeoProxy.cxx +++ /dev/null @@ -1,1740 +0,0 @@ -// $Id: StTGeoProxy.cxx,v 1.14 2017/05/02 19:36:28 perev Exp $ -// -// -// Class StTGeoProxy -// ------------------ - - - -#include -#include -#include -#include -#include -#include -#include -#include "TROOT.h" -#include "TString.h" -#include "TMath.h" -#include "TObjArray.h" -#include "TGeoManager.h" -#include "TGeoNavigator.h" -#include "TGeoNode.h" -#include "TGeoVolume.h" -#include "TGeoShape.h" -#include "TGeoBBox.h" -#include "TGeoTube.h" -#include "TGeoMatrix.h" -#include "TCernLib.h" -#include "TVector3.h" - -#include "StTGeoProxy.h" -#include "StMultiKeyMap.h" - -int StTGeoProxy::StTGeoProxy::fgKount[3] = {0}; - - -enum {kMaxVolId = 1000000}; - -//_____________________________________________________________________________ -int GetVoluId(const TGeoVolume *vol) -{ - return vol->GetNumber()+kMaxVolId*vol->GetUniqueID(); -} - -class myTVector3 : public TVector3 { - -public: - - - myTVector3(Double_t x = 0.0, Double_t y = 0.0, Double_t z = 0.0):TVector3(x,y,z){;} - // The constructor. - - myTVector3(const Double_t *d):TVector3(d){;} - myTVector3(const Float_t *f):TVector3(f){;} - // Constructors from an array - - operator TVector3 &() {return *(TVector3*)this;} - operator const TVector3 &() const {return *(TVector3*)this;} - // The copy constructor. - myTVector3(const TVector3 &v):TVector3(v){;} - // Assignment - myTVector3 & operator = (const TVector3 &v){ *((TVector3*)this)=v; return *this;} - myTVector3 & operator = (const myTVector3 &v){ *((TVector3*)this)=v; return *this;} - - myTVector3 & operator = (const double *d){ SetXYZ(d[0],d[1],d[2]); return *this;} - myTVector3 & operator = (const float *f){ SetXYZ(f[0],f[1],f[2]); return *this;} - - void Set(const Double_t *d){SetXYZ(d[0],d[1],d[2]);} - void Set(const Float_t *f){SetXYZ(f[0],f[1],f[2]);} - void Get( Double_t *d){d[0]=X();d[1]=Y();d[2]=Z();} - void Get( Float_t *f){f[0]=X();f[1]=Y();f[2]=Z();} - - - -const double* GetArrD() const { fD[0]=X();fD[0]=Y();fD[0]=Z(); return fD;} -const float* GetArrF() const { fF[0]=X();fF[0]=Y();fF[0]=Z(); return fF;} - -protected: -mutable double fD[3]; -mutable float fF[3]; - -}; - -#define DOT(a,b) (a[0]*b[0]+a[1]*b[1]+a[2]*b[2]) - -static StTGeoProxy *gStTGeoProxy=0; -typedef std::map myVoluMap ; - -ClassImp(StTGeoProxy) -ClassImp(StVoluInfo) -ClassImp(StHitPlaneInfo) -ClassImp(StHitPlane) -ClassImp(StHitTube ) - -enum EMEDIUM {kISVOL =0,kIFIELD=1,kFIELDM=2,kTMAXFD=3 - ,kSTEMAX=4,kDEEMAX=5,kEPSIL =6,kSTMIN =7}; - -struct myMap {int id; const char *name;}; -static myMap gMyMod[] = { -{kUnknownId ,"" }, -{kTpcId ,"TPCE" }, -{kSvtId ,"SVTT" }, -{kRichId ,"RICH" }, -{kFtpcWestId ,"FTPC" }, -{kFtpcEastId ,"FTPC" }, -{kTofId ,"BTOF" }, -{kCtbId ,"Ctb" }, -{kSsdId ,"SFMO" }, -{kBarrelEmcTowerId ,"CALB" }, -{kBarrelEmcPreShowerId ,"CALB" }, -{kBarrelSmdEtaStripId ,"CALB" }, -{kBarrelSmdPhiStripId ,"CALB" }, -{kEndcapEmcTowerId ,"ECAL" }, -{kEndcapEmcPreShowerId ,"ECAL" }, -{kEndcapSmdUStripId ,"ECAL" }, -{kEndcapSmdVStripId ,"ECAL" }, -{kZdcWestId ,"" }, -{kZdcEastId ,"" }, -{kMwpcWestId ,"" }, -{kMwpcEastId ,"" }, -{kPhmdCpvId ,"PHMD" }, -{kPhmdId ,"PHMD" }, -{kPxlId ,"PXMO" }, -{kIstId ,"IBMO" }, -{kFgtId ,"FGTM" }, -{kEtrId ,"ETRV" }, -{kFpdWestId ,"FBOX" }, -{kFpdEastId ,"FBOX" }, -{kFmsId ,"" }, -{kRpsId ,"" }, -{kMtdId ,"MMBL" }, -{kSstId ,"SFMO" }, -#ifdef kFtsIdentifier -{kFtsId ,"FTSM" }, -#endif -{0,0 }}; - -void myBreak(int i) -{ -static int iCatch=-999; - if (iCatch!=i) return; - printf("myBreak:iCatch=%d\n",i); -} -//_____________________________________________________________________________ -StTGeoProxy::StTGeoProxy() -{ - assert(!gStTGeoProxy); - gStTGeoProxy=this; - memset(fBeg,0,fEnd-fBeg); - fVoluInfoArr = new StVoluInfoMap; - fHitPlaneArr = new TObjArray(); - fOpt = 1; - fSeedHits = new StVoidArr(); - fAllHits = new StVoidArr(); -} -//_____________________________________________________________________________ -int StTGeoProxy::Load(const char *geo) -{ - if (gGeoManager) { // Geom already there - Warning("Load","TGeoManager(%s,%s) is already there" - ,gGeoManager->GetName(),gGeoManager->GetTitle()); - return -1; - } - TString ts("$STAR/StarDb/AgiGeometry/"); - ts+=geo; ts+=".h"; - int ierr=0; - Long_t ans = gROOT->Macro(ts, &ierr); if (ans){}; - assert(!ierr); - return ierr; -} -//_____________________________________________________________________________ -void StTGeoProxy::Init(int mode) -{ - fMode = mode; - InitInfo(); - ls("Sc"); - if (fMode&2) InitHitPlane(); -// if (fMode&1) InitHitShape(); -} -//_____________________________________________________________________________ -void StTGeoProxy::InitLayers(StDetectorId did) -{ - StvSetLayer sl; - Edit(did,&sl); -} -//_____________________________________________________________________________ -void StTGeoProxy::Finish() -{ -// Avoid deleting of TGeoManager - gGeoManager = 0; -} -//_____________________________________________________________________________ -void StTGeoProxy::InitInfo() -{ - gGeoManager->CdTop(); - std::map moduMap; - StTGeoIter it; - it.Print("StTGeoProxy_Init"); - const TGeoVolume *vol= *it; - StVoluInfo *myModu=0; - for (;(vol=*it);++it) { - vol->GetShape()->ComputeBBox(); - int volId = ::GetVoluId(vol); -// First visit - if (it.IsFirst()) { //First visit -// Recognize module -// Check for MODULE - do { - myModu = 0; - if (!IsModule(vol) && !it.IsOmule()) break; - StVoluInfo *ext = SetFlag(vol,StVoluInfo::kModule); - if (DetId(vol->GetName())) ext->SetMODULE(); - assert(IsModule(vol)); - myModu = ext; -// printf("Module = %s(%d) ",vol->GetName(),volId); it.Print(0); - } while(0); - - if (myModu) continue; - if (!IsSensitive(vol)) continue; - for (int idx=1;1;idx++) { - const TGeoVolume *myVolu = it.GetVolu(idx); - if (!myVolu) break; - StVoluInfo *inf = IsModule(myVolu); - if (!inf) continue; - inf->AddSens(); break; - } - } - - - if (it.IsLast()) { //Last visit - -// Define for MODULE (capital letters, module with hits) - myModu = IsModule(vol); - if (!myModu) continue; - if (!myModu->GetSens()) {// Module without hits or not active now - if (!(moduMap[volId])) {//first time - printf("Module = %s(%d) ",vol->GetName(),volId); it.Print(0); - moduMap[volId]++; - } - } else {// Module with hits. It is MODULE - SetFlag(vol,StVoluInfo::kHitted); - TString ts = (IsActive(vol))? "*":" "; - printf("MODULE%s= %s(%d) Sens=%d",ts.Data(),vol->GetName(),volId,myModu->GetSens()); - it.Print(0); - } - - } - } - - - - - -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::SetModule (const char *voluName, int akt) -{ - const char *volName = voluName; - StDetectorId did = DetId(volName); - if (did) volName = ModName(did); - TGeoVolume *vol = gGeoManager->FindVolumeFast(volName); - if (!vol) { Warning("SetModule","Volume %s Not Found",voluName);return 0;} - - StVoluInfo *info = SetFlag(vol,StVoluInfo::kModule,akt); - if (did) info->SetMODULE(); - return info; -} -//_____________________________________________________________________________ -int StTGeoProxy::SetActive (const char *voluName, int akt,StActorFunctor *af) -{ - StVoluInfo *inf = SetModule(voluName,1); - if (!inf) return 0; - inf->SetBit(StVoluInfo::kActive,akt); - int n = 1; - if (!akt) {inf->SetActiveFunctor(0); return 1;} - inf->SetActiveFunctor(af); - -// Now care about all parents. They should be active as well - StTGeoIter it; - const TGeoVolume *vol=0; - for (;(vol=*it);++it) { - if (strcmp(voluName,vol->GetName()))continue; - if (!it.IsFirst()) continue; //Not a First visit - const TGeoVolume *myVol ; - for ( int idx=1; (myVol = it.GetVolu(idx));idx++) { - if (IsActive(myVol)) continue; - n+=SetActive(myVol->GetName(),1,0); - } - } - return 1; -} -//_____________________________________________________________________________ -int StTGeoProxy::SetActive (StDetectorId did,int akt,StActorFunctor *af) -{ - const char *modu = ModName(did); - if (!*modu) { Warning("SetActive","DetId %d Unknown",did);return 0;} - if (af) af->SetDetId(did); - int n = SetActive(modu,akt,af); -//??? if (n) return 0; - Long64_t mask = 1; mask = mask<<(int)did; - if (akt) { fActiveModu |= mask; } - else { fActiveModu &= ~mask; } -//??? return n; - return 1; -} -//_____________________________________________________________________________ -int StTGeoProxy::IsActive (StDetectorId did) const -{ - return ((fActiveModu & ((Long64_t)1)<Kind(); - if (flg >= StVoluInfo::kHitPlane) kase += 10; - switch (kase) { - case 0: inf = new StVoluInfo( volId); break; - case 10: ; - case StVoluInfo::kVoluInfo+10: inf = new StHitPlaneInfo(volId); break; - } - SetInfo(inf); inf->SetBit(flg,act); - return inf; -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::IsFlag(const TGeoVolume *volu,StVoluInfo::E_VoluInfo flg) const -{ - int volId = ::GetVoluId(volu); - StVoluInfo *inf = GetInfo(volId); - if (!inf ) return 0; - - if(inf->TestBit(flg)==0) return 0; - return inf; -} -//_____________________________________________________________________________ -int StTGeoProxy::Edit(StDetectorId did,StActorFunctor *af) -{ - - StTGeoIter it; - StDetectorId detId=kUnknownId; - int nEdit=0; - const TGeoVolume *vol=0,*myModu=0; - for (;(vol=*it);++it) { - - if ( it.IsLast() && (vol == myModu)) myModu=0; - if (!it.IsFirst()) {continue;} //First visit only - StVoluInfo *inf = IsModule(vol); - if (inf) { - if (!IsActive(vol)) {myModu=0; it.Skip(); continue;} - detId = DetId(vol->GetName()); - if (!detId) { continue;} - if (!did ) {myModu =vol; continue;} - if (did != detId) {myModu=0; it.Skip(); continue;} - myModu =vol; - } - if (!myModu) continue; - const char *path = it.GetPath(); - gGeoManager->cd(path); - af->SetDetId(detId); - int ans = (*af)(); - if (ans>0) nEdit++; - } - return nEdit; -} -//_____________________________________________________________________________ -void StTGeoProxy::InitHitShape() -{ - - fHitShape = new StTGeoHitShape(); - for (int pass=0;pass<2;pass++) { - StTGeoIter it; - for (const TGeoVolume *vol=0;(vol=*it);++it) { - vol->GetShape()->ComputeBBox(); - // First visit - if (!it.IsFirst()) continue; //First visit only - - if(IsModule(vol) && !IsActive(vol)) {it.Skip();continue;} - // Update HitShape - if (!IsSensitive(vol)) continue; - if (!IsHitPlane(vol) ) continue; - - double global[8][3],local[3],D[3]; - TGeoBBox *bb = (TGeoBBox*)vol->GetShape(); - bb->ComputeBBox(); - const double *ori = bb->GetOrigin(); - D[0] = bb->GetDX(); - D[1] = bb->GetDY(); - D[2] = bb->GetDZ(); - for (int jk=0;jk<8;jk++) { - for (int ix=0,im=1; ix<3; ix++,im<<=1) { - local[ix] = ori[ix] + D[ix]* ((!!(jk&im))*2 -1);} - it.LocalToMaster(local,global[jk]); - } - double z1 = 3e33, z2 = -3e33; - double rMax = 0; - for (int jk=0;jk<8;jk++) { - if (z1 > global[jk][2]) z1 = global[jk][2]; - if (z2 < global[jk][2]) z2 = global[jk][2]; - double r2 = pow(global[jk][0],2)+pow(global[jk][1],2); - if (rMaxUpdate(z1,z2,0);} - else { - fHitShape->Update(z1,z2,rMax); - fHitShape->Update(z1,z2,0.1);// It is a HACK (VP) - } - } - } - fHitShape->Smooth(-100,100); - fHitShape->Print(); - -} -//_____________________________________________________________________________ -void StTGeoProxy::InitHitPlane(StActorFunctor *act) -{ - StTGeoIter it; - StDetectorId detId=kUnknownId; - const TGeoVolume *vol=0; - for (;(vol=*it);++it) { //Loop to create StHitPlaneInfo for sensitive & active volumes - if (!it.IsFirst()) {continue;} //First visit only - if (IsModule(vol)) { - if (!IsActive(vol)) {it.Skip();continue;} - detId = DetId(vol->GetName()); - if (!detId) continue;; - } - vol->GetShape()->ComputeBBox(); -// First visit -// try to make HitPlaneInfo - if(!IsSensitive(vol)) continue; - StHitPlaneInfo *hpi = MakeHitPlaneInfo(it); - hpi->SetDetId(detId); - } - - it.Reset(); - detId=kUnknownId; - for (;(vol=*it);++it) { - if (!it.IsFirst()) {continue;} //First visit only - if (IsModule(vol)) { - if (!IsActive(vol)) {it.Skip();continue;} - detId = DetId(vol->GetName()); - if(!detId) continue; - } - if(!IsSensitive(vol)) continue; - StHitPlaneInfo *hpi = IsHitPlane(vol); - if (!hpi) continue; - StHitPlane *hp = hpi->MakeHitPlane(it,act); - if(!hp) continue; - hp->SetDetId(detId); - - } - -} -//_____________________________________________________________________________ -int StTGeoProxy::SetHitErrCalc(StDetectorId modId,TNamed *hitErrCalc - ,StActorFunctor *sel) - -{ - assert(IsActive(modId)); - const char *modu = ModName(modId); - assert(modu); - int kount=0; - TGeoVolume *moduVol = gGeoManager->FindVolumeFast(modu); - if (!moduVol) return 0; - StTGeoIter it; - const TGeoVolume *vol=0; - - for (;(vol=*it);++it) { if (vol==moduVol) break;} - - if (!vol) return 0; - if (!IsMODULE(vol)) return 0; - if (!IsActive(vol)) return 0; - ++it; - - for (;(vol=*it);++it) { - if (vol==moduVol && (it.IsFirst() || it.IsLast())) break; - if (!it.IsFirst()) continue; - if (!IsSensitive(vol)) continue; - StHitPlaneInfo* hpi = IsHitPlane(vol); - if (!hpi) continue; - StHitPlane* hp = hpi->GetHitPlane (it.GetPath()); - if (!hp) continue; - if (hp->GetHitErrCalc()==hitErrCalc) continue; - - if (sel) {//check selector - gGeoManager->cd(it.GetPath()); - sel->SetDetId(modId); - if (!sel->Operator(hp->GetPnt())) continue; - } - hp->SetHitErrCalc(hitErrCalc); - kount++; - } - return kount; -} -//_____________________________________________________________________________ -StTGeoProxy::~StTGeoProxy() -{ - delete fVoluInfoArr; -} -//_____________________________________________________________________________ -StTGeoProxy *StTGeoProxy::Instance() -{ - if (!gStTGeoProxy) gStTGeoProxy = new StTGeoProxy; - return gStTGeoProxy; -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::GetInfo(int idx) const -{ - StVoluInfoMapIter it = fVoluInfoArr->find(idx); - if (it == fVoluInfoArr->end()) return 0; - return (*it).second; -} -//_____________________________________________________________________________ -StVoluInfo *&StTGeoProxy::GetINFO(int idx) -{ - StVoluInfo *&inf = (*fVoluInfoArr)[idx]; - if (inf) return inf; - inf = new StVoluInfo(idx); - return inf; -} -//_____________________________________________________________________________ -void StTGeoProxy::SetInfo(StVoluInfo* ext) -{ - int volId = ext->GetVoluId(); - StVoluInfo *&inf = (*fVoluInfoArr)[volId]; - if (inf==ext) return; - if (inf) delete inf; - inf = ext; -} -//_____________________________________________________________________________ -void StTGeoProxy::AddHitPlane(StHitPlane* pla) -{ - fHitPlaneArr->Add(pla); -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::IsModule(const TGeoVolume *volu) const -{ - int id = ::GetVoluId(volu); - StVoluInfo *ext = GetInfo(id); - if (!ext) return 0; - if (!ext->IsModule()) return 0; - return ext; -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::IsMODULE(const TGeoVolume *volu) const -{ - int id = ::GetVoluId(volu); - StVoluInfo *ext = GetInfo(id); - if (!ext) return 0; - if (!ext->IsMODULE()) return 0; - return ext; -} -//_____________________________________________________________________________ -StVoluInfo *StTGeoProxy::IsModule(const TGeoNode *node) const -{ return IsModule(node->GetVolume()); } -//_____________________________________________________________________________ -StHitPlaneInfo* StTGeoProxy::IsHitPlane(const TGeoVolume *volu) const -{ - int id = ::GetVoluId(volu); - StVoluInfo *ext = GetInfo(id); - if (!ext) return 0; - if (!ext->IsHitPlane()) return 0; - return (StHitPlaneInfo*)ext; -} -//_____________________________________________________________________________ -StHitPlaneInfo* StTGeoProxy::IsHitPlane(const TGeoNode *node) const -{ return IsHitPlane(node->GetVolume()); } - -//_____________________________________________________________________________ -int StTGeoProxy::MayHitPlane(const TGeoVolume *volu) const -{ - enum {kHow=4}; - - const TGeoShape* sh=volu->GetShape() ; - if (!sh) return -1; - if (!sh->IsValidBox()) return -1; - int myKode=0; - int kase = sh->IsCylType() ; - switch (kase) { - case 0://Plane case - { - const TGeoBBox *bb = (const TGeoBBox*)sh; - double dd[3]={bb->GetDX(),bb->GetDY(),bb->GetDZ()}; - int jMin =0,jMax=0,jMed=0; - for (int j=1;j<3;j++) { if (dd[j]dd[jMax]) jMax=j;} - for (int j=1;j<3;j++) { if (j==jMin) continue;if (j==jMax) continue;jMed=j;} - myKode = (jMin+1)+ 10*(jMed+1) + 100*(jMax+1); - if (dd[jMin]*kHow>dd[jMed]) myKode = 0; - break; - } - case 1: //Tube case - { - double par[9]; - sh->GetBoundingCylinder(par); - const TGeoBBox *bb = (const TGeoBBox*)sh; - par[4] = bb->GetDZ(); - par[0] = sqrt(par[0]); - par[1] = sqrt(par[1]); - if ((par[1]-par[0])*kHow < (2*par[4])) myKode = 4; //thin walls - if ((par[1]-par[0]) > kHow*(2*par[4])) myKode = 123; //disk - } - } - return myKode; -} -//_____________________________________________________________________________ -StHitPlaneInfo *StTGeoProxy::MakeHitPlaneInfo(const StTGeoIter &it) -{ -static int nCall=0; nCall++; - - const TGeoVolume *myVolu = *it; - if (!IsSensitive(myVolu)) return 0; - const TGeoVolume *volu=0; - StHitPlaneInfo *bhp=0; - for (int up=0;(volu=it.GetVolu(up));up++) { - - int ax = MayHitPlane(volu); - if (ax<0) continue; - - const TGeoShape *sh = volu->GetShape(); - const TGeoBBox *bb = (const TGeoBBox*)sh; - int iv = ::GetVoluId(volu); - StVoluInfo *ext = GetInfo(iv); - int kase = 0; - if (ext) kase = ext->Kind(); - switch(kase) { - - case 0: //no extention - case 1: {//basic extention - bhp = new StHitPlaneInfo(iv); - if (ext) *bhp = *ext; - bhp->SetHitPlane(); - bhp->SetAxis(ax); - TCL::ucopy(bb->GetOrigin(),bhp->fOrg,3); - MakeDir(ax,bhp->fDir); - SetInfo(bhp); - break;} - - case 2: //HitPlane extention - bhp = (StHitPlaneInfo*)ext; - break; - default: assert(0 && " Wrong kind of StVoluInfo"); - } - break; - } - if (bhp) return bhp; - printf(" ***Warning: HitPlane not found for:"); it.Print(0); - return 0; -} -//_____________________________________________________________________________ -int StTGeoProxy::MakeDir(int kode, float dir[3][3]) -{ - memset(dir[0],0,sizeof(dir[0][0])*3*3); - - int ax1 = (kode%10); - if (ax1>0 && ax1<=3) { - myTVector3 myDir[3]; - myDir[0][((kode )%10)-1]=1; - myDir[2][((kode/100)%10)-1]=1; - myDir[1] = myDir[2].Cross(myDir[0]); - for (int i=0;i<3;i++) {myDir[i].Get(dir[i]);} - }else if(ax1==4) { - for (int jk=0;jk<3;jk++){dir[jk][jk]=1;} - - }else {;} - - return 0; -} -//_____________________________________________________________________________ -void StTGeoProxy::Summary() -{ - int np = StTGeoProxy::fgKount[2]; - int nh = StTGeoProxy::fgKount[1]; - int ni = StTGeoProxy::fgKount[0]-nh; - printf("/nStTGeoProxy::Summary() Info=%d HitPlaneInfo=%d HitPlane=%d created\n\n",ni,nh,np); -} - -//_____________________________________________________________________________ -void StHitPlane::SetLayer() -{ - static StTGeoProxy *tg = StTGeoProxy::Inst(); - const float *pnt = GetPnt(); - double myPnd[3]={pnt[0],pnt[1],pnt[2]}; - const float *dir = GetDir(pnt)[0]; - double myDir[3] = {-dir[0],-dir[1],-dir[2]}; - assert(DOT(myPnd,myDir)<0); - - fNex = tg->Look(100,myPnd,myDir); - assert(fNex>1e-2); -} -//_____________________________________________________________________________ -int StTGeoProxy::IsSensitive(const TGeoVolume *volu) -{ - if (!volu) volu = gGeoManager->GetCurrentVolume(); - const TGeoMedium *tm = volu->GetMedium(); - if (!tm) return 0; - return (tm->GetParam(kISVOL)>0.); -} -//_____________________________________________________________________________ -const TGeoVolume *StTGeoProxy::GetModu() const -{ - for (int i=0;1;i++) { - TGeoNode *n = gGeoManager->GetMother(i); - if(!n) break; - TGeoVolume *v=n->GetVolume(); - if (!v) continue; - if (IsModule(v)) return v; - } - return 0; -} -//_____________________________________________________________________________ -const TGeoVolume *StTGeoProxy::GetVolu() const -{ - return gGeoManager->GetCurrentVolume(); -} -//_____________________________________________________________________________ -void StTGeoProxy::Print(const char *tit) const -{ - TGeoVolume *v=0; - if (tit) printf("StTGeoProxy::Print(%s)\n\n",tit); - for (int i=gGeoManager->GetLevel();i>=0;i--) { - TGeoNode *n = gGeoManager->GetMother(i); - if(!n) break; - v=n->GetVolume(); - if (!v) continue; - printf("/%s#%d",v->GetName(),n->GetNumber()); - } - if (v && v->GetMaterial()) { - printf("(%s)",v->GetMaterial()->GetName()); - if (IsSensitive(v)) printf("*"); - } - printf("\n"); - -} -//_____________________________________________________________________________ -void StTGeoProxy::ls(const char *opt) const -{ -static int nCall=0;nCall++; -static const char *types[]={"Dead","MODU","Modu","HitP","Sens","Actv"}; - int opta = strstr(opt,"a")!=0; //print all - int optm = strstr(opt,"m")!=0; //module - int optM = strstr(opt,"M")!=0; //MODULE - int opts = strstr(opt,"s")!=0; //senitive - int optp = strstr(opt,"p")!=0; //Hit Plane - int optc = strstr(opt,"c")!=0; //Count summary - int optS = strstr(opt,"S")!=0; //Silent, only summary - int optA = strstr(opt,"A")!=0; //only Active in summary - if (optc) opts=1; - std::map myMap; - std::string myName; - - StTGeoIter it; - const TGeoVolume *vol= *it; - int num=0; - for (;(vol=*it);++it) { - if (!it.IsFirst()) continue; -// int volId = ::GetVoluId(vol); - int jk = 0; - StHitPlaneInfo *ghp=0; - do { - if (optM && IsMODULE (vol)) {jk=1;break;} - if (optm && IsModule (vol)) {jk=2;break;} - if (optp && (ghp=IsHitPlane(vol))){jk=3;break;} - if (opts && IsSensitive(vol)) {jk=4; - if (IsActive(vol)) jk=5;break;} - } while (0); - if (!opta && !jk) continue; - num++; - if (optc) {//collect summary - myName = vol->GetName(); - myName+='.'; myName+=types[jk][0]; - myMap[myName]+=1; - } - if (optS) continue; - TString path(it.GetPath()); - const TGeoShape *sh = vol->GetShape(); - const TGeoMedium *me = vol->GetMedium(); - const TGeoMaterial *ma = (me)? me->GetMaterial():0; - const char *maName = (ma)? ma->GetName(): ""; - printf("%3d - %s(%s",num,vol->GetName(),types[jk]); - if (ghp) { - StHitPlane *hp = ghp->GetHitPlane(path); - if (!hp) { - path+=" Not Found"; ghp->Print(path.Data());} - assert(hp); - printf("#%d",hp->GetNHits()); - } - - - printf(",%s,%s)\t %s" - ,sh->ClassName()+4 - ,maName,path.Data()); - - printf("\n"); - } - if (myName.empty()) return; - - int nTot=0,line=0; - printf("lsSummary:\n"); - for (auto it = myMap.begin(); it !=myMap.end(); ++it) { - const char *name = (*it).first.c_str(); - if (optA && !strstr(name,".A")) continue; - int n = (*it).second; nTot+=n; - line++; - printf("%d - %s \t%d\n",line,name,n); - } - printf("%s \t%d\n","InTot",nTot); - -} -//_____________________________________________________________________________ -const char *StTGeoProxy::GetPath() const -{ - return gGeoManager->GetPath(); -} -//_____________________________________________________________________________ -void StTGeoProxy::Test() -{ - gROOT->Macro("$STAR/StarDb/AgiGeometry/y2009.h"); - StTGeoProxy &hlp = *StTGeoProxy::Instance(); - hlp.Init(1+2); -// hlp.ls("p"); - StTGeoIter it; - const TGeoVolume *vol= 0; - int num=0; - hlp.ClearHits(); - for (;(vol=*it);++it) { - if (!it.IsFirst()) continue; - StHitPlaneInfo *hpi = hlp.IsHitPlane(vol); - if (!hpi) continue; - TString path(it.GetPath()); - StHitPlane *hp = hpi->GetHitPlane(path); - assert(hp); - num++; - hlp.AddHit((void*)hp,hp->GetDetId(),hp->GetPnt(),num,1); - } - hlp.InitHits(); - hlp.ls("p"); -} -//_____________________________________________________________________________ -void StTGeoProxy::Break(int kase) -{ -static int myKase = -2009; -if (kase!=myKase) return; -printf("Break(%d)\n",kase); -} -//_____________________________________________________________________________ -const StHitPlane *StTGeoProxy::AddHit(void *hit,StDetectorId detId,const float xyz[3],unsigned int hardw,int seed) -{ -static int nCall = 0; nCall++; -// Test of hardware id assignment quality -enum {kMaxTest=1000,kMaxFail=100}; -// -// Break(nCall); - fDetId = detId; - StHitPlane *hp=0,*hpGeo=0; - fGoodHit = 0; - if (fHitLoadActor) fHitLoadActor->SetHit(hit); - hpGeo = FindHitPlane(xyz,fGoodHit); - if (!hpGeo) { - if (fGoodHit) return 0; //Hit rejected - double pnt[3]={xyz[0],xyz[1],xyz[2]}; - gGeoManager->SetCurrentPoint(pnt); - Warning("AddHit","Hit(%g,%g,%g) in %s Not Found",pnt[0],pnt[1],pnt[2],GetPath()); - return 0; - } - hp = hpGeo; - assert(hp); - assert(hp->GetDetId() == detId); - - fAllHits->push_back(hit); - if (seed) {//add to seed hit collection - fSeedHits->push_back(hit); - } - hp->AddHit(hit,xyz); -//printf("Hit(%g %g %g) added to %s\n",xyz[0],xyz[1],xyz[2],hp->GetName()); - - if (hp->GetNHits()==1) AddHitPlane(hp); - - - return hp; -} -//_____________________________________________________________________________ -StHitPlane *StTGeoProxy::FindHitPlane(const float xyz[3],int &sure) -{ -// cos(a+b) = cos(a)*cos(b) - sin(a)*sin(b) -// sin(a+b) = cos(a)*sin(b) + sin(a)*cos(b) -static const float dirs[][3] = { -{ 0.0000, 0.0000, 1.0000 }, // 1 -{ 0.5000, 0.0000, 0.8660 }, // 2 -{ 0.2500, 0.4330, 0.8660 }, // 3 -{-0.2500, 0.4330, 0.8660 }, // 4 -{-0.5000, 0.0000, 0.8660 }, // 5 -{-0.2500, -0.4330, 0.8660 }, // 6 -{ 0.2500, -0.4330, 0.8660 }, // 7 -{ 0.8660, 0.0000, 0.5000 }, // 8 -{ 0.7344, 0.4589, 0.5000 }, // 9 -{ 0.3796, 0.7784, 0.5000 }, //10 -{-0.0905, 0.8613, 0.5000 }, //11 -{-0.5332, 0.6824, 0.5000 }, //12 -{-0.8138, 0.2962, 0.5000 }, //13 -{-0.8471, -0.1801, 0.5000 }, //14 -{-0.6230, -0.6016, 0.5000 }, //15 -{-0.2095, -0.8403, 0.5000 }, //16 -{ 0.2676, -0.8236, 0.5000 }, //17 -{ 0.6634, -0.5567, 0.5000 }, //18 -{ 0.8576, -0.1205, 0.5000 }, //19 -{ 1.0000, 0.0000, 0.0000 }, //20 -{ 0.8660, 0.5000, 0.0000 }, //21 -{ 0.5000, 0.8660, 0.0000 }, //22 -{ 0.0000, 1.0000, 0.0000 }, //23 -{-0.5000, 0.8660, 0.0000 }, //24 -{-0.8660, 0.5000, 0.0000 }, //25 -{-1.0000, 0.0000, 0.0000 }, //26 -{-0.8660, -0.5000, 0.0000 }, //27 -{-0.5000, -0.8660, 0.0000 }, //28 -{-0.0000, -1.0000, 0.0000 }, //29 -{ 0.5000, -0.8660, 0.0000 }, //30 -{ 0.8660, -0.5000, 0.0000 }, //31 -{ 0.8660, 0.0000, -0.5000 }, //32 -{ 0.7344, 0.4589, -0.5000 }, //33 -{ 0.3796, 0.7784, -0.5000 }, //34 -{-0.0905, 0.8613, -0.5000 }, //35 -{-0.5332, 0.6824, -0.5000 }, //36 -{-0.8138, 0.2962, -0.5000 }, //37 -{-0.8471, -0.1801, -0.5000 }, //38 -{-0.6230, -0.6016, -0.5000 }, //39 -{-0.2095, -0.8403, -0.5000 }, //40 -{ 0.2676, -0.8236, -0.5000 }, //41 -{ 0.6634, -0.5567, -0.5000 }, //42 -{ 0.8576, -0.1205, -0.5000 }, //43 -{ 0.5000, 0.0000, -0.8660 }, //44 -{ 0.2500, 0.4330, -0.8660 }, //45 -{-0.2500, 0.4330, -0.8660 }, //46 -{-0.5000, 0.0000, -0.8660 }, //47 -{-0.2500, -0.4330, -0.8660 }, //48 -{ 0.2500, -0.4330, -0.8660 }, //49 -{ 0.0000, 0.0000, -1.0000 }}; //50 - -enum {kNDIRS = sizeof(dirs)/(3*sizeof(**dirs))}; - -static int nCall=0; nCall++; - double pnt[3]={xyz[0],xyz[1],xyz[2]}; - const TGeoNode *node = gGeoManager->FindNode(pnt[0],pnt[1],pnt[2]); - if (fHitLoadActor) { - int act = (*fHitLoadActor)(pnt); - if (act) node = gGeoManager->GetCurrentNode(); - } - assert(node); - StHitPlane *hp = GetCurrentHitPlane(); - sure = 1; - if (hp && hp->GetHitErrCalc() && IsHitted(pnt)) return hp; - -// volume is sensitive but not active but still sure - if (hp) return 0; - sure = 0; - double Rxy = sqrt(pnt[0]*pnt[0]+pnt[1]*pnt[1]); - double myCos= pnt[0]/Rxy,mySin=pnt[1]/Rxy; - double myDir[3]; - double minDist=(fabs(xyz[0])+fabs(xyz[1]))/10+5; - StHitPlane *minHitPlane=0; - for (int idir=0;idirSetCurrentPoint(pnt); - node = gGeoManager->FindNode(); - myDir[0] = dirs[idir][0]*myCos - dirs[idir][1]*mySin; - myDir[1] = dirs[idir][0]*mySin + dirs[idir][1]*myCos; - myDir[2] = dirs[idir][2]; - double myStep = Look(minDist,pnt,myDir); - if (myStep > minDist) continue; - hp = GetCurrentHitPlane(); - if (!hp ) continue; - if (!hp->GetHitErrCalc()) continue; - if (!IsHitted(gGeoManager->GetLastPoint())) continue; - if (fDetId != hp->GetDetId()) continue; - minDist = myStep; minHitPlane = hp; - } - return minHitPlane; -} - -//_____________________________________________________________________________ -StHitPlane *StTGeoProxy::GetCurrentHitPlane () -{ - const TGeoNode *node = 0; - const StHitPlaneInfo *inf=0; - TString path(gGeoManager->GetPath()); - int inc=0; - for (; inc<=3; inc++) { - node = gGeoManager->GetMother(inc); - if (!node) return 0; - inf = IsHitPlane(node); - if (inf) break; - } - if (!inf) return 0; - for (int jnc = 1; jnc<=inc; jnc++) {gGeoManager->CdUp();} - path=gGeoManager->GetPath(); - StHitPlane *hp= inf->GetHitPlane(path); - return hp; -} -//_____________________________________________________________________________ -void StTGeoProxy::ClearHits() -{ - fAllHits->clear(); - fSeedHits->clear(); - int n = fHitPlaneArr->GetLast()+1; - for (int i=0;iAt(i); - hp->Clear(); - } - fHitPlaneArr->Clear(); -} -//_____________________________________________________________________________ -void StTGeoProxy::Clear(const char *) -{ - ClearHits(); -} -//_____________________________________________________________________________ -int StTGeoProxy::InitHits() -{ - - int n = fHitPlaneArr->GetLast()+1; - int nHits = 0; - for (int i=0;iAt(i); - nHits += hp->InitHits(); - } - return nHits; -} -//_____________________________________________________________________________ -StDetectorId StTGeoProxy::DetId(const char *detName) -{ - StDetectorId id = detectorIdByName(detName); - if (id) return id; - TString tDetName(detName); - for (int i = 0;gMyMod[i].name; i++) { - if (!tDetName.CompareTo(gMyMod[i].name,TString::kIgnoreCase)) - return (StDetectorId)gMyMod[i].id;} - return (StDetectorId)0; -} -//_____________________________________________________________________________ -const char *StTGeoProxy::DetName(StDetectorId detId) -{ - const char *det =detectorNameById(detId); - return det; -} -//_____________________________________________________________________________ -const char *StTGeoProxy::ModName(StDetectorId detId) -{ - for (int i = 0;gMyMod[i].name; i++) - { if (gMyMod[i].id==detId) return gMyMod[i].name;} - return ""; -} - -//_____________________________________________________________________________ -int StTGeoProxy::IsHitted(const double X[3]) const -{ - if (!IsSensitive()) return 0; - const TGeoVolume *mo = GetModu(); - if (!IsActive(mo)) return 0; - StVoluInfo *vi = GetInfo(::GetVoluId(mo)); - StActorFunctor *af = vi->GetActiveFunctor(); - if (!af) return 1; - return (*af)(X); -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -const char *StVoluInfo::GetName() const -{ - int volId = GetUniqueID(); - return (volId) ? gGeoManager->GetVolume(volId)->GetName():"NoName"; -} - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StHitPlaneInfo::StHitPlaneInfo(int volId) : StVoluInfo(volId) -{ - fAxi=0; - memset(fOrg,0,sizeof(fOrg)+sizeof(fDir)); - StTGeoProxy::fgKount[1]++; -} -//_____________________________________________________________________________ -StHitPlaneInfo::~StHitPlaneInfo() -{ - StTGeoProxy::fgKount[1]--; -} -//_____________________________________________________________________________ -StHitPlane *StHitPlaneInfo::MakeHitPlane(const StTGeoIter &it,StActorFunctor *act) -{ -static int nCall=0; nCall++; - const TGeoVolume *volu = *it; - const TGeoShape *sh = volu->GetShape(); - StHitPlane *hp=0; - StHitTube *ht=0; - TString path(it.GetPath()); - hp= (StHitPlane *)GetHitPlane(path); - if (hp) return 0; - - float gPos[3],lDir[3][3]; - it.LocalToMaster(fOrg, gPos); - memcpy(lDir[0],fDir[0],sizeof(fDir)); - int myAxi = fAxi; - if (act) { //Try to use functor - gGeoManager->cd(path); - act->SetDetId(GetDetId()); - int ax = act->Operator(gPos); - if (ax>0) { - myAxi = ax; - StTGeoProxy::MakeDir(ax,lDir); - } } - if (!myAxi) return 0; - - if ((myAxi%10)<=3) { - hp = new StHitPlane(path,::GetVoluId(volu)); - } else if ((myAxi%10)==4) { - StHitTube *ht = new StHitTube(path,::GetVoluId(volu)); hp = ht; - } - - fHitPlanePathMap[path] = hp; - const char *pa = (*(fHitPlanePathMap.find(path))).first; - hp->SetPath(pa); - - memcpy(hp->fOrg,gPos,sizeof(gPos)); - myTVector3 Vd[3],Vo(hp->fOrg); - int upd = 0; - for (int i=0;i<3;i++) { - it.LocalToMasterVect(lDir[i], hp->fDir[i]); Vd[i]=hp->fDir[i];} -// Check signature and try to fix - for(int i=0;i<3;i++){Vd[i]= hp->fDir[i];} - for(int iTry=0;iTry<2;iTry++) { - int iTst=0; - for(int i=0;i<3;i++){ - int j = (i+1)%3,k = (j+1)%3; - myTVector3 res = Vd[i].Cross(Vd[j]); - iTst+= ((Vd[k]-res).Mag()>1e-4); - } - if (!iTst) break; - assert(!iTry); - upd++; Vd[1]*=(-1.); - } - - if (Vd[0].Dot(Vo)<0) {upd++; // Rotate around local Z - for(int i=0;i<2;i++){Vd[i].Rotate(M_PI,Vd[2]);}} - - if (Vd[2][2]<0) {upd++; // Rotate around local X - for(int i=1;i<3;i++) {Vd[i].Rotate(M_PI,Vd[0]);}} - if (upd) { // Update - for(int i=0;i<3;i++){Vd[i].Get(hp->fDir[i]);}} - - if (ht) { - double par[9];float pnt[3]={0}; - sh->GetBoundingCylinder(par); - double rMed = (sqrt(par[0])+sqrt(par[1]))*0.5; - double pMed = 0.5*(par[2]+par[3])*M_PI/180; - pnt[0] = rMed*cos(pMed); - pnt[1] = rMed*sin(pMed); - it.LocalToMaster(pnt, ht->fPnt); - ht->fRmed = rMed; - } - -// Check - for(int i=0;i<3;i++){for(int j=0;j<3;j++) {Vd[i][j]= hp->fDir[i][j];}} - for(int i=0;i<3;i++){ - int j = (i+1)%3,k = (j+1)%3; - myTVector3 res = Vd[i].Cross(Vd[j]); - assert( (Vd[k]-res).Mag()<1e-4); - } - - return hp; -} -//_____________________________________________________________________________ -StHitPlane *StHitPlaneInfo::GetHitPlane (const TString &path) const -{ -static int nCall=0; nCall++; - StHitPlanePathMapIter it = fHitPlanePathMap.find(path); - if (it == fHitPlanePathMap.end()) {return 0;} - return (*it).second; -} -//_____________________________________________________________________________ -StHitPlane *StHitPlaneInfo::RemHitPlane (const TString &path) -{ - StHitPlanePathMap::iterator it = fHitPlanePathMap.find(path); - if (it == fHitPlanePathMap.end()) {return 0;} - StHitPlane *hp = (*it).second; - fHitPlanePathMap.erase(it); - return hp; -} -//_____________________________________________________________________________ -void StHitPlaneInfo::Print(const char* tit ) const -{ - printf("\nStHitPlaneInfo(%s) %s\n",GetName(),tit); - printf("fOrg: %g %g %g\n",fOrg[0],fOrg[1],fOrg[2]); - for (int i=0;i<3;i++) {; - printf("fDir[%d]: %g %g %g\n",i,fDir[i][0],fDir[i][1],fDir[i][2]);} - int njk = fHitPlanePathMap.size(); - printf("HitPlanes %d:\n",njk); - int j=0; - for (StHitPlanePathMapIter it =fHitPlanePathMap.begin(); - it!=fHitPlanePathMap.end();++it) {printf(" %3d - %s\n",j,(*it).first.Data());j++;} - printf("\n"); - -} -//_____________________________________________________________________________ -StHitPlane::StHitPlane(const char *path,int voluId): TNamed(path,"") -{ - memset(fBeg,0,fEnd-fBeg+1); - SetUniqueID(voluId); - fHitMap = new StMultiKeyMap(2); - StTGeoProxy::fgKount[2]++; -} -//_____________________________________________________________________________ -StHitPlane::~StHitPlane() -{ - StTGeoProxy::fgKount[2]--; - delete fHitMap;fHitMap = 0; -} -//_____________________________________________________________________________ -void StHitPlane::AddHit(void *hit,const float xyz[3]) -{ - float uv[3]; - ToLocal(xyz,uv); - fHitMap->Add(hit,uv+1); - -} -//_____________________________________________________________________________ -void StHitPlane::ToLocal(const float xyz[3],float uv[3]) const -{ - float x[3]; - TCL::vsub(xyz, GetOrg(xyz), x,3); - TCL::vmatl(GetDir(xyz)[0], x, uv, 3, 3); -} -//_____________________________________________________________________________ -int StHitPlane::GetNHits() const -{ -return (fHitMap)?fHitMap->Size():0; -} -//_____________________________________________________________________________ -int StHitPlane::InitHits() -{ - return fHitMap->MakeTree(); -} -//_____________________________________________________________________________ -void StHitPlane::Clear(const char*) -{ - fHitMap->Clear(); -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StHitTube::StHitTube(const char *path,int voluId): StHitPlane(path,voluId) -{ - memset(fBeg,0,fEnd-fBeg+1); -} -//_____________________________________________________________________________ -const Mtx33F_t &StHitTube::GetDir(const float *hit) const -{ -static float myDir[3][3]; - TCL::ucopy(fDir[2],myDir[2],3); - TCL::vsub(hit,fOrg,myDir[0],3); - float fak = TCL::vdot(myDir[0],fDir[2],3); - TCL::vlinco(myDir[0],1.,fDir[2],-fak,myDir[0],3); - fak = TCL::vdot(myDir[0],myDir[0],3); - fak = sqrt(fak); - TCL::vscale(myDir[0],1./fak,myDir[0],3); - TMath::Cross(fDir[2],myDir[0],myDir[1]); - return myDir; -} -//_____________________________________________________________________________ -const float *StHitTube::GetOrg(const float *hit) const -{ -static float myOrg[3]; - TCL::vsub(hit,fOrg,myOrg,3); - float fak = TCL::vdot(myOrg,myOrg,3); - TCL::vlinco(myOrg,fRmed/fak,fOrg,1.,myOrg,3); - return myOrg; -} - - -//_____________________________________________________________________________ - enum {kEND,kDOWN,kNEXT,kUPP}; -//_____________________________________________________________________________ -//_____________________________________________________________________________ - StTGeoIter::StTGeoIter() -{ - fNavi = new TGeoNavigator(gGeoManager); - fNavi->BuildCache(); - Reset(); -} -//_____________________________________________________________________________ -void StTGeoIter::Reset() -{ - fLev = 0; - fStk[0]=0; - fNavi->CdTop(); - fVolu = fNavi->GetCurrentVolume(); - fNow = 1; - fKase = kDOWN; - assert(fLev == fNavi->GetLevel()); -} -//_____________________________________________________________________________ - StTGeoIter::~StTGeoIter() -{ delete fNavi; fNavi = 0;} - -//_____________________________________________________________________________ -StTGeoIter &StTGeoIter::Down() -{ - fKase = kDOWN; return ++(*this); -} -//_____________________________________________________________________________ -StTGeoIter &StTGeoIter::Next() -{ - fKase = kNEXT; return ++(*this); -} -//_____________________________________________________________________________ -StTGeoIter &StTGeoIter::Skip() -{ - fKase = kNEXT; return (*this); -} -//_____________________________________________________________________________ -StTGeoIter &StTGeoIter::Upp() -{ - fKase = kUPP; return ++(*this); -} -//_____________________________________________________________________________ -StTGeoIter &StTGeoIter::operator++() -{ - int nKids; -CASE: - - switch (fKase) { - - case kEND: fVolu=0; fKase=kEND ; fNow=0; break; - - case kDOWN: { - nKids = fVolu->GetNdaughters(); - if (!nKids) { fKase=kNEXT; fNow=2; break;} - fNavi->CdDown(0); fLev++; - fStk[fLev]=0; - assert(fLev == fNavi->GetLevel()); - fVolu = fNavi->GetCurrentVolume(); - fKase=kDOWN; fNow=1; break;} - - case kNEXT: { - if (!fLev) { fVolu=0; fKase=kEND ; fNow=0; break;} - fNavi->CdUp(); fLev--; - assert(fLev == fNavi->GetLevel()); - fVolu = fNavi->GetCurrentVolume(); - nKids = fVolu->GetNdaughters(); - fStk[fLev]++; - if (fStk[fLev]>=nKids) { fKase=kNEXT ; fNow=2; break;} - fNavi->CdDown(fStk[fLev]);fLev++; fStk[fLev]=0; - assert(fLev == fNavi->GetLevel()); - fVolu = fNavi->GetCurrentVolume(); fKase=kDOWN ; fNow=1; break;} - - case kUPP: { - if (!fLev) {fVolu=0; fKase=kEND ; fNow=0; break;} -// TGeoNode *node = fNavi->GetCurrentNode(); - fNavi->CdUp(); fLev--; - fVolu = fNavi->GetCurrentVolume(); - assert(fLev == fNavi->GetLevel()); - fKase=kNEXT; goto CASE;} - } - - return *this; -} -//_____________________________________________________________________________ -const TGeoNode *StTGeoIter::GetNode(int idx) const -{ - return fNavi->GetMother(idx); -} -//_____________________________________________________________________________ -const TGeoHMatrix *StTGeoIter::GetMatr(int idx) const -{ - return fNavi->GetMotherMatrix(idx); -} - -//_____________________________________________________________________________ -const TGeoVolume *StTGeoIter::GetVolu(int idx) const -{ - if (!idx) return fVolu; - const TGeoNode *node = GetNode(idx); - if (!node) return 0; - return node->GetVolume(); -} -//_____________________________________________________________________________ -void StTGeoIter::Print(const char *tit) const -{ - const TGeoVolume *v =0; - if (tit) printf("\nStTGeoIter::Print(%s)\n\n",tit); - printf("%d ",fNow); - for (int l=0;l<=fLev;l++) { - v = GetVolu(fLev-l); - int iocc = (l) ? fStk[l-1]:0; - printf("/%s#%d",v->GetName(),iocc); - } - const TGeoMedium *tm = v->GetMedium(); - const TGeoMaterial *mat = (tm)? tm->GetMaterial():0; - const char* maName = (mat)? mat->GetName():""; - printf("(%s)",maName); - if (tm && tm->GetParam(kISVOL)>0.)printf("*"); - - v = GetVolu(0); - const TGeoShape* sh=v->GetShape() ; - if (sh && sh->IsCylType()) { - double dd[10]; - sh->GetBoundingCylinder(dd);dd[4] = ((const TGeoBBox*)sh)->GetDZ(); - printf(" // shape=%s R1=%g R2=%g Phi1=%g,Phi2=%g,dz=%g",sh->ClassName() - ,sqrt(dd[0]),sqrt(dd[1]),dd[2],dd[3],dd[4]); - - } else if (sh && sh->IsValidBox()) { - const TGeoBBox *bb = (const TGeoBBox*)sh; - double dd[3]={bb->GetDX(),bb->GetDY(),bb->GetDZ()}; - printf(" // shape=%s dx=%g dy=%g dz=%g",sh->ClassName(),dd[0],dd[1],dd[2]); - } - printf("\n"); - -} -//_____________________________________________________________________________ -const char *StTGeoIter::GetPath() const -{ - return fNavi->GetPath(); -} -//_____________________________________________________________________________ -void StTGeoIter::LocalToMaster(const double* local, double* master) const -{ fNavi->LocalToMaster(local,master);} -//_____________________________________________________________________________ -void StTGeoIter::LocalToMasterVect(const double* local, double* master) const -{ fNavi->LocalToMasterVect(local,master);} -//_____________________________________________________________________________ -void StTGeoIter::LocalToMaster(const float* local, float* master) const -{ - double d[6]; - TCL::ucopy(local,d,3); - fNavi->LocalToMaster(d,d+3); - TCL::ucopy(d+3,master,3); -} -//_____________________________________________________________________________ -void StTGeoIter::LocalToMasterVect(const float* local, float* master) const -{ - double d[6]; - TCL::ucopy(local,d,3); - fNavi->LocalToMasterVect(d,d+3); - TCL::ucopy(d+3,master,3); -} -//_____________________________________________________________________________ -int StTGeoIter::IsOmule() const //candidate to module -{ - assert(fVolu); - const TGeoVolume *vol=0; - int jk=0; - for (int ipar=1; (vol=GetVolu(ipar));ipar++) { - int nDau = vol->GetNdaughters(); - if (ipar==1) {jk |= (nDau==1)? 1:2;} - else {jk |= (nDau==1)? 4:8;} - } - return (jk==6); -} -//_____________________________________________________________________________ -const TGeoVolume *StTGeoProxy::FindModule(const char *patt) -{ - - const TGeoVolume *vol=0,*bestVolu=0; - int bestQua = -1000000; - for (StTGeoIter it;(vol=*it);++it) { - const char *name = vol->GetName(); - if (patt[0]!=name[0]) continue; - if (patt[1]!=name[1]) continue; - int n = 0; - for (;patt[n];n++) { if (name[n]!=patt[n]) break;} - if (n<3) continue; - if (it.GetLev()>5) continue; - int qua = n*100 - it.GetLev(); - if (qua <= bestQua) continue; - bestQua = qua; bestVolu = vol; - } - return bestVolu; -} -//_____________________________________________________________________________ -double StTGeoProxy::Look(double maxDist,const double pnt[3],const double dir[3]) -{ -// Search nearest sensitive volume in given direction. -// returns distance - double myPnt[3]={ pnt[0], pnt[1], pnt[2]}; - double myDir[3]={ dir[0], dir[1], dir[2]}; - - gGeoManager->SetCurrentPoint(myPnt); - const TGeoNode *node = gGeoManager->FindNode(); - if (!node) return 0; - gGeoManager->SetCurrentDirection(myDir); - TString prevPath(gGeoManager->GetPath()); - double myStep = 0,epsStp = 1e-4+maxDist*1e-3,minStp = epsStp,stp=0; - for (int istep=0;istep<100 ;istep++) { - node = gGeoManager->FindNextBoundaryAndStep(1.001*(maxDist-myStep)); - if (!node) break; - TString currPath(gGeoManager->GetPath()); - stp = gGeoManager->GetStep(); - int same = (currPath == prevPath); - if (stpGetCurrentPoint(); - for (int j=0;j<3;j++) { myPnt[j]=x[j]+myDir[j]*stp;} - gGeoManager->SetCurrentPoint(myPnt); - node = gGeoManager->FindNode(); - if (!node) break; - } - myStep +=stp; if (myStep>=maxDist) break; - if (same) continue; - - prevPath=currPath; minStp = epsStp; - if (!IsSensitive()) continue; - StHitPlaneInfo* inf = IsHitPlane(node) ; - if (!inf) continue; - StHitPlane *hp = inf->GetHitPlane(currPath); - if (hp) break; - } - return myStep; -} -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StVoluInfo::StVoluInfo(int voluNumber) -{ SetUniqueID(voluNumber); - fActiveFunctor=0; - fNSens = 0; - StTGeoProxy::fgKount[0]++; -} -//_____________________________________________________________________________ -StVoluInfo::~StVoluInfo() -{ - StTGeoProxy::fgKount[0]--; -} - -//_____________________________________________________________________________ -//_____________________________________________________________________________ -StTGeoHitShape::StTGeoHitShape() -{ - fZMin = 1e11; fZMax = -1e11; fRMin=1e11; fRMax = 0; - for (int i=0;iz1) fZMin=z1; - if (fZMax=fZMin && z1<=fZMax); - assert(z2>=fZMin && z2<=fZMax); - if (fRMin>rxy) fRMin=rxy; - if (fRMaxrxy) fRxy[jj][0]=rxy; - if(fRxy[jj][1]jVtx) {jl = jVtx+1;jr = jE -1;} - else {jl = jE +1;jr = jVtx-1;} - - if (jl>=jr) {jl = jE+1; jr = jVtx-1;} - assert(jlfRxy[j][1]) fRxy[j][1] = r; - } - rE = fRxy[jE][0]; - if (jE>jVtx) {jl = jE+1;jr = kNZ-1;} - else {jl = 0 ;jr = jE -1;} - for (int j=jl; j<=jr; j++) { - double r = rE/(jE-jVtx)*(j-jVtx); - if (rfRxy[j][1]) fRMinMax=fRxy[j][1]; - } - - -} -//_____________________________________________________________________________ -int StTGeoHitShape::Outside(double z,double rxy) const -{ - if (zfZMax) return 2; - if (rxy>fRMinMax && rxy=kNZ) jj=kNZ-1; - if (rxy > fRxy[jj][1]) return 5; - if (rxy < fRxy[jj][0]) return -6; - return 0; -} -//_____________________________________________________________________________ -void StTGeoHitShape::Get(double &zMin,double &zMax,double &rMax) const -{ - zMin = fZMin; zMax = fZMax; zMax = fRMax; -} -//_____________________________________________________________________________ -void StTGeoHitShape::Print(const char *) const -{ -printf("StTGeoHitShape::Print() Zmin = %g Zmax = %g Rmax = %g\n",fZMin,fZMax,fRMax); - for (int j=0;jGetMother(iLev); - copyNums[iLev] = 0; - if (!node) return 1; - copyNums[iLev] = node->GetNumber(); - if (!voluNams) continue; - voluNams[iLev] = node->GetVolume()->GetName(); - } - return 0; -} -//_____________________________________________________________________________ -const char* StActorFunctor::GetPath() const -{ - return gGeoManager->GetPath(); -} -//_____________________________________________________________________________ -const TGeoVolume *StActorFunctor::GetVolu() const -{ - return gGeoManager->GetCurrentVolume(); -} -//_____________________________________________________________________________ -const TGeoNode *StActorFunctor::GetNode() const -{ - return gGeoManager->GetCurrentNode(); -} -//_____________________________________________________________________________ -StVoluInfo *StActorFunctor::GetInfo() const -{ -static StTGeoProxy *tgp = StTGeoProxy::Inst(); -const TGeoVolume *v = tgp->GetVolu(); - int voluId = ::GetVoluId(v); - return tgp->GetInfo(voluId); -} -//_____________________________________________________________________________ -StHitPlaneInfo *StActorFunctor::GetHitPlaneInfo() const -{ -static StTGeoProxy *tgp = StTGeoProxy::Inst(); - const TGeoVolume *v = tgp->GetVolu(); - return tgp->IsHitPlane(v); -} -//_____________________________________________________________________________ -StHitPlane *StActorFunctor::GetHitPlane() const -{ -static StTGeoProxy *tgp = StTGeoProxy::Inst(); - return tgp->GetCurrentHitPlane(); -} -//______________________________________________________________________________ -StvSetLayer::StvSetLayer():StActorFunctor("SetLayer") -{ -} -//______________________________________________________________________________ -int StvSetLayer::operator()( const double *) -{ -static StTGeoProxy *tg = StTGeoProxy::Inst(); - if (!tg->IsSensitive()) return 0; - StHitPlane *hp =tg->GetCurrentHitPlane(); - if (!hp) return 0; - hp->SetLayer(); - return 1; -} - - - - - - - - - - - - - - - - - - - - - -//_____________________________________________________________________________ -//_____________________________________________________________________________ diff --git a/StarVMC/GeoTestMaker/StTGeoProxy.h b/StarVMC/GeoTestMaker/StTGeoProxy.h deleted file mode 100644 index 766c9bd3447..00000000000 --- a/StarVMC/GeoTestMaker/StTGeoProxy.h +++ /dev/null @@ -1,415 +0,0 @@ -// $Id: StTGeoProxy.h,v 1.9 2017/05/02 19:35:06 perev Exp $ -// -// -// Class StTGeoProxy -// ------------------ -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ - - -#ifndef ST_TGEOHELPER_H -#define ST_TGEOHELPER_H -#include -#include -#include "StEnumerations.h" -#include "TString.h" -#include "TNamed.h" -class TObjArray; -class TGeoNavigator; -class TGeoNode; -class TGeoVolume; -class TGeoMedium; -class TGeoMaterial; -class TGeoHMatrix; -class StVoluInfo; -class StTGeoHitShape; -class StTGeoIter; -class StHitPlaneInfo; -class StMultiKeyMap; -class StActorFunctor; - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -struct InvertLtStr -{ -bool operator()(const TString& s1, const TString& s2) const - { - int n1 = s1.Length(),n2 = s2.Length(); - if (n1 != n2) return n1=0; --j) {if (c1[j]!=c2[j]) return (c1[j] StHitPlaneHardMap; -typedef std::pair StHitPlaneHardPair; -typedef StHitPlaneHardMap::const_iterator StHitPlaneHardMapIter; - -class StVoluInfo; -typedef std::map< unsigned int, StVoluInfo*> StVoluInfoMap; -typedef StVoluInfoMap::const_iterator StVoluInfoMapIter; - - -class StVoidArr:public std::vector{}; - - -typedef std::map< const TString, StHitPlane*, InvertLtStr> StHitPlanePathMap; -typedef std::pair StHitPlanePathPair; -typedef StHitPlanePathMap::const_iterator StHitPlanePathMapIter; -typedef float Mtx33F_t[3][3]; - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StVoluInfo : public TObject -{ -public: -enum E_VoluInfo { - kModule = BIT(15), // The volume is a module - kMODULE = BIT(16), // The volume is a module,with ID like TPCE,SVTT - kActive = BIT(17), // The volume is active - kHitted = BIT(18), // The volume has hits under it - kHitPlane = BIT(19)}; // The volume is a Hit plane -public: -enum E_Kind { kVoluInfo=1,kHitPlaneInfo=2}; - - StVoluInfo(int voluNumber); -virtual ~StVoluInfo(); - int IsModule () const {return TestBit(kModule);} - int IsMODULE() const {return TestBit(kMODULE);} - int IsHitPlane() const {return TestBit(kHitPlane);} - int IsActive() const {return TestBit(kActive);} - void SetModule (int s=1) {SetBit(kModule,s) ;} - void SetMODULE (int s=1) {SetBit(kMODULE,s) ;} - void SetHitPlane(int s=1) {SetBit(kHitPlane,s) ;} - void SetActive (int s=1) {SetBit(kActive,s) ;} - void SetActiveFunctor(StActorFunctor *af) - {fActiveFunctor=af ;} - int GetVoluId() const {return GetUniqueID() ;} -const TGeoVolume* GetVolu() const; -const char *GetName() const; -StActorFunctor *GetActiveFunctor() {return fActiveFunctor ;} -virtual int Kind() const {return kVoluInfo ;} - void AddSens() {fNSens++; ;} - int GetSens() {return fNSens; ;} - -protected: -StActorFunctor *fActiveFunctor; -int fNSens; -ClassDef(StVoluInfo,0) // -}; - - - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StHitPlaneInfo : public StVoluInfo -{ -friend class StTGeoProxy; -public: - StHitPlaneInfo(int volId); -virtual ~StHitPlaneInfo(); -void operator=(const StVoluInfo& ext){*((StVoluInfo*)this)=ext;} - int Kind() const {return kHitPlaneInfo;} - int Axis() const {return fAxi;} -const Mtx33F_t &GetDir() const {return fDir;} -const float *GetOrg() const {return fOrg;} - StHitPlane *MakeHitPlane(const StTGeoIter &it,StActorFunctor *act=0); - StHitPlane *GetHitPlane (const TString &path) const; - StHitPlane *RemHitPlane (const TString &path); - void SetAxis(int axi) {fAxi=axi;} - void SetDetId(StDetectorId id) { fDetId=id;} - StDetectorId GetDetId() const { return fDetId;} -void Print(const char* opt="") const; -protected: -StDetectorId fDetId; -int fAxi; -float fOrg[3]; -float fDir[3][3]; -StHitPlanePathMap fHitPlanePathMap; -ClassDef(StHitPlaneInfo,0) // -}; - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StHitPlane : public TNamed -{ -friend class StTGeoProxy; -friend class StHitPlaneInfo; -public: - StHitPlane(const char *path, int volId); -virtual ~StHitPlane(); -void Clear(const char *opt=""); -int InitHits(); -void SetHitErrCalc(TNamed *hitErrCalc) {fHitErrCalc = hitErrCalc;} -TNamed *GetHitErrCalc() const {return (TNamed*)fHitErrCalc;} - -virtual const Mtx33F_t &GetDir(const float *) const {return fDir;} -virtual const float *GetOrg(const float *) const {return fOrg;} -virtual const float *GetPnt() const {return fOrg;} -virtual void AddHit(void *hit,const float xyz[3]); -virtual int Kind() const {return 0;} - int GetVoluId() {return GetUniqueID(); } - void ToLocal(const float xyz[3],float uv[3]) const; - StDetectorId GetDetId() const { return fDetId;} - void SetDetId(StDetectorId id){ fDetId=id;} -int GetNHits() const; -float GetLayer() const { return fNex;} -void SetLayer(); -const StMultiKeyMap *GetHitMap() const {return fHitMap;} -void SetPath(const char *path) { fPath=path; } -const char *GetPath() const { return fPath;} -protected: -char fBeg[1]; -StDetectorId fDetId; -float fOrg[3]; -float fDir[3][3]; -float fNex; //distance to next layer -TNamed *fHitErrCalc; -StMultiKeyMap *fHitMap; -const char *fPath; -char fEnd[1]; - -ClassDef(StHitPlane,0) // -}; -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StHitTube : public StHitPlane -{ -friend class StTGeoProxy; -friend class StHitPlaneInfo; -public: - StHitTube(const char *path, int volId); -virtual ~StHitTube(){;} - -virtual const Mtx33F_t &GetDir(const float *) const ; -virtual const float *GetOrg(const float *) const ; -virtual const float *GetPnt() const {return fPnt;} -virtual int Kind() const {return 1;} -protected: -char fBeg[1]; -float fPnt[3]; -float fRmed; -char fEnd[1]; - -ClassDef(StHitTube,0) // -}; -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StActorFunctor : public TNamed -{ -public: - StActorFunctor(const char *name=""):TNamed(name,""){} -virtual ~StActorFunctor(){} - -virtual int operator()(const double xyz[3]=0)=0; - int Operator (const float xyz[3]); - - int GetIPath(int nLev,int *copyNums,const char **voluNams=0) const; - int GetDetId() const {return mDetId;} - void SetDetId(int det) {mDetId = det ;} - void SetHit(void *hit) {mHit = hit ;} -const char* GetPath() const; -const TGeoVolume *GetVolu() const; -const TGeoNode *GetNode() const; - StVoluInfo *GetInfo() const; - StHitPlaneInfo *GetHitPlaneInfo() const; - StHitPlane *GetHitPlane() const; - -protected: -int mDetId; -void *mHit; -ClassDef(StActorFunctor,0) -}; -inline int StActorFunctor::Operator(const float xyz[3]) -{ - if (!xyz) return (*this)(); - double d[3]={xyz[0],xyz[1],xyz[2]}; - return (*this)(d); -} -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StvSetLayer: public StActorFunctor -{ -public: - StvSetLayer(); - ~StvSetLayer(){} -int operator()(const double xyz[3]=0); -private: - -ClassDef(StvSetLayer,0) -}; - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StTGeoProxy : public TObject -{ - StTGeoProxy(); -virtual ~StTGeoProxy(); - -public: - int Load(const char *geo); - void SetOpt (int opt) {fOpt = opt;} - void Init(int mode=0); - void InitLayers(StDetectorId did=kUnknownId); - void Finish(); - int Edit(StDetectorId did,StActorFunctor *af); - - StVoluInfo *SetModule (const char *voluName,int akt=1); - void InitInfo(); - void InitModuLev(); - - void InitHitShape(); - - void SetHitPlane(const char *moduName,const char *voluName,int axis=1); - void InitHitPlane(StActorFunctor *act=0); - int InitHits(); - void ClearHits(); - void Clear(const char *opt=""); - double Look(double maxDist,const double pnt[3],const double dir[3]); - - int SetHitErrCalc(StDetectorId modId,TNamed *hitErrCalc,StActorFunctor *sel=0); -static StTGeoProxy *Instance(); -static StTGeoProxy *Inst(){return Instance();}; - -public: - void Print(const char *tit=0) const; - void ls(const char* opt="Mmps") const; - void SetInfo (StVoluInfo *ext); - int SetActive (const char *voluName,int act=1,StActorFunctor *af=0); - int SetActive (StDetectorId did,int act=1,StActorFunctor *af=0); -const TGeoVolume *FindModule(const char *patt); - StVoluInfo *SetFlag (const TGeoVolume *volu,StVoluInfo::E_VoluInfo flg,int act=1); - StVoluInfo *IsFlag (const TGeoVolume *volu,StVoluInfo::E_VoluInfo flg) const; - StVoluInfo *IsModule (const TGeoVolume *volu) const; - StVoluInfo *IsModule (const TGeoNode *node) const; - StVoluInfo *IsMODULE (const TGeoVolume *volu) const; - StVoluInfo *IsActive (const TGeoVolume *volu=0) const; - int IsGoodHit () const {return fGoodHit;} - int IsActive (StDetectorId did) const; - int IsHitted (const double X[3]) const; -static int IsSensitive(const TGeoVolume *volu=0); -static StDetectorId DetId(const char *detName); -static const char *DetName(StDetectorId detId); -static const char *ModName(StDetectorId detId); -static int MakeDir(int kode,float dir[3][3]); -static void Summary(); - - - - StVoluInfo *GetInfo (int idx) const; - StVoluInfo *&GetINFO (int idx); -const char *GetPath() const; -const TGeoVolume *GetModu() const; -const TGeoVolume *GetVolu() const; -StVoidArr *GetSeedHits() const {return fSeedHits ;} -StVoidArr *GetAllHits() const {return fAllHits ;} - -StHitPlaneInfo* IsHitPlane(const TGeoVolume *volu) const; -StHitPlaneInfo* IsHitPlane(const TGeoNode *node) const; -StHitPlane * GetCurrentHitPlane (); - - int MayHitPlane (const TGeoVolume *volu) const; - StHitPlaneInfo *MakeHitPlaneInfo(const StTGeoIter &iter); - void AddHitPlane(StHitPlane *pla); - -const StHitPlane *AddHit(void *hit,StDetectorId detId, const float xyz[3],unsigned int hardw,int seed); - StHitPlane *FindHitPlane(const float xyz[3],int &sure); - - -const StTGeoHitShape* GetHitShape() const {return fHitShape;} - void SetHitLoadActor(StActorFunctor *fun) {fHitLoadActor = fun;} - - -static void Test(); -static void Break(int kase); -private: - - -private: -char fBeg[1]; -int fMode; //0=fill infos + hitShape, 1= hit planes -int fOpt; //0=Optimisation Off, !=0= Optimization ON -int fGoodHit; //1=last loaded hit inside of sensitive volume -StDetectorId fDetId; -Long64_t fActiveModu; -StVoluInfoMap *fVoluInfoArr; // array of all StVoluIinfo -TObjArray *fHitPlaneArr; // array of StHitPlane's -StVoidArr *fSeedHits; // Vector for hits used in seed finder -StVoidArr *fAllHits; // Vector of all hits, mainly for debug -StTGeoHitShape *fHitShape; - -// Actor functorss -StActorFunctor *fHitLoadActor; // functor used in AddHit - -char fEnd[1]; -public: -static int fgKount[3]; - -ClassDef(StTGeoProxy,0) // -}; - - -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StTGeoIter -{ -public: - StTGeoIter(); - ~StTGeoIter(); - void Reset(); -StTGeoIter &operator++(); -const TGeoVolume *operator*() const {return fVolu;} -StTGeoIter &Next(); -StTGeoIter &Down(); -StTGeoIter &Upp(); -StTGeoIter &Skip(); - -const TGeoNode *GetNode(int idx=0) const; -const TGeoVolume *GetVolu(int idx=0) const; -const TGeoHMatrix*GetMatr(int idx=0) const; - int GetLev() const {return fLev;} - int GetIdx() const {return (fLev)? fStk[fLev-1]:0;} -const int *GetStk() const {return fStk;} - int IsFirst()const {return fNow ==1;} - int IsLast ()const {return fNow ==2;} - int IsEnd() const {return fVolu==0;} - int IsOmule()const; //candidate to module - int State() const {return fNow;} - void LocalToMaster (const double* local, double* master) const; - void LocalToMasterVect(const double* local, double* master) const; - void LocalToMaster (const float* local, float* master) const; - void LocalToMasterVect(const float* local, float* master) const; - void Print(const char *tit="") const; -const char *GetPath() const; -private: - -private: - int fNow; // 1=first visit,2=last visit,3=first and last visit - int fKase; - int fLev; - int fStk[100]; -TGeoVolume *fVolu; -TGeoNavigator *fNavi; - -}; -// _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ -class StTGeoHitShape -{ -public: - StTGeoHitShape(); -void Update(double z1, double z2, double rxy); -void Smooth(double zl=-100, double zr=100); -int Outside(double z,double rxy) const; -void Get(double &zMin,double &zMax,double &rMax) const; -void Print(const char *opt=0) const; - -private: -enum E_Safe {kSafe=110}; // Used Rmax = Rmax*kSafe/100, etc... -enum {kNZ=20}; // Number of Z bins - -private: -double fZMin; -double fZMax; -double fRMin; -double fRMax; -double fZStp; -double fRMinMax; -double fRMaxMin; - -double fRxy[kNZ][2]; -}; -#endif //ST_TGEOHELPER_H - diff --git a/StarVMC/GeoTestMaker/StTProfile2D.cxx b/StarVMC/GeoTestMaker/StTProfile2D.cxx deleted file mode 100644 index efa8eb9e921..00000000000 --- a/StarVMC/GeoTestMaker/StTProfile2D.cxx +++ /dev/null @@ -1,351 +0,0 @@ -#include -#include -#include "StTProfile2D.h" -#include "TROOT.h" -#include "TVirtualHistPainter.h" - -ClassImp(StTProfile2D) -//______________________________________________________________________________ -StTProfile2D::StTProfile2D():TProfile2D() -{ - fPainter = new StTHistPainter(); - fPainter->SetHistogram(this); -} -//______________________________________________________________________________ -StTProfile2D::StTProfile2D(const char* name, const char* title - ,Int_t nbinsx, Double_t xlow, Double_t xup - ,Int_t nbinsy, Double_t ylow, Double_t yup - ,double,double, Option_t* option): - TProfile2D(name,title,nbinsx,xlow,xup,nbinsy,ylow,yup,option) -{ - fPainter = new StTHistPainter(); - fPainter->SetHistogram(this); -} -//______________________________________________________________________________ -TProfile *StTProfile2D::ProfileX(const char *name, Int_t firstybin, Int_t lastybin, Option_t *option) const -{ - // *-*-*-*-*Project a 2-D histogram into a profile histogram along X*-*-*-*-*-* - // *-* ======================================================== - // - // The projection is made from the channels along the Y axis - // ranging from firstybin to lastybin included. - // By default, bins 1 to ny are included - // When all bins are included, the number of entries in the projection - // is set to the number of entries of the 2-D histogram, otherwise - // the number of entries is incremented by 1 for all non empty cells. - // - // if option "d" is specified, the profile is drawn in the current pad. - // - // Using a TCutG object, it is possible to select a sub-range of a 2-D histogram. - // One must create a graphical cut (mouse or C++) and specify the name - // of the cut between [] in the option. - // For example, with a TCutG named "cutg", one can call: - // myhist->ProfileX(" ",firstybin,lastybin,"[cutg]"); - // To invert the cut, it is enough to put a "-" in front of its name: - // myhist->ProfileX(" ",firstybin,lastybin,"[-cutg]"); - // It is possible to apply several cuts ("," means logical AND): - // myhist->ProfileX(" ",firstybin,lastybin,[cutg1,cutg2]"); - // - // NOTE that if a TProfile named name exists in the current directory or pad, - // the histogram is reset and filled again with the current contents of the TH2. - // The X axis attributes of the TH2 are copied to the X axis of the profile. - // - // NOTE2 that the default under- / overflow behavior differs from what ProjectionX - // does! Profiles take the bin center into account, so here the under- and overflow - // bins are ignored by default. - - return DoProfile(true, name, firstybin, lastybin, option); - -} - -//______________________________________________________________________________ -TProfile *StTProfile2D::ProfileY(const char *name, Int_t firstxbin, Int_t lastxbin, Option_t *option) const -{ - // *-*-*-*-*Project a 2-D histogram into a profile histogram along Y*-*-*-*-*-* - // *-* ======================================================== - // - // The projection is made from the channels along the X axis - // ranging from firstxbin to lastxbin included. - // By default, bins 1 to nx are included - // When all bins are included, the number of entries in the projection - // is set to the number of entries of the 2-D histogram, otherwise - // the number of entries is incremented by 1 for all non empty cells. - // - // if option "d" is specified, the profile is drawn in the current pad. - // - // Using a TCutG object, it is possible to select a sub-range of a 2-D histogram. - // One must create a graphical cut (mouse or C++) and specify the name - // of the cut between [] in the option. - // For example, with a TCutG named "cutg", one can call: - // myhist->ProfileY(" ",firstybin,lastybin,"[cutg]"); - // To invert the cut, it is enough to put a "-" in front of its name: - // myhist->ProfileY(" ",firstybin,lastybin,"[-cutg]"); - // It is possible to apply several cuts: - // myhist->ProfileY(" ",firstybin,lastybin,[cutg1,cutg2]"); - // - // NOTE that if a TProfile named name exists in the current directory or pad, - // the histogram is reset and filled again with the current contents of the TH2. - // The Y axis attributes of the TH2 are copied to the X axis of the profile. - // - // NOTE2 that the default under- / overflow behavior differs from what ProjectionX - // does! Profiles take the bin center into account, so here the under- and overflow - // bins are ignored by default. - - return DoProfile(false, name, firstxbin, lastxbin, option); -} -//______________________________________________________________________________ -TProfile *StTProfile2D::DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const -{ - TString opt = option; - - const TAxis& outAxis = ( onX ? fXaxis : fYaxis ); - const TAxis& inAxis = ( onX ? fYaxis : fXaxis ); - Int_t outN = outAxis.GetNbins(); - Int_t inN = inAxis.GetNbins(); - const char *expectedName = ( onX ? "_pfx" : "_pfy" ); - - if (firstbin < 0) firstbin = 1; - if (lastbin < 0) lastbin = inN; - if (lastbin > inN+1) lastbin = inN; - - // Create the profile histogram - char *pname = (char*)name; - if (name && strcmp(name, expectedName) == 0) { - Int_t nch = strlen(GetName()) + 5; - pname = new char[nch]; - sprintf(pname,"%s%s",GetName(),name); - } - TProfile *h1=0; - //check if a profile with identical name exist - TObject *h1obj = gROOT->FindObject(pname); - if (h1obj && h1obj->InheritsFrom("TProfile")) { - h1 = (TProfile*)h1obj; - // tb.d. check if number of bin is consistent ? - h1->Reset(); - } - - Int_t ncuts = 0; - opt.ToLower(); //must be called after MakeCuts - - if (!h1) { - const TArrayD *bins = outAxis.GetXbins(); - if (bins->fN == 0) { - h1 = new TProfile(pname,GetTitle(),outN,outAxis.GetXmin(),outAxis.GetXmax(),option); - } else { - h1 = new TProfile(pname,GetTitle(),outN,bins->fArray,option); - } - } - if (pname != name) delete [] pname; - - // Copy attributes - h1->GetXaxis()->ImportAttributes( &outAxis); - h1->SetLineColor(this->GetLineColor()); - h1->SetFillColor(this->GetFillColor()); - h1->SetMarkerColor(this->GetMarkerColor()); - h1->SetMarkerStyle(this->GetMarkerStyle()); - - // - // Fill the profile histogram - Double_t cont; - for (Int_t outBin =0;outBin<=outN+1;outBin++) { - for (Int_t inBin=firstbin;inBin<=lastbin;inBin++) { - Int_t& binx = (onX ? outBin : inBin ); - Int_t& biny = (onX ? inBin : outBin ); - if (ncuts) { - if (!fPainter->IsInside(binx,biny)) continue; - } - cont = GetCellContent(binx,biny); - int bin = biny*(fXaxis.GetNbins()+2) + binx; - double ent = fBinEntries.fArray[bin]; - if (ent <=0.) continue; - h1->Fill(outAxis.GetBinCenter(outBin),cont/ent,ent ); - } - } - if ((firstbin <=1 && lastbin >= inN) && !ncuts) h1->SetEntries(fEntries); - - return h1; -} -//______________________________________________________________________________ -void StTProfile2D::SupressZeros(double minZ) -{ - int nBinX = fXaxis.GetNbins(); - int nBinY = fYaxis.GetNbins(); - for (int ix = 1;ix<=nBinX;ix++) { - for (int iy = 1;iy<=nBinY;iy++) { - if (fabs(GetBinContent(ix,iy)) >minZ) continue; - SetBinContent(ix,iy,0.); - SetBinError (ix,iy,0.); - } } -} -//______________________________________________________________________________ -//______________________________________________________________________________ -//______________________________________________________________________________ -#include "Riostream.h" -#include "TROOT.h" -#include "TClass.h" -#include "TSystem.h" -#include "THistPainter.h" -#include "TH3.h" -#include "TH2.h" -#include "TF2.h" -#include "TF3.h" -#include "TCutG.h" -#include "TMatrixDBase.h" -#include "TMatrixFBase.h" -#include "TVectorD.h" -#include "TVectorF.h" -#include "TPad.h" -#include "TPaveStats.h" -#include "TFrame.h" -#include "TLatex.h" -#include "TLine.h" -#include "TPolyLine.h" -#include "TPoints.h" -#include "TStyle.h" -#include "TGraph.h" -#include "TPie.h" -#include "TGaxis.h" -#include "TColor.h" -#include "TPainter3dAlgorithms.h" -#include "TGraph2DPainter.h" -#include "TGraphDelaunay.h" -#include "TView.h" -#include "TMath.h" -#include "TRandom.h" -#include "TObjArray.h" -#include "TVectorD.h" -#include "Hoption.h" -#include "Hparam.h" -#include "TPluginManager.h" -#include "TPaletteAxis.h" -#include "TCrown.h" -#include "TVirtualPadEditor.h" -#include "TEnv.h" -#include "TPoint.h" - -ClassImp(StTHistPainter) - -extern Hoption_t Hoption; -extern Hparam_t Hparam; -//______________________________________________________________________________ -void StTHistPainter::PaintColorLevels(Option_t *) -{ - /* Begin_html - Control function to draw a 2D histogram as a color plot. - End_html */ - - Double_t z, zc, xk, xstep, yk, ystep, xlow, xup, ylow, yup; - - Double_t zmin = fH->GetMinimum(); - Double_t zmax = fH->GetMaximum(); - if (Hoption.Logz) { - if (zmin > 0) { - zmin = TMath::Log10(zmin); - zmax = TMath::Log10(zmax); - } else { - return; - } - } - - Double_t dz = zmax - zmin; - - if (dz <= 0) return; - - Style_t fillsav = fH->GetFillStyle(); - Style_t colsav = fH->GetFillColor(); - fH->SetFillStyle(1001); - fH->TAttFill::Modify(); - - // Initialize the levels on the Z axis - Int_t ncolors = gStyle->GetNumberOfColors(); - Int_t ndiv = fH->GetContour(); - if (ndiv == 0 ) { - ndiv = gStyle->GetNumberContours(); - fH->SetContour(ndiv); - } - Int_t ndivz = TMath::Abs(ndiv); - if (fH->TestBit(TH1::kUserContour) == 0) fH->SetContour(ndiv); - Double_t scale = ndivz/dz; - - Int_t color; - for (Int_t j=Hparam.yfirst; j<=Hparam.ylast;j++) { - yk = fYaxis->GetBinLowEdge(j); - ystep = fYaxis->GetBinWidth(j); - if (Hoption.System == kPOLAR && yk<0) yk= 2*TMath::Pi()+yk; - for (Int_t i=Hparam.xfirst; i<=Hparam.xlast;i++) { - Int_t bin = j*(fXaxis->GetNbins()+2) + i; - xk = fXaxis->GetBinLowEdge(i); - xstep = fXaxis->GetBinWidth(i); - if (!IsInside(xk+0.5*xstep,yk+0.5*ystep)) continue; - z = fH->GetBinContent(bin); -//VP if (z == 0 && (zmin >= 0 || Hoption.Logz)) continue; // don't draw the empty bins for histograms with positive content - if (z == 0 && (fH->GetBinError(bin) <=0 || Hoption.Logz)) continue; // don't draw the empty bins for histograms with positive content - if (Hoption.Logz) { - if (z > 0) z = TMath::Log10(z); - else z = zmin; - } - if (z < zmin) continue; - xup = xk + xstep; - xlow = xk; - if (Hoption.Logx) { - if (xup > 0) xup = TMath::Log10(xup); - else continue; - if (xlow > 0) xlow = TMath::Log10(xlow); - else continue; - } - yup = yk + ystep; - ylow = yk; - if (Hoption.System != kPOLAR) { - if (Hoption.Logy) { - if (yup > 0) yup = TMath::Log10(yup); - else continue; - if (ylow > 0) ylow = TMath::Log10(ylow); - else continue; - } - if (xup < gPad->GetUxmin()) continue; - if (yup < gPad->GetUymin()) continue; - if (xlow > gPad->GetUxmax()) continue; - if (ylow > gPad->GetUymax()) continue; - if (xlow < gPad->GetUxmin()) xlow = gPad->GetUxmin(); - if (ylow < gPad->GetUymin()) ylow = gPad->GetUymin(); - if (xup > gPad->GetUxmax()) xup = gPad->GetUxmax(); - if (yup > gPad->GetUymax()) yup = gPad->GetUymax(); - } - - if (fH->TestBit(TH1::kUserContour)) { - zc = fH->GetContourLevelPad(0); - if (z < zc) continue; - color = -1; - for (Int_t k=0; kGetContourLevelPad(k); - if (z < zc) { - continue; - } else { - color++; - } - } - } else { - color = Int_t(0.01+(z-zmin)*scale); - } - - Int_t theColor = Int_t((color+0.99)*Float_t(ncolors)/Float_t(ndivz)); - if (theColor > ncolors-1) theColor = ncolors-1; - fH->SetFillColor(gStyle->GetColorPalette(theColor)); - fH->TAttFill::Modify(); - if (Hoption.System != kPOLAR) { - gPad->PaintBox(xlow, ylow, xup, yup); - } else { - TCrown crown(0,0,xlow,xup,ylow*TMath::RadToDeg(),yup*TMath::RadToDeg()); - crown.SetFillColor(gStyle->GetColorPalette(theColor)); - crown.Paint(); - } - } - } - - if (Hoption.Zscale) PaintPalette(); - - fH->SetFillStyle(fillsav); - fH->SetFillColor(colsav); - fH->TAttFill::Modify(); - -} diff --git a/StarVMC/GeoTestMaker/StTProfile2D.h b/StarVMC/GeoTestMaker/StTProfile2D.h deleted file mode 100644 index f5521ef6dad..00000000000 --- a/StarVMC/GeoTestMaker/StTProfile2D.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef STTPROFILE2D_H -#define STTPROFILE2D_H -#include "THistPainter.h" - -#include "TProfile2D.h" - -class StTProfile2D: public TProfile2D -{ -public: -StTProfile2D(); -StTProfile2D(const char* name, const char* title - , Int_t nbinsx, Double_t xlow, Double_t xup - , Int_t nbinsy, Double_t ylow, Double_t yup - , double zMin=0, double zMax=0 - ,const char* option = ""); -TProfile* ProfileX(const char* name = "_pfx", Int_t firstybin = 1, Int_t lastybin = -1, Option_t* option = "") const; -TProfile* ProfileY(const char* name = "_pfy", Int_t firstxbin = 1, Int_t lastxbin = -1, Option_t* option = "") const; -void SupressZeros(double minZ=1e-10); -private: -TProfile *DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const; - -ClassDef(StTProfile2D,0) -}; - -class StTHistPainter: public THistPainter -{ -public: - StTHistPainter():THistPainter() {;} - ~StTHistPainter(){;} - void PaintColorLevels(Option_t *); -protected: -ClassDef(StTHistPainter,0) -}; - -#endif //STTPROFILE2D_H diff --git a/StarVMC/GeoTestMaker/StVMCApplication.cxx b/StarVMC/GeoTestMaker/StVMCApplication.cxx deleted file mode 100644 index 7c69f775e63..00000000000 --- a/StarVMC/GeoTestMaker/StVMCApplication.cxx +++ /dev/null @@ -1,116 +0,0 @@ -// $Id: StVMCApplication.cxx,v 1.4 2011/05/04 17:46:41 perev Exp $ -// Class StVMCApplication -// ----------------------- -// Implementation of the TVirtualMCApplication -#include -#include "StVMCApplication.h" -#include "GCall.h" -#include "TGeoManager.h" -#include "TROOT.h" -#include "TPDGCode.h" -#include "TGeant3TGeo.h" -#include "StMCStack.h" -ClassImp(StVMCApplication); - -//_____________________________________________________________________________ -StVMCApplication::StVMCApplication(const char *name, const char *title) -{ - SetName(name); SetTitle(title); - memset(mBeg,0,mEnd-mBeg+1); - mRmax = 3e33; mZmax=3e33; -} -//_____________________________________________________________________________ -StVMCApplication::~StVMCApplication() -{ // Destructor -} -//_____________________________________________________________________________ -int StVMCApplication::Trig(int nTrig) -{ - return gMC->ProcessRun(nTrig); -} -//_____________________________________________________________________________ -int StVMCApplication::Init() -{ - if (mInit) (*mInit)(); - SetDebug(mDebug); - return 0; -} -//_____________________________________________________________________________ -void StVMCApplication::Stepping() -{ - (*mStepping)(); -} -//_____________________________________________________________________________ -void StVMCApplication::GeneratePrimaries() -{ - (*mPrimaryGenerator)(); -} -//_____________________________________________________________________________ -void StVMCApplication::ConstructGeometry() -{ // Initialize geometry - if (mConstructGeometry) (*mConstructGeometry)(); -} -//_____________________________________________________________________________ -void StVMCApplication::InitGeometry() -{ - if (mInitGeometry) (*mInitGeometry)(); -} -//_____________________________________________________________________________ -void StVMCApplication::BeginEvent() -{ -// User actions at beginning of event - if (mBeginEvent) (*mBeginEvent)(); -} -//_____________________________________________________________________________ -void StVMCApplication::BeginPrimary() -{ -// User actions at beginning of a primary track - if (mBeginPrimary) (*mBeginPrimary)(); -} -//_____________________________________________________________________________ -void StVMCApplication::PreTrack() -{ -// User actions at beginning of each track - if (mPreTrack) (*mPreTrack)(); -} -//_____________________________________________________________________________ -void StVMCApplication::PostTrack() -{ -// User actions after finishing of each track - if (mPostTrack) (*mPostTrack)(); -} -//_____________________________________________________________________________ -void StVMCApplication::FinishPrimary() -{ -// User actions after finishing of a primary track - if (mFinishPrimary) (*mFinishPrimary)(); -} -//_____________________________________________________________________________ -void StVMCApplication::FinishEvent() -{ -// User actions after finishing of an event - if (mFinishEvent) (*mFinishEvent)(); -} -//_____________________________________________________________________________ -void StVMCApplication::Field(const double* x, double* b) const -{ - if (mField) { (*mField)(x,b);} - else {b[0]=0;b[1]=0;b[2]=5;} -} -//________________________________________________________________________________ -void StVMCApplication::SetDebug(int l) -{ - mDebug = l; - TGeant3TGeo *g3g = (TGeant3TGeo*)gMC; - if (!g3g) return; - - g3g->Gcflag()->idebug = mDebug ; - g3g->Gcflag()->itest = mDebug ? 100:0 ; - if (mDebug > 1) { - g3g->SetDEBU(1,1,100); - g3g->SetSWIT(1,2); - g3g->SetSWIT(2,2); - } else { - g3g->SetSWIT(4,0); - } -} diff --git a/StarVMC/GeoTestMaker/StVMCApplication.h b/StarVMC/GeoTestMaker/StVMCApplication.h deleted file mode 100644 index 445389ddf1e..00000000000 --- a/StarVMC/GeoTestMaker/StVMCApplication.h +++ /dev/null @@ -1,92 +0,0 @@ -// $Id: StVMCApplication.h,v 1.4 2017/05/02 19:34:04 perev Exp $ -// Class StVMCApplication -// ----------------------- -// Implementation of the TVirtualMCApplication -// -#include "TVirtualMCApplication.h" -#ifndef StMC_APPLICATION_H -#define StMC_APPLICATION_H - -class GCall; - -class StVMCApplication : public TVirtualMCApplication -{ - public: - StVMCApplication(const char* name=0, const char *title=0); - virtual ~StVMCApplication(); - int Init(); - int Trig(int nTrig=1); - - virtual void GeneratePrimaries(); - virtual void Stepping(); - virtual void ConstructGeometry(); - virtual void InitGeometry(); - virtual void BeginEvent(); - virtual void BeginPrimary(); - virtual void PreTrack(); - virtual void PostTrack(); - virtual void FinishPrimary(); - virtual void FinishEvent(); - virtual void Field(const double* x, double* b) const; - virtual void AddParticles() {} -//functions setters - void SetInit (GCall* gc) { mInit =gc;} - void SetStepping (GCall *gc) { mStepping =gc;} - void SetPrimaryGenerator (GCall* gc) { mPrimaryGenerator =gc;} - void SetConstructGeometry(GCall* gc) { mConstructGeometry=gc;} - void SetInitGeometry (GCall* gc) { mInitGeometry =gc;} - void SetBeginEvent (GCall* gc) { mBeginEvent =gc;} - void SetBeginPrimary (GCall* gc) { mBeginPrimary =gc;} - void SetPreTrack (GCall* gc) { mPreTrack =gc;} - void SetPostTrack (GCall* gc) { mPostTrack =gc;} - void SetFinishPrimary (GCall* gc) { mFinishPrimary =gc;} - void SetFinishEvent (GCall* gc) { mFinishEvent =gc;} - void SetField (GCall* gc) { mField =gc;} - void SetDebug (int db=1); - -//functions getters - GCall *GetInit () { return mInit ;} - GCall *GetStepping () { return mStepping ;} - GCall *GetPrimaryGenerator () { return mPrimaryGenerator ;} - GCall *GetConstructGeometry() { return mConstructGeometry;} - GCall *GetInitGeometry () { return mInitGeometry ;} - GCall *GetBeginEvent () { return mBeginEvent ;} - GCall *GetBeginPrimary () { return mBeginPrimary ;} - GCall *GetPreTrack () { return mPreTrack ;} - GCall *GetPostTrack () { return mPostTrack ;} - GCall *GetFinishPrimary () { return mFinishPrimary ;} - GCall *GetFinishEvent () { return mFinishEvent ;} - GCall *GetField () { return mField ;} - void SetRZmax(double rMax,double zMax) { mRmax=rMax;mZmax=zMax; } - - virtual double TrackingRmax() const { return mRmax; } - virtual double TrackingZmax() const { return mZmax; } - virtual int Debug() const { return mDebug;} - - private: -// methods -// data members - - char mBeg[1]; - int mDebug; - int mNStepping; - double mRmax; - double mZmax; - GCall* mInit; - GCall* mStepping; - GCall* mPrimaryGenerator; - GCall* mConstructGeometry; - GCall* mInitGeometry; - GCall* mBeginEvent; - GCall* mBeginPrimary; - GCall* mPreTrack; - GCall* mPostTrack; - GCall* mFinishPrimary; - GCall* mFinishEvent; - GCall* mField; - char mEnd[1]; - -ClassDef(StVMCApplication,0) //Interface to MonteCarlo application -}; - -#endif //StMC_APPLICATION_H diff --git a/StarVMC/GeoTestMaker/StiELossTrk.cxx b/StarVMC/GeoTestMaker/StiELossTrk.cxx deleted file mode 100644 index 62306a2d0e1..00000000000 --- a/StarVMC/GeoTestMaker/StiELossTrk.cxx +++ /dev/null @@ -1,53 +0,0 @@ -// $Id: StiELossTrk.cxx,v 1.2 2009/10/13 17:19:35 perev Exp $ -// -// -// Class StiELossTrk -// ------------------ -#include -#include -#include -#include "StiELossTrk.h" -ClassImp(StiELossTrk) - -//_____________________________________________________________________________ -void StiELossTrk::Reset() -{ - memset(fBeg,0,fEnd-fBeg+1); - Set(1.,PiMASS); -} -//_____________________________________________________________________________ -void StiELossTrk::Set(double p2,double mass) -{ - fP2=p2; fMas2 = mass*mass; - fFak = (14.1*14.1*(fP2+fMas2))/(fP2*fP2*1e6); -} -//_____________________________________________________________________________ -void StiELossTrk::Add(double len,double x0) -{ - fMCS[0] += len/x0; - fMCS[1] -= len*len/x0; - fMCS[2] += len*len*len/(3*x0); - fTotLen += len; -} -//_____________________________________________________________________________ -double StiELossTrk::GetTheta2() const -{ - assert(fFak>0); - return fFak*fMCS[0]; -} -//_____________________________________________________________________________ -double StiELossTrk::GetOrt2() const -{ - assert(fFak>0); - return fFak*(fMCS[2]+fTotLen*(fMCS[1]+fTotLen*fMCS[0])); -} -//_____________________________________________________________________________ -void StiELossTrk::GetCoef(double coe[3]) const -{ - for (int i=0;i<3;i++) {coe[i]=fFak*fMCS[i];} -} -//_____________________________________________________________________________ -double StiELossTrk::GetOrt2(double coe[3],double len) -{ - return (coe[2]+len*(coe[1]+len*coe[0])); -} diff --git a/StarVMC/GeoTestMaker/StiELossTrk.h b/StarVMC/GeoTestMaker/StiELossTrk.h deleted file mode 100644 index c74d4225451..00000000000 --- a/StarVMC/GeoTestMaker/StiELossTrk.h +++ /dev/null @@ -1,36 +0,0 @@ -// $Id: StiELossTrk.h,v 1.2 2009/10/13 17:19:35 perev Exp $ -// -// -// Class StiELossTrk -// ------------------ - - -#ifndef STIELOSSTRK_H -#define STIELOSSTRK_H -#include "TObject.h" - -static const double PiMASS=0.13956995; - class StiELossTrk : public TObject -{ -public: - StiELossTrk(){Reset();} - ~StiELossTrk(){;} - void Reset(); - void Set(double p2,double mass = PiMASS); - void Add(double len,double x0); - double GetTheta2() const; - double GetOrt2() const; - void GetCoef(double coe[3]) const; -static double GetOrt2(double coe[3],double len) ; -private: -char fBeg[1]; -double fP2; -double fMas2; -double fFak; -double fTotLen; -double fMCS[3]; -char fEnd[1]; -ClassDef(StiELossTrk,0) -}; -#endif //STIELOSSTRK_H - diff --git a/StarVMC/Geometry/StarGeo.xml b/StarVMC/Geometry/StarGeo.xml index 1c751dc2ae1..0b8c4da276a 100644 --- a/StarVMC/Geometry/StarGeo.xml +++ b/StarVMC/Geometry/StarGeo.xml @@ -1,20 +1,7 @@ - - - + + @@ -42,7 +29,7 @@ - + @@ -70,6 +57,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StarVMC/StarAgmlLib/AgBlock.cxx b/StarVMC/StarAgmlLib/AgBlock.cxx index f6801e47086..5c96915bdef 100644 --- a/StarVMC/StarAgmlLib/AgBlock.cxx +++ b/StarVMC/StarAgmlLib/AgBlock.cxx @@ -98,6 +98,9 @@ void AgBlock::AddGroup( const Char_t *name ) ;//{ mGroups.push_back( name ); } +void AgBlock::AddCut( TString cut, double value ){ mGstpar[cut] = value; } + + // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> WHY IS THIS COMMENTED OUT??? void AgBlock::Inherit() { diff --git a/StarVMC/StarAgmlLib/AgBlock.h b/StarVMC/StarAgmlLib/AgBlock.h index 653b60e9510..be59cca0b61 100644 --- a/StarVMC/StarAgmlLib/AgBlock.h +++ b/StarVMC/StarAgmlLib/AgBlock.h @@ -153,7 +153,7 @@ class AgBlock : public TNamed int numberBranches() const { return mNumberBranches; } void branch(){ mNumberBranches++; } - void AddCut( TString cut, double value ){ mGstpar[cut] = value; } + void AddCut( TString cut, double value ); std::map& GetCuts() { return mGstpar; } private: diff --git a/StarVMC/StarAgmlLib/AgMLExtension.cxx b/StarVMC/StarAgmlLib/AgMLExtension.cxx index 5287b9bdb3f..de85e142434 100644 --- a/StarVMC/StarAgmlLib/AgMLExtension.cxx +++ b/StarVMC/StarAgmlLib/AgMLExtension.cxx @@ -13,3 +13,5 @@ AgMLExtension::AgMLExtension() : TGeoRCExtension(), { Grab(); } + +void AgMLExtension::AddCut( TString cut, double value ){ mGstpar[cut] = value; } diff --git a/StarVMC/StarAgmlLib/AgMLExtension.h b/StarVMC/StarAgmlLib/AgMLExtension.h index 3d1d0bbef11..e379749d116 100644 --- a/StarVMC/StarAgmlLib/AgMLExtension.h +++ b/StarVMC/StarAgmlLib/AgMLExtension.h @@ -57,7 +57,7 @@ class AgMLExtension : public TGeoRCExtension { std::vector GetUserHits(){ return mHitScoring; } - void AddCut( TString cut, double value ){ mGstpar[cut] = value; } + void AddCut( TString cut, double value ); std::map& GetCuts() { return mGstpar; } diff --git a/StarVMC/StarAgmlLib/AgModule.cxx b/StarVMC/StarAgmlLib/AgModule.cxx index 95c41d06912..29465ba7618 100644 --- a/StarVMC/StarAgmlLib/AgModule.cxx +++ b/StarVMC/StarAgmlLib/AgModule.cxx @@ -25,6 +25,8 @@ TDataSet *AgModule::Geom() else return mGeomSet; }; +void AgModule::AddHitScoring( TString name, AgMLScoring* sc ){ mHitScoring[name] = sc; } + // --------------------------------------------------------------------------------------------- AgBlock *AgModule::AddBlock( const Char_t *name, AgBlock *_block ) { diff --git a/StarVMC/StarAgmlLib/AgModule.h b/StarVMC/StarAgmlLib/AgModule.h index dd0f3f5a1f6..c69e5a3d61d 100644 --- a/StarVMC/StarAgmlLib/AgModule.h +++ b/StarVMC/StarAgmlLib/AgModule.h @@ -40,7 +40,7 @@ class AgModule : public AgBlock void SetTrackingFlag( int flag ){ mTrackingFlag = flag; } int GetTrackingFlag(){ return mTrackingFlag; } - void AddHitScoring( TString name, AgMLScoring* sc ){ mHitScoring[name] = sc; } + void AddHitScoring( TString name, AgMLScoring* sc ); std::map GetHitScoring(){ return mHitScoring; } private: diff --git a/StarVMC/StarAgmlLib/AgShape.cxx b/StarVMC/StarAgmlLib/AgShape.cxx index 66a0fd26a38..5ca97db14c9 100644 --- a/StarVMC/StarAgmlLib/AgShape.cxx +++ b/StarVMC/StarAgmlLib/AgShape.cxx @@ -626,6 +626,8 @@ Bool_t AgShape::morphed() return true; // No shapes match } +std::vector< TString > &AgShape::parList(){ return mParList[mId]; } + // ============================================================================================================= Bool_t AgShape::parameterized() { diff --git a/StarVMC/StarAgmlLib/AgShape.h b/StarVMC/StarAgmlLib/AgShape.h index 63ab9a840a5..a58c8e9f7e0 100644 --- a/StarVMC/StarAgmlLib/AgShape.h +++ b/StarVMC/StarAgmlLib/AgShape.h @@ -67,7 +67,7 @@ class AgShape : public TNamed, public AgParameterList Bool_t morphed(); /// Return a list of the parameters which define this shape - std::vector< TString > &parList(){ return mParList[mId]; } + std::vector< TString > &parList(); /// Returns true if the shape's parameters are to be set /// when positioned diff --git a/StarVMC/StarAgmlLib/StarAgmlStacker.cxx b/StarVMC/StarAgmlLib/StarAgmlStacker.cxx index 0e1bc6d1c07..a79aebeb2bd 100644 --- a/StarVMC/StarAgmlLib/StarAgmlStacker.cxx +++ b/StarVMC/StarAgmlLib/StarAgmlStacker.cxx @@ -129,6 +129,12 @@ TString StarAgmlStacker::realname( TString nname ) return mRealnames[nname]; } + +const std::vector &StarAgmlStacker::nicknames(const Char_t *name) +{ + return mNicknames[ TString(name) ]; +} + // --------------------------------------------------------------------------------------------------- void StarAgmlStacker::Debug( const Char_t *name, const Char_t *flag ) { diff --git a/StarVMC/StarAgmlLib/StarAgmlStacker.h b/StarVMC/StarAgmlLib/StarAgmlStacker.h index ea323dbaed6..809b6496682 100644 --- a/StarVMC/StarAgmlLib/StarAgmlStacker.h +++ b/StarVMC/StarAgmlLib/StarAgmlStacker.h @@ -35,10 +35,7 @@ class StarAgmlStacker : public TNamed virtual Bool_t SearchVolume( const AgShape &shape, const AgAttribute &attr )=0; - const std::vector &nicknames(const Char_t *name) - { - return mNicknames[ TString(name) ]; - } + const std::vector &nicknames(const Char_t *name); void Debug( const Char_t *name, const Char_t *flag="position" ); diff --git a/StarVMC/geant3/TGeant3/TGeant3.h b/StarVMC/geant3/TGeant3/TGeant3.h index 1d5cd46018f..57a243b4739 100644 --- a/StarVMC/geant3/TGeant3/TGeant3.h +++ b/StarVMC/geant3/TGeant3/TGeant3.h @@ -1080,7 +1080,8 @@ class TGeant3 : public TVirtualMC { private: Int_t ConvertVolumePathString(const TString &volumeName,Int_t **lnam, Int_t **lnum); - + virtual void ProcessEvent(Int_t); + virtual void ProcessEvent(Int_t, Bool_t); protected: diff --git a/StarVMC/xgeometry/xgeometry.age b/StarVMC/xgeometry/xgeometry.age index 4382d82d123..a275c12c4b3 100644 --- a/StarVMC/xgeometry/xgeometry.age +++ b/StarVMC/xgeometry/xgeometry.age @@ -2542,6 +2542,9 @@ If LL>0 case y2023 { y2023: y2023 first cut geometry; Geom = 'y2023 '; call geom_y2023;} case y2023a { y2023a: y2023a production tag; Geom = 'y2023a '; call geom_y2023a;} + case y2023 { y2024: y2024 first cut geometry; Geom = 'y2024 '; call geom_y2024;} + case y2023a { y2024a: y2024a production tag; Geom = 'y2024a '; call geom_y2024a;} + case dev2021 { dev2021: First cut forward upgrades; Geom = 'dev2021 '; call geom_dev2021;} case dev2022 { dev2022: First cut forward upgrades; Geom = 'dev2022 '; call geom_dev2022;} case dev2022m { dev2022m: First cut forward upgrades; Geom = 'dev2022m '; call geom_dev2022m;} diff --git a/mgr/Conscript-standard b/mgr/Conscript-standard index 0df341f33a7..db1f9b9204b 100644 --- a/mgr/Conscript-standard +++ b/mgr/Conscript-standard @@ -895,7 +895,7 @@ if ( $pkg !~ /^sim$/ && $pkg !~ /^gen$/ ) { $CPPPATH = "#StarVMC" . $main::PATH_SEPARATOR . $CPPPATH; # print "StarVMC change CPPPATH to $CPPPATH =========\n"; - } elsif ($pkg eq "TPCCATracker" or $pkg eq "StiCA") { + } elsif ($pkg eq "TPCCATracker" or $pkg eq "Sti") { $CPPPATH .= $main::PATH_SEPARATOR . "#" . $Dir . $main::PATH_SEPARATOR . "#" . $Dir . "/code"; diff --git a/mgr/Dyson/Export/AgROOT.py b/mgr/Dyson/Export/AgROOT.py index 50402b2f338..8934d724515 100644 --- a/mgr/Dyson/Export/AgROOT.py +++ b/mgr/Dyson/Export/AgROOT.py @@ -687,7 +687,8 @@ class StarGeometry { /// Construct geometry with the specified tag, and return wrapped in a TDataSet static TDataSet* Construct( const char* name = "%s"); static bool List ( const char* name = "%s"); - static void Whitelist( const char* name, int value=1 ){ whitelist[name]=value; } + static void Whitelist( const char* name, int value=1 ); + static void InitAgML ( const char* stacker="StarTGeoStacker"); StarGeometry(){ /* nada */ }; virtual ~StarGeometry(){ /* nada */ } private: @@ -709,7 +710,7 @@ class Geometry : public StarGeometry { document.head(header) implement1 = """ -#include "StarVMC/StarGeometry/StarGeo.h" +#include "StarVMC/StarGeometry/StarGeo.h" #include "TObjectSet.h" #include "TGeoManager.h" #include @@ -717,6 +718,8 @@ class Geometry : public StarGeometry { std::map StarGeometry::whitelist= {{"all",1}}; + void StarGeometry::Whitelist(const char* name, int value){ whitelist[name]=value; } + TDataSet* StarGeometry::Construct( const char* name ) { std::string tag = name; @@ -744,7 +747,19 @@ class Geometry : public StarGeometry { output = ' if (all||tag=="%s") { %s::list(); found = true; }' %(name,name) document.impl( output, unit='global' ) document.impl( 'if ( 0==found ) LOG_INFO << tag << " not defined" << endm;', unit='global' ) - document.impl( 'return true;};', unit='global' ) + document.impl( 'return true;};', unit='global' ) + + implement1 = """ +#include "StarVMC/StarAgmlLib/StarNoStacker.h" +#include "StarVMC/StarAgmlLib/StarTGeoStacker.h" + void StarGeometry::InitAgML( const char* s ) { + std::string sname = s; + if ( sname=="StarNoStacker" ) AgBlock::SetStacker( new StarNoStacker ); + else AgBlock::SetStacker( new StarTGeoStacker ); + }; + """ + document.impl( implement1, unit='global' ) + diff --git a/mgr/config/v0.2.3-rhel7-root5.34.38-32b.config b/mgr/config/v0.2.3-rhel7-root5.34.38-32b.config deleted file mode 100644 index b239f572acd..00000000000 --- a/mgr/config/v0.2.3-rhel7-root5.34.38-32b.config +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env csh - -# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) -unsetenv _LMFILES_* -module purge -module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ -module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ -module load star-env-0.2.3-root-5.34.38 -module load libiconv-1.16 diff --git a/mgr/config/v0.2.3-rhel7-root5.34.38-64b.config b/mgr/config/v0.2.3-rhel7-root5.34.38-64b.config deleted file mode 100644 index 5ced6372fa4..00000000000 --- a/mgr/config/v0.2.3-rhel7-root5.34.38-64b.config +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env csh - -# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) -unsetenv _LMFILES_* -module purge -module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ -module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ -module load star-env-0.2.3-root-5.34.38 -module load libiconv-1.16 diff --git a/mgr/config/v0.2.3-rhel7-root5.34.38.config b/mgr/config/v0.2.3-rhel7-root5.34.38.config new file mode 100644 index 00000000000..e172257917a --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root5.34.38.config @@ -0,0 +1,17 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-5.34.38 +module load libiconv-1.16 diff --git a/mgr/config/v0.2.3-rhel7-root6.16.00.config b/mgr/config/v0.2.3-rhel7-root6.16.00.config new file mode 100644 index 00000000000..d79f4e7fe0d --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root6.16.00.config @@ -0,0 +1,18 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-6.16.00 +module load libiconv-1.16 +module load vc-0.7.4 diff --git a/mgr/config/v0.2.3-rhel7-root6.24.06.config b/mgr/config/v0.2.3-rhel7-root6.24.06.config new file mode 100644 index 00000000000..1eb0d7e4d4b --- /dev/null +++ b/mgr/config/v0.2.3-rhel7-root6.24.06.config @@ -0,0 +1,18 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.2.3-root-6.24.06 +module load libiconv-1.16 +module load vc-0.7.4 diff --git a/mgr/config/v0.3.0-rhel7-root5.34.38.config b/mgr/config/v0.3.0-rhel7-root5.34.38.config new file mode 100644 index 00000000000..bfb649b306d --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root5.34.38.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-5.34.38 diff --git a/mgr/config/v0.3.0-rhel7-root6.16.00.config b/mgr/config/v0.3.0-rhel7-root6.16.00.config new file mode 100644 index 00000000000..b33b1856c90 --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root6.16.00.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-6.16.00 diff --git a/mgr/config/v0.3.0-rhel7-root6.24.06.config b/mgr/config/v0.3.0-rhel7-root6.24.06.config new file mode 100644 index 00000000000..80efe1ef9cb --- /dev/null +++ b/mgr/config/v0.3.0-rhel7-root6.24.06.config @@ -0,0 +1,16 @@ +#!/usr/bin/env csh + +# this is in place of buggy `module clear` (module VERSION=3.2.10 DATE=2012-12-21) +unsetenv _LMFILES_* + +if ( $USE_64BITS == 1 ) then + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ +else + module purge + module unuse /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86_64/ + module use /cvmfs/star.sdcc.bnl.gov/star-spack/spack/share/spack/modules/linux-rhel7-x86/ +endif + +module load star-env-0.3.0-root-6.24.06 diff --git a/mgr/default.config b/mgr/default.config index 9f0486e11c0..a7aa7a43ecc 120000 --- a/mgr/default.config +++ b/mgr/default.config @@ -1 +1 @@ -config/v0.2.3-rhel7-root5.34.38-32b.config \ No newline at end of file +config/v0.3.0-rhel7-root5.34.38.config \ No newline at end of file diff --git a/mgr/warnoff_dirs.txt b/mgr/warnoff_dirs.txt index 0548a8ce867..74a46211c86 100644 --- a/mgr/warnoff_dirs.txt +++ b/mgr/warnoff_dirs.txt @@ -105,7 +105,6 @@ StRoot/StTreeMaker StRoot/StTriggerUtilities StRoot/StTrsMaker StRoot/StUtilities -StRoot/StXTrakMaker StRoot/St_QA_Maker StRoot/St_base StRoot/St_ctf_Maker @@ -120,11 +119,6 @@ StRoot/StiCA StRoot/StiMaker StRoot/StiTpc StRoot/StiUtilities -StRoot/Stv -StRoot/StvMaker -StRoot/StvSeed -StRoot/StvUtil -StarVMC/GeoTestMaker StarVMC/StarAgmlLib StarVMC/StarBASE StarVMC/StarGeometry