Skip to content

Commit 01f27f5

Browse files
authored
Merge 6232cbc into sapling-pr-archive-ktf
2 parents a685e85 + 6232cbc commit 01f27f5

File tree

56 files changed

+991
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+991
-303
lines changed

DataFormats/Detectors/TOF/include/DataFormatsTOF/Cluster.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ class Cluster : public o2::BaseCluster<float>
4949
kDownRight = 4, // 2^4, 5th bit
5050
kDown = 5, // 2^5, 6th bit
5151
kDownLeft = 6, // 2^6, 7th bit
52-
kLeft = 7 }; // 2^7, 8th bit
52+
kLeft = 7, // 2^7, 8th bit
53+
//
54+
FrameBit = 6 }; // this bit set means that the cluster is in the nominal (alpha=20*sector+10 deg.) sector frame rather than aligned
5355

5456
Cluster() = default;
5557

5658
Cluster(std::int16_t sensid, float x, float y, float z, float sy2, float sz2, float syz, double timeRaw, double time, float tot, int L0L1latency, int deltaBC, float geanttime = 0.0, double t0 = 0.0);
5759

5860
~Cluster() = default;
5961

62+
bool isInNominalSector() const { return isBitSet(FrameBit); }
63+
void setInNominalSector() { setBit(FrameBit); }
64+
6065
std::int8_t getSector() const { return getCount(); }
6166
void setSector(std::int8_t value) { setCount(value); }
6267

DataFormats/Detectors/TPC/include/DataFormatsTPC/LtrCalibData.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct LtrCalibData {
4242
std::vector<uint16_t> matchedLtrIDs; ///< matched laser track IDs
4343
std::vector<uint16_t> nTrackTF; ///< number of laser tracks per TF
4444
std::vector<float> dEdx; ///< dE/dx of each track
45+
float tp{0.f}; ///< temperature over pressure ratio
4546

4647
bool isValid() const
4748
{
@@ -138,7 +139,7 @@ struct LtrCalibData {
138139
dEdx.clear();
139140
}
140141

141-
ClassDefNV(LtrCalibData, 4);
142+
ClassDefNV(LtrCalibData, 5);
142143
};
143144

144145
} // namespace o2::tpc

DataFormats/Detectors/TPC/include/DataFormatsTPC/VDriftCorrFact.h

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,35 @@ namespace o2::tpc
2626
{
2727

2828
struct VDriftCorrFact {
29-
long firstTime{}; ///< first time stamp of processed TFs
30-
long lastTime{}; ///< last time stamp of processed TFs
31-
long creationTime{}; ///< time of creation
32-
float corrFact{1.0}; ///< drift velocity correction factor (multiplicative)
33-
float corrFactErr{0.0}; ///< stat error of correction factor
34-
float refVDrift{0.}; ///< reference vdrift for which factor was extracted
29+
long firstTime{}; ///< first time stamp of processed TFs
30+
long lastTime{}; ///< last time stamp of processed TFs
31+
long creationTime{}; ///< time of creation
32+
float corrFact{1.0}; ///< drift velocity correction factor (multiplicative)
33+
float corrFactErr{0.0}; ///< stat error of correction factor
34+
float refVDrift{0.}; ///< reference vdrift for which factor was extracted
3535
float refTimeOffset{0.}; ///< additive time offset reference (\mus)
3636
float timeOffsetCorr{0.}; ///< additive time offset correction (\mus)
37+
float refTP{0.}; ///< reference temperature / pressure for which refVDrift was extracted
3738

3839
float getVDrift() const { return refVDrift * corrFact; }
3940
float getVDriftError() const { return refVDrift * corrFactErr; }
4041

4142
float getTimeOffset() const { return refTimeOffset + timeOffsetCorr; }
4243

4344
// renormalize VDrift reference and correction either to provided new reference (if >0) or to correction 1 wrt current reference
44-
void normalize(float newVRef = 0.f)
45+
void normalize(float newVRef = 0.f, float tp = 0.f)
4546
{
47+
float normVDrift = newVRef;
4648
if (newVRef == 0.f) {
47-
newVRef = refVDrift * corrFact;
49+
normVDrift = refVDrift * corrFact;
50+
newVRef = normVDrift;
51+
if ((tp > 0) && (refTP > 0)) {
52+
// linear scaling based on relative change of T/P
53+
normVDrift *= refTP / tp;
54+
refTP = tp; // update reference T/P
55+
}
4856
}
49-
float fact = refVDrift / newVRef;
57+
float fact = refVDrift / normVDrift;
5058
refVDrift = newVRef;
5159
corrFactErr *= fact;
5260
corrFact *= fact;
@@ -66,7 +74,7 @@ struct VDriftCorrFact {
6674
}
6775
}
6876

69-
ClassDefNV(VDriftCorrFact, 2);
77+
ClassDefNV(VDriftCorrFact, 3);
7078
};
7179

7280
} // namespace o2::tpc

Detectors/CTP/workflowScalers/src/ctp-ccdb-orbit.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ int main(int argc, char** argv)
125125
} else {
126126
std::cout << "Storing:" << ccdbPath << " tmin:" << tmin << " tmax:" << tmax << " ts:" << tt << std::endl;
127127
std::string filename = "orbitReset.root";
128-
TClass* tcls = TClass::GetClass(typeid(vect));
129-
auto ti = tcls->GetTypeInfo();
130128
auto classname = "std::vector<int64_t>";
131129
metadata["adjustableEOV"] = "true";
132-
ret = api.storeAsTFile_impl(&(vect), *ti, ccdbPath, metadata, tmin, tmax);
130+
ret = api.storeAsTFileAny(&(vect), ccdbPath, metadata, tmin, tmax);
133131
o2::ccdb::CcdbObjectInfo oi(ccdbPath, classname, filename, metadata, tmin, tmax);
134132
adjustOverriddenEOV(api, oi);
135133
}

Detectors/CTP/workflowScalers/src/ctpCCDBManager.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,14 @@ int ctpCCDBManager::saveOrbitReset(long timeStamp)
157157
o2::ccdb::CcdbApi api;
158158
std::map<std::string, std::string> metadata; // can be empty
159159
api.init(mCCDBHost.c_str()); // or http://localhost:8080 for a local installation
160-
161-
// store abitrary user object in strongly typed manner
162-
int ret = api.storeAsTFileAny(&vect, mCCDBPathOrbitReset, metadata, tmin, tmax);
160+
// int ret = api.storeAsTFileAny(&vect, mCCDBPathOrbitReset, metadata, tmin, tmax);
161+
std::cout << "Storing:" << mCCDBPathOrbitReset << " tmin:" << tmin << " tmax:" << tmax << " ts:" << timeStamp << std::endl;
162+
std::string filename = "orbitReset.root";
163+
auto classname = "std::vector<int64_t>";
164+
metadata["adjustableEOV"] = "true";
165+
int ret = api.storeAsTFileAny(&(vect), mCCDBPathOrbitReset, metadata, tmin, tmax);
166+
o2::ccdb::CcdbObjectInfo oi(mCCDBPathOrbitReset, classname, filename, metadata, tmin, tmax);
167+
adjustOverriddenEOV(api, oi);
163168
if (ret == 0) {
164169
LOG(info) << "Orbit reset saved in ccdb:" << mCCDBHost << " tmin:" << tmin << " tmax:" << tmax;
165170
} else {

Detectors/Calibration/include/DetectorsCalibration/IntegratedClusterCalibrator.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ struct TimeSeriesdEdx {
331331
};
332332

333333
struct TimeSeriesITSTPC {
334+
float mVDrift = 0; ///< drift velocity in cm/us
335+
float mPressure = 0; ///< pressure
336+
float mTemperature = 0; ///< temperature
334337
TimeSeries mTSTPC; ///< TPC standalone DCAs
335338
TimeSeries mTSITSTPC; ///< ITS-TPC standalone DCAs
336339
ITSTPC_Matching mITSTPCAll; ///< ITS-TPC matching efficiency for ITS standalone + afterburner
@@ -499,7 +502,7 @@ struct TimeSeriesITSTPC {
499502
nVertexContributors_Quantiles.resize(nTotalQ);
500503
}
501504

502-
ClassDefNV(TimeSeriesITSTPC, 5);
505+
ClassDefNV(TimeSeriesITSTPC, 6);
503506
};
504507

505508
} // end namespace tpc

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void MatchTPCITS::run(const o2::globaltracking::RecoContainer& inp,
101101
break;
102102
}
103103
if (mVDriftCalibOn) { // in the beginning of the output vector we send the full and reference VDrift used for this TF
104-
calib.emplace_back(mTPCVDrift, mTPCDrift.refVDrift, -999.);
104+
calib.emplace_back(mTPCVDrift, mTPCDrift.refVDrift, mTPCDrift.refTP);
105105
calib.emplace_back(mTPCDriftTimeOffset, mTPCDrift.refTimeOffset, -999.);
106106
}
107107

Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/include/TPCInterpolationWorkflow/TPCInterpolationSpec.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ namespace tpc
3838
class TPCInterpolationDPL : public Task
3939
{
4040
public:
41-
TPCInterpolationDPL(std::shared_ptr<o2::globaltracking::DataRequest> dr, o2::dataformats::GlobalTrackID::mask_t src, o2::dataformats::GlobalTrackID::mask_t srcMap, std::shared_ptr<o2::base::GRPGeomRequest> gr, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput) : mDataRequest(dr), mSources(src), mSourcesMap(srcMap), mGGCCDBRequest(gr), mUseMC(useMC), mProcessITSTPConly(processITSTPConly), mSendTrackData(sendTrackData), mDebugOutput(debugOutput) {}
41+
TPCInterpolationDPL(std::shared_ptr<o2::globaltracking::DataRequest> dr, o2::dataformats::GlobalTrackID::mask_t src, o2::dataformats::GlobalTrackID::mask_t srcMap, std::shared_ptr<o2::base::GRPGeomRequest> gr, bool useMC,
42+
bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid) : mDataRequest(dr), mSources(src), mSourcesMap(srcMap), mGGCCDBRequest(gr), mUseMC(useMC), mProcessITSTPConly(processITSTPConly), mSendTrackData(sendTrackData), mDebugOutput(debugOutput), mExtDetResid(extDetResid) {}
4243
~TPCInterpolationDPL() override = default;
4344
void init(InitContext& ic) final;
4445
void run(ProcessingContext& pc) final;
@@ -58,14 +59,16 @@ class TPCInterpolationDPL : public Task
5859
bool mProcessITSTPConly{false}; ///< should also tracks without outer point (ITS-TPC only) be processed?
5960
bool mProcessSeeds{false}; ///< process not only most complete track, but also its shorter parts
6061
bool mDebugOutput{false}; ///< add more information to the output (track points of ITS, TRD and TOF)
62+
bool mExtDetResid{true}; ///< produce unbinned residuals for external detectors
6163
bool mSendTrackData{false}; ///< if true, not only the clusters but also corresponding track data will be sent
6264
uint32_t mSlotLength{600u}; ///< the length of one calibration slot required to calculate max number of tracks per TF
6365
int mMatCorr{2}; ///< the material correction to be used for track interpolation
6466
TStopwatch mTimer;
6567
};
6668

6769
/// create a processor spec
68-
framework::DataProcessorSpec getTPCInterpolationSpec(o2::dataformats::GlobalTrackID::mask_t srcCls, o2::dataformats::GlobalTrackID::mask_t srcVtx, o2::dataformats::GlobalTrackID::mask_t srcTrk, o2::dataformats::GlobalTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput);
70+
framework::DataProcessorSpec getTPCInterpolationSpec(o2::dataformats::GlobalTrackID::mask_t srcCls, o2::dataformats::GlobalTrackID::mask_t srcVtx, o2::dataformats::GlobalTrackID::mask_t srcTrk,
71+
o2::dataformats::GlobalTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid);
6972

7073
} // namespace tpc
7174
} // namespace o2

Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/TPCInterpolationSpec.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ void TPCInterpolationDPL::updateTimeDependentParams(ProcessingContext& pc)
105105
}
106106
if (mDebugOutput) {
107107
mInterpolation.setDumpTrackPoints();
108-
mInterpolation.setITSClusterDictionary(mITSDict);
109108
}
109+
mInterpolation.setExtDetResid(mExtDetResid);
110+
mInterpolation.setITSClusterDictionary(mITSDict);
110111
}
111112

112113
void TPCInterpolationDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
@@ -158,7 +159,7 @@ void TPCInterpolationDPL::endOfStream(EndOfStreamContext& ec)
158159
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
159160
}
160161

161-
DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t srcCls, GTrackID::mask_t srcVtx, GTrackID::mask_t srcTrk, GTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput)
162+
DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t srcCls, GTrackID::mask_t srcVtx, GTrackID::mask_t srcTrk, GTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput, bool extDetResid)
162163
{
163164
auto dataRequest = std::make_shared<DataRequest>();
164165
std::vector<OutputSpec> outputs;
@@ -199,7 +200,7 @@ DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t srcCls, GTrackID::mas
199200
"tpc-track-interpolation",
200201
dataRequest->inputs,
201202
outputs,
202-
AlgorithmSpec{adaptFromTask<TPCInterpolationDPL>(dataRequest, srcTrk, srcTrkMap, ggRequest, useMC, processITSTPConly, sendTrackData, debugOutput)},
203+
AlgorithmSpec{adaptFromTask<TPCInterpolationDPL>(dataRequest, srcTrk, srcTrkMap, ggRequest, useMC, processITSTPConly, sendTrackData, debugOutput, extDetResid)},
203204
Options{
204205
{"matCorrType", VariantType::Int, 2, {"material correction type (definition in Propagator.h)"}},
205206
{"sec-per-slot", VariantType::UInt32, 600u, {"number of seconds per calibration time slot (put 0 for infinite slot length)"}},

Detectors/GlobalTrackingWorkflow/tpcinterpolationworkflow/src/tpc-interpolation-workflow.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
4242
{"tracking-sources-map-extraction", VariantType::String, std::string{GID::ALL}, {"can be subset of \"tracking-sources\""}},
4343
{"send-track-data", VariantType::Bool, false, {"Send also the track information to the aggregator"}},
4444
{"debug-output", VariantType::Bool, false, {"Dump extended tracking information for debugging"}},
45+
{"skip-ext-det-residuals", VariantType::Bool, false, {"Do not produce residuals for external detectors"}},
4546
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
4647
o2::raw::HBFUtilsInitializer::addConfigOption(options);
4748
std::swap(workflowOptions, options);
@@ -104,8 +105,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
104105
useMC = false; // force disabling MC as long as it is not implemented
105106
auto sendTrackData = configcontext.options().get<bool>("send-track-data");
106107
auto debugOutput = configcontext.options().get<bool>("debug-output");
108+
auto extDetResid = !configcontext.options().get<bool>("skip-ext-det-residuals");
107109

108-
specs.emplace_back(o2::tpc::getTPCInterpolationSpec(srcClusters, srcVtx, srcTracks, srcTracksMap, useMC, processITSTPConly, sendTrackData, debugOutput));
110+
specs.emplace_back(o2::tpc::getTPCInterpolationSpec(srcClusters, srcVtx, srcTracks, srcTracksMap, useMC, processITSTPConly, sendTrackData, debugOutput, extDetResid));
109111
if (!configcontext.options().get<bool>("disable-root-output")) {
110112
specs.emplace_back(o2::tpc::getTPCResidualWriterSpec(sendTrackData, debugOutput));
111113
}

0 commit comments

Comments
 (0)