Skip to content

Commit 9a1c156

Browse files
committed
Add debug output for tracks/points + multiple fixes
Add debug track/points
1 parent 2365dd5 commit 9a1c156

20 files changed

+336
-25
lines changed

Detectors/Align/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ o2_add_library(Align
3636
src/EventVertex.cxx
3737
src/AlignConfig.cxx
3838
src/Mille.cxx
39+
src/AlgPntDbg.cxx
40+
src/AlgTrcDbg.cxx
3941
PUBLIC_LINK_LIBRARIES O2::FrameworkLogger
4042
O2::Steer
4143
O2::ReconstructionDataFormats
@@ -82,6 +84,8 @@ o2_target_root_dictionary(
8284
include/Align/GeometricalConstraint.h
8385
include/Align/utils.h
8486
include/Align/AlignConfig.h
87+
include/Align/AlgPntDbg.h
88+
include/Align/AlgTrcDbg.h
8589
)
8690

8791
add_subdirectory(Workflow)

Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ void BarrelAlignmentSpec::init(InitContext& ic)
192192
if (ic.options().get<bool>("apply-xor")) {
193193
mTRDTransformer->setApplyXOR();
194194
}
195+
auto prevShift = mTRDTransformer->isShiftApplied();
196+
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
197+
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
198+
mTRDTransformer->setApplyShift(false);
199+
}
200+
LOGP(info, "Old TRD shift : {} new : {}", prevShift, mTRDTransformer->isShiftApplied());
195201
mController->setTRDTransformer(mTRDTransformer.get());
196202
}
197203
mController->setAllowAfterburnerTracks(ic.options().get<bool>("allow-afterburner-tracks"));
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// @file AlignmentPoint.h
13+
/// @author ruben.shahoyan@cern.ch, michael.lettrich@cern.ch
14+
/// @since 2021-02-01
15+
/// @brief Meausered point in the sensor.
16+
17+
/**
18+
* Compact alignment point info for debugging
19+
*/
20+
21+
#ifndef ALGPNTDBG_H
22+
#define ALGPNTDBG_H
23+
24+
#include "Align/AlignmentPoint.h"
25+
26+
namespace o2
27+
{
28+
namespace align
29+
{
30+
31+
struct AlgPntDbg {
32+
public:
33+
using DetID = o2::detectors::DetID;
34+
//
35+
enum {
36+
UpperLeg = 0
37+
};
38+
//
39+
AlgPntDbg() = default;
40+
AlgPntDbg(const AlgPntDbg&) = default;
41+
~AlgPntDbg() = default;
42+
AlgPntDbg& operator=(const AlgPntDbg& other) = default;
43+
AlgPntDbg(const AlignmentPoint* point) : mDetID(point->getDetID()), mSID(point->getSID()), mAlpha(point->getAlphaSens()), mX(point->getXTracking()), mY(point->getYTracking()), mZ(point->getZTracking()), mErrYY(point->getYZErrTracking()[0]), mErrZZ(point->getYZErrTracking()[2]), mErrYZ(point->getYZErrTracking()[1])
44+
{
45+
mSinAlp = std::sin(mAlpha);
46+
mCosAlp = std::cos(mAlpha);
47+
mSnp = point->getTrParamWSA()[2]; // track Snp at the sensor
48+
if (point->isInvDir()) {
49+
setUpperLeg();
50+
}
51+
}
52+
53+
float getR() const { return std::sqrt(mX * mX + mY * mY); }
54+
float getYTrack() const { return mY + mYRes; }
55+
float getZTrack() const { return mZ + mZRes; }
56+
float getXTrack() const { return mX; }
57+
float getXLab() const { return mX * mCosAlp - mY * mSinAlp; }
58+
float getYLab() const { return mX * mSinAlp + mY * mCosAlp; }
59+
float getZLap() const { return mZ; }
60+
float getXTrackLab() const { return mX * mCosAlp - getYTrack() * mSinAlp; }
61+
float getYTrackLab() const { return mX * mSinAlp + getYTrack() * mCosAlp; }
62+
float getZTrackLab() const { return getZTrack(); }
63+
float getPhi() const { return std::atan2(getYLab(), getXLab()); }
64+
void setFlag(int i) { mFlags |= 0x1 << i; }
65+
bool getFlag(int i) const { return (mFlags & (0x1 << i)) != 0; }
66+
67+
void setUpperLeg() { setFlag(int(UpperLeg)); }
68+
bool isUpperLeg() const { return getFlag(int(UpperLeg)); }
69+
70+
int mDetID{}; // DetectorID
71+
int16_t mSID = -1; // sensor ID in the detector
72+
uint16_t mFlags = 0; // flags
73+
float mAlpha = 0.f; // Alpha of tracking frame
74+
float mSinAlp = 0.f;
75+
float mCosAlp = 0.f;
76+
float mX = 0.f; // tracking X
77+
float mY = 0.f; // tracking Y
78+
float mZ = 0.f; // Z
79+
float mYRes = 0.f; // tracking Y residual (track - point)
80+
float mZRes = 0.f; // Z residual
81+
float mErrYY = 0.f;
82+
float mErrZZ = 0.f;
83+
float mErrYZ = 0.f;
84+
float mSnp = 0.f;
85+
86+
ClassDefNV(AlgPntDbg, 1);
87+
};
88+
89+
} // namespace align
90+
} // namespace o2
91+
#endif
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// @file AlgTrcDbg.h
13+
/// @author ruben.shahoyan@cern.ch
14+
15+
#ifndef ALGTRCDBG_H
16+
#define ALGTRCDBG_H
17+
18+
#include "Align/AlignmentTrack.h"
19+
#include "Align/AlgPntDbg.h"
20+
#include "ReconstructionDataFormats/GlobalTrackID.h"
21+
#include "ReconstructionDataFormats/Track.h"
22+
23+
namespace o2
24+
{
25+
namespace align
26+
{
27+
28+
struct AlgTrcDbg : public o2::track::TrackParCov {
29+
AlgTrcDbg(const AlignmentTrack* trc) { setTrackParam(trc); }
30+
AlgTrcDbg() = default;
31+
~AlgTrcDbg() = default;
32+
AlgTrcDbg(const AlgTrcDbg&) = default;
33+
AlgTrcDbg& operator=(const AlgTrcDbg&) = default;
34+
35+
bool setTrackParam(const AlignmentTrack* trc)
36+
{
37+
if (!trc) {
38+
return false;
39+
}
40+
setX(trc->getX());
41+
setY(trc->getAlpha());
42+
for (int i = 0; i < 5; i++) {
43+
setParam(trc->getParam(i), i);
44+
}
45+
for (int i = 0; i < 15; i++) {
46+
setCov(trc->getCov()[i], i);
47+
}
48+
mPoints.clear();
49+
for (int i = 0; i < trc->getNPoints(); i++) {
50+
const auto* tpoint = trc->getPoint(i);
51+
if (tpoint->containsMeasurement()) {
52+
auto& pnt = mPoints.emplace_back(tpoint);
53+
pnt.mYRes = trc->getResidual(0, i);
54+
pnt.mZRes = trc->getResidual(1, i);
55+
}
56+
}
57+
setX(trc->getX());
58+
setY(trc->getAlpha());
59+
for (int i = 0; i < 5; i++) {
60+
setParam(trc->getParam(i), i);
61+
}
62+
for (int i = 0; i < 15; i++) {
63+
setCov(trc->getCov()[i], i);
64+
}
65+
for (int i = 0; i < trc->getNPoints(); i++) {
66+
const auto* tpoint = trc->getPoint(i);
67+
if (tpoint->containsMeasurement()) {
68+
auto& pnt = mPoints.emplace_back(tpoint);
69+
pnt.mYRes = trc->getResidual(0, i);
70+
pnt.mZRes = trc->getResidual(1, i);
71+
}
72+
}
73+
mGID.clear();
74+
mGIDCosmUp.clear();
75+
return true;
76+
}
77+
78+
auto getNPoints() const { return mPoints.size(); }
79+
bool isCosmic() const { return mGIDCosmUp.isSourceSet(); }
80+
81+
std::vector<AlgPntDbg> mPoints;
82+
o2::dataformats::GlobalTrackID mGID{};
83+
o2::dataformats::GlobalTrackID mGIDCosmUp{}; // GID of upper leg in case of cosmic
84+
//
85+
ClassDefNV(AlgTrcDbg, 1);
86+
};
87+
88+
} // namespace align
89+
} // namespace o2
90+
#endif

Detectors/Align/include/Align/AlignConfig.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct AlignConfig : public o2::conf::ConfigurableParamHelper<AlignConfig> {
3535
float q2PtMin[NTrackTypes] = {0.01, 0.01};
3636
float q2PtMax[NTrackTypes] = {10., 10.};
3737
float tglMax[NTrackTypes] = {3., 10.};
38+
float defPTB0Coll = 0.6;
39+
float defPTB0Cosm = 3.0;
3840
int minPoints[NTrackTypes] = {4, 10};
3941
int minDetAcc[NTrackTypes] = {1, 1};
4042

@@ -54,7 +56,7 @@ struct AlignConfig : public o2::conf::ConfigurableParamHelper<AlignConfig> {
5456
int minTOFClusters = 1; // min TOF clusters to accept track
5557
int maxTPCRowsCombined = 1; // allow combining clusters on so many rows to a single cluster
5658
int discardEdgePadrows = 3; // discard padrow if its distance to stack edge padrow < this
57-
float discardSectorEdgeDepth = 2.; // discard clusters too close to the sector edge
59+
float discardSectorEdgeDepth = 2.5; // discard clusters too close to the sector edge
5860
float ITSOverlapMargin = 0.15; // consider for overlaps only clusters within this marging from the chip edge (in cm)
5961
float ITSOverlapMaxChi2 = 16; // max chi2 between track and overlapping cluster
6062
int ITSOverlapEdgeRows = 1; // require clusters to not have pixels closer than this distance from the edge
@@ -71,8 +73,11 @@ struct AlignConfig : public o2::conf::ConfigurableParamHelper<AlignConfig> {
7173
int minTOFClustersCosm = 0; // min TOF clusters to accept track
7274
int minTOFClustersCosmLeg = 1; // min TOF clusters per leg to accept track
7375

74-
int minTPCPadRow = 0; // min TPC pad-row to account
75-
int maxTPCPadRow = 151; // max TPC pad-row to account
76+
int minTPCPadRow = 6; // min TPC pad-row to account
77+
int maxTPCPadRow = 146; // max TPC pad-row to account
78+
79+
float cosmMaxDSnp = 0.025; // reject cosmic tracks with larger than this snp difference
80+
float cosmMaxDTgl = 0.1; // reject cosmic tracks with larger than this tgl difference
7681

7782
float maxDCAforVC[2] = {-1, -1}; // DCA cut in R,Z to allow track be subjected to vertex constraint
7883
float maxChi2forVC = -1; // track-vertex chi2 cut to allow the track be subjected to vertex constraint

Detectors/Align/include/Align/AlignableSensorHMPID.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace o2
2929
namespace align
3030
{
3131

32-
class AlignableSensorHMPID : public AlignableSensor
32+
class AlignableSensorHMPID final : public AlignableSensor
3333
{
3434
public:
3535
AlignableSensorHMPID(const char* name = 0, int vid = 0, int iid = 0, int isec = 0);

Detectors/Align/include/Align/AlignableSensorITS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace o2
2929
namespace align
3030
{
3131

32-
class AlignableSensorITS : public AlignableSensor
32+
class AlignableSensorITS final : public AlignableSensor
3333
{
3434
public:
3535
AlignableSensorITS() = default;

Detectors/Align/include/Align/AlignableSensorTOF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace o2
2929
namespace align
3030
{
3131

32-
class AlignableSensorTOF : public AlignableSensor
32+
class AlignableSensorTOF final : public AlignableSensor
3333
{
3434
public:
3535
AlignableSensorTOF() = default;

Detectors/Align/include/Align/AlignableSensorTPC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace o2
2525
namespace align
2626
{
2727

28-
class AlignableSensorTPC : public AlignableSensor
28+
class AlignableSensorTPC final : public AlignableSensor
2929
{
3030
public:
3131
AlignableSensorTPC() = default;

Detectors/Align/include/Align/AlignableSensorTRD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace o2
2626
namespace align
2727
{
2828

29-
class AlignableSensorTRD : public AlignableSensor
29+
class AlignableSensorTRD final : public AlignableSensor
3030
{
3131
public:
3232
AlignableSensorTRD() = default;

0 commit comments

Comments
 (0)