Skip to content

Commit 68bfcdf

Browse files
committed
More fixes
1 parent 62b8b09 commit 68bfcdf

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

PWGDQ/Tasks/muonGlobalAlignment.cxx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ struct muonGlobalAlignment {
133133
static constexpr int NMchDetElems = 156;
134134
static constexpr int ThetaAbsBoundaryDeg = 3;
135135
static constexpr double SlopeResolutionZ = 535.;
136+
static constexpr double AbsorberBackZ = -505.f;
137+
static constexpr double BransonPlaneZ = -466.f;
136138

137139
Produces<aod::CompactMFTTracks> mftTable;
138140
Configurable<bool> cfgProduceMFTTable{"cfgProduceMFTTable", false, "flag to produce MFTsa table"};
@@ -1291,7 +1293,7 @@ struct muonGlobalAlignment {
12911293
template <class TMFT, class C>
12921294
o2::dataformats::GlobalFwdTrack PropagateMFTToDCA(const TMFT& mftTrack, const C& collision, float zshift)
12931295
{
1294-
static double Bz = -10001;
1296+
//static double Bz = -10001;
12951297
double chi2 = mftTrack.chi2();
12961298
double phiCorrDeg = 0;
12971299
double phiCorr = phiCorrDeg * TMath::Pi() / 180.f;
@@ -1318,12 +1320,12 @@ struct muonGlobalAlignment {
13181320
// double centerZ[3] = {mftTrack.x() + propVec[0] / 2.,
13191321
// mftTrack.y() + propVec[1] / 2.,
13201322
// mftTrack.z() + propVec[2] / 2.};
1321-
if (Bz < -10000) {
1322-
double centerZ[3] = {0, 0, -45.f / 2.f};
1323-
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
1324-
Bz = field->getBz(centerZ);
1325-
}
1326-
fwdtrack.propagateToZ(collision.posZ() - zshift, Bz);
1323+
//if (Bz < -10000) {
1324+
// double centerZ[3] = {0, 0, -45.f / 2.f};
1325+
// o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
1326+
// Bz = field->getBz(centerZ);
1327+
//}
1328+
fwdtrack.propagateToZ(collision.posZ() - zshift, mBzAtMftCenter);
13271329

13281330
propmuon.setParameters(fwdtrack.getParameters());
13291331
propmuon.setZ(fwdtrack.getZ());
@@ -1335,7 +1337,7 @@ struct muonGlobalAlignment {
13351337
template <class TMFT, class TMUON, class C>
13361338
o2::dataformats::GlobalFwdTrack PropagateMFTToDCA(const TMFT& mftTrack, const TMUON& mchTrack, const C& collision, float zshift)
13371339
{
1338-
static double Bz = -10001;
1340+
//static double Bz = -10001;
13391341
double chi2 = mftTrack.chi2();
13401342
double phiCorrDeg = 0;
13411343
double phiCorr = phiCorrDeg * TMath::Pi() / 180.f;
@@ -1366,12 +1368,12 @@ struct muonGlobalAlignment {
13661368
// double centerZ[3] = {mftTrack.x() + propVec[0] / 2.,
13671369
// mftTrack.y() + propVec[1] / 2.,
13681370
// mftTrack.z() + propVec[2] / 2.};
1369-
if (Bz < -10000) {
1370-
double centerZ[3] = {0, 0, -45.f / 2.f};
1371-
o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
1372-
Bz = field->getBz(centerZ);
1373-
}
1374-
fwdtrack.propagateToZ(collision.posZ() - zshift, Bz);
1371+
//if (Bz < -10000) {
1372+
// double centerZ[3] = {0, 0, -45.f / 2.f};
1373+
// o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
1374+
// Bz = field->getBz(centerZ);
1375+
//}
1376+
fwdtrack.propagateToZ(collision.posZ() - zshift, mBzAtMftCenter);
13751377

13761378
o2::dataformats::GlobalFwdTrack propmuon;
13771379
propmuon.setParameters(fwdtrack.getParameters());
@@ -1394,18 +1396,18 @@ struct muonGlobalAlignment {
13941396
}
13951397
auto mftTrackProp = FwdtoMCH(mftTrackPar);
13961398
UpdateTrackMomentum(mftTrackProp, mchTrackAtMFT);
1397-
if (z < -505.f) {
1398-
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -466.f);
1399+
if (z < AbsorberBackZ) {
1400+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, BransonPlaneZ);
13991401
UpdateTrackMomentum(mftTrackProp, mchTrackPar);
14001402
}
14011403

14021404
if (cfgDipoleZshift.value != 0) {
14031405
// extrapolate to the back of the absorber, taking into account the dipole shift,
14041406
// to avoid that the correction bring the track starting point back into the absorber
14051407
if (cfgDipoleZshift.value < 0) {
1406-
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -505.f);
1408+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, AbsorberBackZ);
14071409
} else if (cfgDipoleZshift.value > 0) {
1408-
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -505.f - cfgDipoleZshift.value);
1410+
o2::mch::TrackExtrap::extrapToZ(mftTrackProp, AbsorberBackZ - cfgDipoleZshift.value);
14091411
}
14101412
// shift the track starting point
14111413
mftTrackProp.setZ(mftTrackProp.getZ() + cfgDipoleZshift.value);
@@ -1503,7 +1505,8 @@ struct muonGlobalAlignment {
15031505
}
15041506

15051507
if (cfgEnableMftDcaExtraPlots) {
1506-
if (mftNclusters >= 6) {
1508+
static constexpr int nMftClustersMin = 6;
1509+
if (mftNclusters >= nMftClustersMin) {
15071510
for (int i = 0; i < nMftLayers; i++) {
15081511
auto mftTrackAtLayer = PropagateMFT(mftTrack, o2::mft::constants::mft::LayerZCoordinate()[i]);
15091512
std::get<std::shared_ptr<TH2>>(mMftTrackEffDen[i])->Fill(mftTrackAtLayer.getX(), mftTrackAtLayer.getY());

0 commit comments

Comments
 (0)