Skip to content

Commit

Permalink
Merge branch 'main' into TFG24c.Export.Mini
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos authored Dec 18, 2024
2 parents dc447f4 + 0accbf9 commit 8bc3333
Show file tree
Hide file tree
Showing 14 changed files with 259 additions and 19 deletions.
39 changes: 37 additions & 2 deletions StRoot/StBFChain/BigFullChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,15 @@ Bfc_st BFC[] = { // standard chains
"B2018a,ITTF,UseXgeom,BAna,VFMinuit,beamline3D,l3onl,emcDY2,epdHit,fpd,trgd,ZDCvtx,analysis"
, "","","Base chain for year 2018 AA data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE},

// 2018 updated chains
{"B2018c" ,"","",
"ry2018c,in,tpcX,UseXgeom,CorrX,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite","",""
, "Base chain for run 2018 data (tpc)",kFALSE},

{"P2018c","" ,"",
"B2018c,ITTF,BAna,VFMinuit,beamline3D,btof,mtd,l3onl,emcDY2,epdHit,fpd,trgd,ZDCvtx,analysis"
, "","","Base chain for year 2018 AA data - no Corr (+ l3, bcc/fpd, e/b-emc)",kFALSE},

// 2019 chains, BES
{"B2019a" ,"","","ry2019a,in,tpcX,UseXgeom,iTpcIT,CorrX,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite",
"","", "Base chain for run 2019 data (tpc)",kFALSE},
Expand All @@ -1001,6 +1010,14 @@ Bfc_st BFC[] = { // standard chains
"B2019a,ITTF,BAna,iTpcIT,VFMinuit,beamline3D,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2019 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2019 updated chains
{"B2019b" ,"","",
"ry2019b,in,tpcX,UseXgeom,iTpcIT,CorrY,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite",
"","", "Base chain for run 2019 data (tpc)",kFALSE},

{"P2019b","" ,"",
"B2019b,ITTF,BAna,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2019 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2020 initial chains
{"B2020a" ,"","",
Expand All @@ -1011,14 +1028,32 @@ Bfc_st BFC[] = { // standard chains
"B2020a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2020 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2020 updated chains
{"B2020b" ,"","",
"ry2020b,in,tpcX,UseXgeom,iTpcIT,CorrY,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite",
"","", "Base chain for run 2020 data (tpc)",kFALSE},

{"P2020b","" ,"",
"B2020b,ITTF,BAna,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2020 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2021 initial chains
{"B2021a" ,"","",
"ry2021a,in,tpcX,UseXgeom,iTpcIT,CorrY,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite",
"","", "Base chain for run 2020 data (tpc)",kFALSE},
"","", "Base chain for run 2021 data (tpc)",kFALSE},

{"P2021a","" ,"",
"B2021a,ITTF,BAna,iTpcIT,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2020 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},
, "","", "Base chain for year 2021 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2021 updated chains
{"B2021b" ,"","",
"ry2021b,in,tpcX,UseXgeom,iTpcIT,CorrY,AgML,tpcDB,TpcHitMover,Idst,tags,Tree,picoWrite,picoVtxDefault,picoCovMtxWrite",
"","", "Base chain for run 2021 data (tpc)",kFALSE},

{"P2021b","" ,"",
"B2021b,ITTF,BAna,VFMinuit,etofa,btof,mtd,l3onl,emcDY2,epdHit,trgd,ZDCvtx,analysis"
, "","", "Base chain for year 2021 AA data - no Corr (+ l3, epd, mtd, b/etof, b-emc)",kFALSE},

// 2022 initial chains
{"B2022" ,"","",
Expand Down
1 change: 1 addition & 0 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ Int_t StBFChain::Instantiate()
if (GetOption("usePct4Vtx" ) ) mk->SetAttr("PCT" , kTRUE);
if (GetOption("useBTOF4Vtx") ) mk->SetAttr("BTOF" , kTRUE);
if (GetOption("useBTOFmatchOnly") ) mk->SetAttr("useBTOFmatchOnly", kTRUE);
if (GetOption("FXT" ) ) mk->SetAttr("FXT" , kTRUE);

// X-tended works only for VFPPV, VFPPVnoCTB, VFPPVev for now but could be re-used
// However, we will change this to a more flexible arbitrarry setting later
Expand Down
37 changes: 30 additions & 7 deletions StRoot/StBbcSimulationMaker/StBbcSimulationMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ const float SinglePhotoElectronResolution = 0.3; // according to Les Bland
/* Numbering: the real PMT numbering (used in the map) starts from 1.
ALL OTHERS start from 0 !
*/


// Note: BBC new factors are calibrated by 2017 p+p runs
const short ADCBin = 4096;

const float LightFactor[NPMT2] = {1., 1., 0.95, 0.92, 1., 1., 1., 1., 0.9, 0.96, 0.95, 1., 0.95, 0.97, 1., 1., // East small
0.33, 0.298, 0.25, 0.26, 0.22, 0.4, 0.24, 0.26, // East large
1.2, 0.9, 1., 0.6, 1., 1., 1.2, 1.2, 1.25, 0.4, 1., 1., 0.95, 0.95, 0.94, 0.95, // West small
0., 0.243, 0., 0.2, 0.24, 0.18, 0.19, 0.2}; // West large

const float TileResolution[NPMT2] = {0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, // East small
0.6, 0.6, 0.4, 0.5, 0.5, 0.6, 0.4, 0.5, // East large
0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.5, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, // West small
0., 0.5, 0., 0.5, 0.6, 0.6, 0.4, 0.65}; // West large

const float pC_per_ADCBins[NPMT2] = {0.03, 0.03, 0.033, 0.033, 0.03, 0.03, 0.022, 0.03, 0.021, 0.022, 0.024, 0.03, 0.024, 0.024, 0.025, 0.027, // East small
0.0226, 0.028, 0.021, 0.023, 0.014, 0.0125, 0.012, 0.0125, // East large
0.031, 0.03, 0.03, 0.018, 0.03, 0.03, 0.023, 0.024, 0.028, 0.005, 0.03, 0.03, 0.028, 0.023, 0.022, 0.028, // West small
0., 0.027, 0., 0.06, 0.013, 0.014, 0.0129, 0.02}; // West large

const int shift_ADC0[NPMT2] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // East small
0, 0, 0, 0, -15, 0, -15, 0, // East large
0, 0, 0, 0, 0, 0, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, // West small
0, 0, 0, 0, -10, -7, -15, -10}; // West large

//____________________________________________________________________________

bool IsSmall(short iPMT)
Expand Down Expand Up @@ -118,27 +143,25 @@ the response based on that + noise.
~BbcDE(){};
void AddDE(uint16_t ipmt, float de)
{
if (!IsSmall(ipmt)) {de *= OuterFactor;}
de *= LightFactor[ipmt];
dE[ipmt] += de;
}
float GetDE(uint16_t ipmt)
{
/// returns DE in pC of PMT signal

float PoissonMean = dE[ipmt]/dE_1MIP*NPhotoelectrons_1MIP;
short NPhotoelectrons = BbcRndm.Poisson(PoissonMean);
float Q = pC_per_Photoelectron*
(1+BbcRndm.Gaus(0.,SinglePhotoElectronResolution))*
NPhotoelectrons;
(1+BbcRndm.Gaus(0.,TileResolution[ipmt]))*NPhotoelectrons;
return Q;
}
short GetADC(uint16_t ipmt)
{
/// returns digitized (ADC) amplitude
float A = this->GetDE(ipmt);
if (A<ADC0) {return 0;}
short N = (short)((A-ADC0)/pC_perADCbin);
if (N>=NADCbins) {return NADCbins-1;}
short N = (short)(A/pC_per_ADCBins[ipmt] + shift_ADC0[ipmt]);
if (N>=ADCBin) {return ADCBin-1;}
if (N<0){return 0;}
return N;
}
};
Expand Down
11 changes: 9 additions & 2 deletions StRoot/StChain/GeometryDbAliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,30 @@ static const DbAlias_t fDbAlias[] = {// geometry Comment old

{"y2019", 20181215, 0, "y2019", "y2019 development geometry, AgML,xgeometry"},
{"y2019a", 20181215, 1, "y2019a", "y2019a first production release geometry, AgML,xgeometry"},
{"y2019b", 20181215, 1, "y2019b", "y2019a production geometry (FXT @ 200.7cm), AgML,xgeometry"},
{"y2019b", 20181215, 2, "y2019b", "y2019a production geometry (FXT @ 200.0cm), AgML,xgeometry"},

{"y2020", 20191120, 0, "y2020", "y2020 development geometry, AgML,xgeometry"},
{"y2020a", 20191120, 1, "y2020a", "y2020 fast-offline geometry, AgML,xgeometry"},
{"y2020b", 20191120, 2, "y2020b", "y2020 production geometry (FXT @ 200.7 cm), AgML,xgeometry"},
{"y2020b", 20191120, 2, "y2020b", "y2020 production geometry (FXT @ 200.0 cm), AgML,xgeometry"},

{"y2021", 20201215, 0, "y2021", "y2021 development geometry, AgML,xgeometry"},
{"y2021a", 20201215, 1, "y2021a", "y2021 first production geometry, AgML,xgeometry"},
{"y2021b", 20201215, 2, "y2021b", "y2021 production geometry (FXT @ 200.0 cm), AgML,xgeometry"},


{"y2022", 20211015, 0, "y2022", "y2022 first cut geometry, AgML,xgeometry"},
{"y2022a", 20211015, 1, "y2022a", "y2022 production geometry, AgML,xgeometry"},
{"y2022b", 20211015, 2, "y2022b", "y2022 production geometry (FXT @ 200.0 cm), AgML,xgeometry"},

{ "y2023", 20230410, 0, "y2023", "y2023 first cut geometry, AgML,xgeometry"},
{ "y2023a", 20230410, 1, "y2023a", "y2023a production geometry, AgML,xgeometry"},
{ "y2023b", 20230410, 2, "y2023b", "y2023a production geometry (FXT @ 200.0 cm), AgML,xgeometry"},

{ "y2024", 20231210, 0, "y2024", "y2024 first cut geometry, AgML,xgeometry"},
{ "y2024a", 20231210, 1, "y2024a", "y2024a production geometry, AgML,xgeometry"},
{ "y2024b", 20231210, 2, "y2024b", "y2024b production geometry (FXT @ 200.0 cm), AgML,xgeometry"},

{ "y2024", 20241210, 0, "y2024", "y2024 first cut geometry, AgML,xgeometry"},

{"dev2021", 21201210, 1, "dev2021", "-deprecated- geometry for 2021+ forward program,AgML,xgeometry"},
{"dev2022", 21211210, 1, "dev2022", "development geometry for 2022+ forward program,AgML,xgeometry"},
Expand Down
15 changes: 13 additions & 2 deletions StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ StMinuitVertexFinder::StMinuitVertexFinder(VertexFit_t fitMode) :
mExternalSeedPresent = kFALSE;
mRequireCTB = kFALSE;
requireCTB = kFALSE;
mFXT = kFALSE;
mUseITTF = kFALSE;
mUseOldBEMCRank = kFALSE;
mLowerSplitVtxRank = kFALSE;
Expand Down Expand Up @@ -407,19 +408,29 @@ int StMinuitVertexFinder::fit(StEvent* event)
Int_t n_bemc_match_tot = 0;
Int_t n_cross_tot = 0;

// In FXT mode, we want to have a bias = -2 cm below the z-axis
// for the approximate physical target location. This could
// potentially be a database table (PrimaryVertexCuts) parameter,
// but the bias is approximate and highly unlikely to change/finetune.
StThreeVectorD beamAxis(0.0, mFXT ? -2.0 : 0.0, 0.0);
double RImpactMax2 = mRImpactMax*mRImpactMax;

for (const StTrackNode* stTrack : event->trackNodes())
{
StGlobalTrack* g = ( StGlobalTrack*) stTrack->track(global);
if (!accept(g)) continue;
StDcaGeometry* gDCA = g->dcaGeometry();
if (! gDCA) continue;
if (TMath::Abs(gDCA->impact()) > mRImpactMax) continue;
StPhysicalHelixD gHelix = gDCA->helix();
StThreeVectorD DCAPosition = gHelix.at(gHelix.pathLength(beamAxis.x(),beamAxis.y())) - beamAxis;
double RImpact2 = DCAPosition.perp2();
if (RImpact2 > RImpactMax2) continue; // calculate square once instead of sqrt N times
mDCAs.push_back(gDCA);
// StPhysicalHelixD helix = gDCA->helix();
// mHelices.push_back(helix);
mHelices.push_back(g->geometry()->helix());
mHelixFlags.push_back(1);
Double_t z_lin = gDCA->z();
Double_t z_lin = DCAPosition.z();
mZImpact.push_back(z_lin);

Bool_t shouldHitCTB = kFALSE;
Expand Down
2 changes: 2 additions & 0 deletions StRoot/StGenericVertexMaker/Minuit/StMinuitVertexFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class StMinuitVertexFinder: public StGenericVertexFinder
void setFlagBase();
void SetFitPointsCut(Int_t fitpoints) {mMinNumberOfFitPointsOnTrack = fitpoints;}
void SetMinimumTracks(Int_t n) {mMinTrack = n;}
void SetFXT(bool fxt=kTRUE) { mFXT = fxt; }

private:

Expand All @@ -151,6 +152,7 @@ class StMinuitVertexFinder: public StGenericVertexFinder
bool mLowerSplitVtxRank;// Use lower rank for split vertices
UInt_t mFlagBase; // ITTF track flag
bool mRequireCTB; // Set maker to use CTB
bool mFXT; // Switch on FXT mode
UInt_t mMinNumberOfFitPointsOnTrack;
Float_t mDcaZMax;
Double_t mRImpactMax; // Max distance between helix and nominal beamline (0,0,z)
Expand Down
1 change: 1 addition & 0 deletions StRoot/StGenericVertexMaker/StGenericVertexMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Int_t StGenericVertexMaker::Init()

if (IAttr("VFMinuit") ) ((StMinuitVertexFinder*) theFinder)->useOldBEMCRank();
if (IAttr("VFMinuit3") ) ((StMinuitVertexFinder*) theFinder)->lowerSplitVtxRank();
if (IAttr("FXT") ) ((StMinuitVertexFinder*) theFinder)->SetFXT();
if (minTracks > 0) ((StMinuitVertexFinder*) theFinder)->SetMinimumTracks(minTracks);

} else if ( IAttr("VFppLMV")){
Expand Down
3 changes: 3 additions & 0 deletions StarDb/AgMLGeometry/Geometry.y2021b.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TDataSet;
#include "CreateGeometry.h"
TDataSet* CreateTable() { return CreateGeometry("y2021b"); }
3 changes: 3 additions & 0 deletions StarDb/AgMLGeometry/Geometry.y2022b.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TDataSet;
#include "CreateGeometry.h"
TDataSet* CreateTable() { return CreateGeometry("y2022b"); }
3 changes: 3 additions & 0 deletions StarDb/AgMLGeometry/Geometry.y2023b.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TDataSet;
#include "CreateGeometry.h"
TDataSet* CreateTable() { return CreateGeometry("y2023b"); }
3 changes: 3 additions & 0 deletions StarDb/AgMLGeometry/Geometry.y2024b.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class TDataSet;
#include "CreateGeometry.h"
TDataSet* CreateTable() { return CreateGeometry("y2024b"); }
5 changes: 5 additions & 0 deletions StarVMC/Geometry/PipeGeo/TargConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<Init struct="TARG" var="zdis" value="200.7" />
</Setup>

<Setup name="TARGv1b" onoff="on" module="TargGeo" simu="2" comment="Target at z=200.0cm" >
<Init struct="TARG" var="onoff" value="2" />
<Init struct="TARG" var="zdis" value="200.0" />
</Setup>




Expand Down
Loading

0 comments on commit 8bc3333

Please sign in to comment.