diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ea130cc3949..c68fac7b735 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 +/StDb/idl @akioogawa @dmarkh @fgeurts @iraklic @fisyak @R-Witt /StRoot/PWGTools @nigmatkulov @zsweger @marrbnl /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 @@ -87,66 +87,66 @@ /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/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/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/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/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/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/StDetectorDbMaker/StDetectorDbChairs.cxx b/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx index 004bd6941dc..13379580420 100644 --- a/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx +++ b/StRoot/StDetectorDbMaker/StDetectorDbChairs.cxx @@ -1333,8 +1333,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 +1816,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 +1824,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; } //________________________________________________________________________________ @@ -2242,74 +2456,6 @@ Float_t St_beamInfoC::Frequency() { 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 +3011,51 @@ 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; + for ( int i = 0; i < 120; i++ ){ // nTrays + for ( int j = 0; j < 192; j++ ){ + size_t index = i * 120 + j; + params[i][j] = St_tofSimResParamsC::instance()->resolution()[index]; + mAverageTimeResTof+=params[i][j]; + LOG_DEBUG << "tray:" << i << ", mod cell:" << j << " = " << St_tofSimResParamsC::instance()->resolution()[index] << " == " << params[i][j] << endm; + } + } + 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 index ee32c760d09..e93b1c16d44 100755 --- 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_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_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_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_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/StETofCalibMaker/StETofCalibMaker.cxx b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx index 459b27b2c3c..e8ab1b96049 100644 --- a/StRoot/StETofCalibMaker/StETofCalibMaker.cxx +++ b/StRoot/StETofCalibMaker/StETofCalibMaker.cxx @@ -1037,6 +1037,9 @@ StETofCalibMaker::InitRun( Int_t runnumber ) LOG_INFO << "the use of pulser relations inside a Gbtx is turned off" << endm; } + //reset histo keeping track of mod average distance to clock + mHistograms.at( "pulserDigiTimeDiff_GbtxCorrProfMod" )->Reset(); + // -------------------------------------------------------------------------------------------- @@ -2283,7 +2286,7 @@ StETofCalibMaker::applyPulserOffset( StETofDigi* aDigi ) { int key = aDigi->sector() * 1000 + aDigi->zPlane() * 100 + aDigi->counter() * 10 + aDigi->side(); - if( !mPulserTimeDiff.count( key ) ) { + if( !mPulserTimeDiff.count( key )) { return 0.; } diff --git a/StRoot/StETofHitMaker/StETofHitMaker.cxx b/StRoot/StETofHitMaker/StETofHitMaker.cxx index b5118252ade..f5c4b7cf612 100644 --- a/StRoot/StETofHitMaker/StETofHitMaker.cxx +++ b/StRoot/StETofHitMaker/StETofHitMaker.cxx @@ -115,6 +115,7 @@ StETofHitMaker::StETofHitMaker( const char* name ) mIsSim( false ), mDoQA( false ), mDebug( false ), + mApCorr(false), mHistFileName( "" ), mHistograms(), mCounterActive() @@ -1025,7 +1026,7 @@ StETofHitMaker::matchSides() delete *iterDigi; digiVec->erase( iterDigi ); //TODO: Afterpulse handling: save time difference between digi 1 and digi 2 and substract from hit time! - t_corr_afterpulse = digiVec->at( 0 )->calibTime() - digiVec->at( 1 )->calibTime(); //CHECK IF THAT actually makes things better!! + if(mApCorr) t_corr_afterpulse = digiVec->at( 0 )->calibTime() - digiVec->at( 1 )->calibTime(); if( mDoQA ) { mHistograms.at( histNameDigisErased )->Fill( 4 ); } @@ -1130,7 +1131,7 @@ StETofHitMaker::matchSides() if( xDigiC->side() == xDigiA->side() ) { //TODO: Afterpulse handling: save time difference between digi 1 and digi 2 and substract from hit time! - t_corr_afterpulse = xDigiA->calibTime() - xDigiC->calibTime(); //CHECK IF THAT actually makes things better!! + if(mApCorr) t_corr_afterpulse = xDigiA->calibTime() - xDigiC->calibTime(); xDigiA = xDigiC; iterDigi = digiVec->begin(); delete *iterDigi; @@ -1141,7 +1142,7 @@ StETofHitMaker::matchSides() } else { //TODO: Afterpulse handling: save time difference between digi 1 and digi 2 and substract from hit time! - t_corr_afterpulse = xDigiB->calibTime() - xDigiC->calibTime(); //CHECK IF THAT actually makes things better!! + if(mApCorr) t_corr_afterpulse = xDigiB->calibTime() - xDigiC->calibTime(); xDigiB = xDigiC; iterDigi = digiVec->begin() + 1; delete *iterDigi; @@ -1171,7 +1172,7 @@ StETofHitMaker::matchSides() // the "strip" time is the mean time between each end time = 0.5 * ( xDigiA->calibTime() + xDigiB->calibTime() ); //TODO: Afterpulse handling: correct hit time by the time difference between the first and second digi on the same side - if(!mIsSim){//merge skip corrections for simulation + if(!mIsSim && mApCorr){//merge skip corrections for simulation time += t_corr_afterpulse; } // weight of merging of hits (later) is the total charge => sum of both ends ToT @@ -1252,7 +1253,6 @@ StETofHitMaker::matchSides() clusterSize += 100; } - StETofHit* constructedHit = new StETofHit( sector, plane, counter, time, totSum, clusterSize, posX, posY ); //Modify individual counters if needed (e.g. flip in local y due to switched cables) if(mModMatrix.at(detIndex) > 0){ @@ -1260,6 +1260,7 @@ StETofHitMaker::matchSides() modifyHit(mode, posX , posY , time); } + 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/StETofHitMaker/StETofHitMaker.h b/StRoot/StETofHitMaker/StETofHitMaker.h index 9e82f1e2ed0..a8e1142fc39 100644 --- a/StRoot/StETofHitMaker/StETofHitMaker.h +++ b/StRoot/StETofHitMaker/StETofHitMaker.h @@ -88,6 +88,7 @@ class StETofHitMaker: public StMaker { void setIsSim( const bool isSim ); // for simulated digis void setDoQA( const bool doQA ); void setDebug( const bool debug ); + void setDoAfterPulseCorr( const bool apcorr ); void updateClockJumpMap( const std::map< int, int >& clockJumpDir ); @@ -170,6 +171,7 @@ class StETofHitMaker: public StMaker { Bool_t mIsSim; Bool_t mDoQA; Bool_t mDebug; + Bool_t mApCorr; std::string mHistFileName; std::map< std::string, TH1* > mHistograms; @@ -193,8 +195,9 @@ inline void StETofHitMaker::setSoftwareDeadTime( const double& deadTime ) inline void StETofHitMaker::setDoClockJumpShift( const bool doShift ) { mDoClockJumpShift = doShift; } inline void StETofHitMaker::setDoDoubleClockJumpShift( const bool doDoubleShift ) { mDoDoubleClockJumpShift = doDoubleShift; } -inline void StETofHitMaker::setIsSim( const bool isSim ) { mIsSim = isSim; } -inline void StETofHitMaker::setDoQA( const bool doQA ) { mDoQA = doQA; } -inline void StETofHitMaker::setDebug( const bool debug ) { mDebug = debug; } +inline void StETofHitMaker::setIsSim( const bool isSim ) { mIsSim = isSim; } +inline void StETofHitMaker::setDoQA( const bool doQA ) { mDoQA = doQA; } +inline void StETofHitMaker::setDebug( const bool debug ) { mDebug = debug; } +inline void StETofHitMaker::setDoAfterPulseCorr( const bool apcorr ) { mApCorr = apcorr; } #endif diff --git a/StRoot/StETofMatchMaker/StETofMatchMaker.h b/StRoot/StETofMatchMaker/StETofMatchMaker.h index 2d22ddc25d3..0a5020fbafb 100644 --- a/StRoot/StETofMatchMaker/StETofMatchMaker.h +++ b/StRoot/StETofMatchMaker/StETofMatchMaker.h @@ -230,6 +230,7 @@ class StETofMatchMaker : public StMaker { inline void StETofMatchMaker::setFileNameMatchParam( const char* fileName ) { mFileNameMatchParam = fileName; } +inline void StETofMatchMaker::setFileNameAlignParam( const char* fileName ) { mFileNameAlignParam = fileName; } inline void StETofMatchMaker::setOuterGeometry( const bool outerGeom ) { mOuterTrackGeometry = outerGeom; } inline void StETofMatchMaker::setUseHelixSwimmer( const bool useSwimmer ) { mUseHelixSwimmer = useSwimmer; } inline void StETofMatchMaker::setUseOnlyBTofHeaderStartTime( const bool useBTofT0 ) { mUseOnlyBTofHeaderStartTime = useBTofT0; } 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..39939704b93 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; 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/StFcsDbMaker/StFcsDb.cxx b/StRoot/StFcsDbMaker/StFcsDb.cxx index b666a7c2f09..788d00a4b4e 100644 --- a/StRoot/StFcsDbMaker/StFcsDb.cxx +++ b/StRoot/StFcsDbMaker/StFcsDb.cxx @@ -532,7 +532,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 +547,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 +706,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/StFcsWaveformFitMaker/PeakAnaPainter.h b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h index ed4bc96d3c4..44ddd21e182 100644 --- a/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h +++ b/StRoot/StFcsWaveformFitMaker/PeakAnaPainter.h @@ -46,7 +46,7 @@ Painter class for PeakAna class PeakAna; -class PeakAnaPainter +class PeakAnaPainter : public TObject { public: PeakAnaPainter(); diff --git a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.cxx index 643ae3d76a5..1673eb92e0c 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); @@ -1012,9 +1017,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="<GetPeak(compidx).mPeakY; res[2] = mPulseFit->GetPeak(compidx).mPeakX; res[3] = mDbPulse->GSigma(); @@ -1404,9 +1408,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 +1492,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 +1533,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 +1618,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(); diff --git a/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h b/StRoot/StFcsWaveformFitMaker/StFcsWaveformFitMaker.h index a27d71a186e..743688ce016 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 @@ -264,7 +268,7 @@ class StFcsWaveformFitMaker : public StMaker { 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 +363,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/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/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/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/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/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/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/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..c01c06881b8 --- /dev/null +++ b/StarDb/Calibrations/tpc/tpcExtraGainCorrection.y2022.C @@ -0,0 +1,170 @@ +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/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/default.config b/mgr/default.config index 9f0486e11c0..1ab9fa0d26d 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.2.3-rhel7-root5.34.38.config \ No newline at end of file