Skip to content

Commit 9bc7fc5

Browse files
matthias-kleineralcaliva
authored andcommitted
TPC: adding MC ccdb objects for simulation and reconstruction
Digitization: - adding loading of gas parameters from CCDB for tuning the electron attachment - adding loading of GEM parameters for gain tuning Reconstruction: - adding option to load MC time gain calibration
1 parent 7ad5ac3 commit 9bc7fc5

File tree

10 files changed

+55
-7
lines changed

10 files changed

+55
-7
lines changed

Detectors/TPC/base/include/TPCBase/CDBTypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ enum class CDBType {
3434
CalLaserTracks, ///< Laser track calibration data
3535
CalVDriftTgl, ///< ITS-TPC difTgl vdrift calibration
3636
CalTimeGain, ///< Gain variation over time
37+
CalTimeGainMC, ///< Gain variation over time for MC
3738
CalGas, ///< DCS gas measurements
3839
CalTemperature, ///< DCS temperature measurements
3940
CalHV, ///< DCS HV measurements
@@ -98,6 +99,7 @@ const std::unordered_map<CDBType, const std::string> CDBTypeMap{
9899
{CDBType::CalPadGainResidual, "TPC/Calib/PadGainResidual"},
99100
{CDBType::CalLaserTracks, "TPC/Calib/LaserTracks"},
100101
{CDBType::CalTimeGain, "TPC/Calib/TimeGain"},
102+
{CDBType::CalTimeGainMC, "TPC/Calib/TimeGainMC"},
101103
{CDBType::CalGas, "TPC/Calib/Gas"},
102104
{CDBType::CalTemperature, "TPC/Calib/Temperature"},
103105
{CDBType::CalHV, "TPC/Calib/HV"},

Detectors/TPC/base/include/TPCBase/ParameterGEM.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ struct ParameterGEM : public o2::conf::ConfigurableParamHelper<ParameterGEM> {
6262
O2ParamDef(ParameterGEM, "TPCGEMParam");
6363
};
6464
} // namespace tpc
65+
66+
namespace framework
67+
{
68+
template <typename T>
69+
struct is_messageable;
70+
template <>
71+
struct is_messageable<o2::tpc::ParameterGEM> : std::true_type {
72+
};
73+
} // namespace framework
74+
6575
} // namespace o2
6676

6777
#endif // ALICEO2_TPC_ParameterGEM_H_

Detectors/TPC/base/include/TPCBase/ParameterGas.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ struct ParameterGas : public o2::conf::ConfigurableParamHelper<ParameterGas> {
4545
};
4646

4747
} // namespace tpc
48+
49+
namespace framework
50+
{
51+
template <typename T>
52+
struct is_messageable;
53+
template <>
54+
struct is_messageable<o2::tpc::ParameterGas> : std::true_type {
55+
};
56+
} // namespace framework
57+
4858
} // namespace o2
4959

5060
#endif // ALICEO2_TPC_ParameterGas_H_

Detectors/TPC/workflow/include/TPCWorkflow/RecoWorkflow.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData,
8686
bool askDISTSTF = true,
8787
bool selIR = false,
8888
bool filteredInp = false,
89-
int deadMapSources = -1);
89+
int deadMapSources = -1,
90+
bool useMCTimeGain = false);
9091

9192
void cleanupCallback();
9293

Detectors/TPC/workflow/src/RecoWorkflow.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const std::unordered_map<std::string, OutputType> OutputMap{
100100

101101
framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vector<int> const& tpcSectors, unsigned long tpcSectorMask, std::vector<int> const& laneConfiguration,
102102
const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts, bool propagateMC, unsigned nLanes, std::string const& cfgInput, std::string const& cfgOutput, bool disableRootInput,
103-
int caClusterer, int zsOnTheFly, bool askDISTSTF, bool selIR, bool filteredInp, int deadMapSources)
103+
int caClusterer, int zsOnTheFly, bool askDISTSTF, bool selIR, bool filteredInp, int deadMapSources, bool useMCTimeGain)
104104
{
105105
InputType inputType;
106106
try {
@@ -473,6 +473,7 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
473473
cfg.askDISTSTF = askDISTSTF;
474474
cfg.tpcTriggerHandling = isEnabled(OutputType::TPCTriggers) || cfg.caClusterer;
475475
cfg.tpcDeadMapSources = deadMapSources;
476+
cfg.tpcUseMCTimeGain = useMCTimeGain;
476477

477478
Inputs ggInputs;
478479
auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, true, false, true, true, o2::base::GRPGeomRequest::Aligned, ggInputs, true);

Detectors/TPC/workflow/src/tpc-reco-workflow.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
7171
{"filtered-input", VariantType::Bool, false, {"Filtered tracks, clusters input, prefix dataDescriptors with F"}},
7272
{"select-ir-frames", VariantType::Bool, false, {"Subscribe and filter according to external IR Frames"}},
7373
{"tpc-deadMap-sources", VariantType::Int, -1, {"Sources to consider for TPC dead channel map creation; -1=all, 0=deactivated"}},
74+
{"tpc-mc-time-gain", VariantType::Bool, false, {"use time gain calibration for MC (true) or for data (false)"}},
7475
};
7576
o2::tpc::CorrectionMapsLoader::addGlobalOptions(options);
7677
o2::raw::HBFUtilsInitializer::addConfigOption(options);
@@ -184,7 +185,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
184185
!cfgc.options().get<bool>("ignore-dist-stf"), //
185186
cfgc.options().get<bool>("select-ir-frames"),
186187
cfgc.options().get<bool>("filtered-input"),
187-
cfgc.options().get<int>("tpc-deadMap-sources"));
188+
cfgc.options().get<int>("tpc-deadMap-sources"),
189+
cfgc.options().get<bool>("tpc-mc-time-gain"));
188190

189191
// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
190192
o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ class GPURecoWorkflowSpec : public o2::framework::Task
106106
int lumiScaleMode = 0;
107107
bool enableMShape = false;
108108
bool enableCTPLumi = false;
109-
int enableDoublePipeline = 0;
110-
int tpcDeadMapSources = -1;
109+
int32_t enableDoublePipeline = 0;
110+
int32_t tpcDeadMapSources = -1;
111+
bool tpcUseMCTimeGain = false; // use time gain calibration for MC (true) or from data (false)
111112
bool decompressTPC = false;
112113
bool decompressTPCFromROOT = false;
113114
bool caClusterer = false;

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,11 @@ Inputs GPURecoWorkflowSpec::inputs()
10841084
}
10851085
inputs.emplace_back("tpcgain", gDataOriginTPC, "PADGAINFULL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalPadGainFull)));
10861086
inputs.emplace_back("tpcgainresidual", gDataOriginTPC, "PADGAINRESIDUAL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalPadGainResidual), {}, 1)); // time-dependent
1087-
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGain), {}, 1)); // time-dependent
1087+
if (mSpecConfig.tpcUseMCTimeGain) {
1088+
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGainMC), {}, 1)); // time-dependent
1089+
} else {
1090+
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGain), {}, 1)); // time-dependent
1091+
}
10881092
inputs.emplace_back("tpctopologygain", gDataOriginTPC, "TOPOLOGYGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTopologyGain)));
10891093
inputs.emplace_back("tpcthreshold", gDataOriginTPC, "PADTHRESHOLD", 0, Lifetime::Condition, ccdbParamSpec("TPC/Config/FEEPad"));
10901094
o2::tpc::VDriftHelper::requestCCDBInputs(inputs);

GPU/Workflow/src/gpu-reco-workflow.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
6161
{"configFile", VariantType::String, "", {"configuration file for configurable parameters"}},
6262
{"enableDoublePipeline", VariantType::Bool, false, {"enable GPU double pipeline mode"}},
6363
{"tpc-deadMap-sources", VariantType::Int, -1, {"Sources to consider for TPC dead channel map creation; -1=all, 0=deactivated"}},
64+
{"tpc-mc-time-gain", VariantType::Bool, false, {"use time gain calibration for MC (true) or for data (false)"}},
6465
};
6566
o2::tpc::CorrectionMapsLoader::addGlobalOptions(options);
6667
o2::raw::HBFUtilsInitializer::addConfigOption(options);
@@ -181,7 +182,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
181182
cfg.runTRDTracking = isEnabled(outputTypes, ioType::TRDTracks);
182183
cfg.tpcTriggerHandling = isEnabled(outputTypes, ioType::TPCTriggers) || cfg.caClusterer;
183184
cfg.enableDoublePipeline = cfgc.options().get<bool>("enableDoublePipeline");
184-
cfg.tpcDeadMapSources = cfgc.options().get<int>("tpc-deadMap-sources");
185+
cfg.tpcDeadMapSources = cfgc.options().get<int32_t>("tpc-deadMap-sources");
186+
cfg.tpcUseMCTimeGain = cfgc.options().get<bool>("tpc-mc-time-gain");
187+
cfg.runITSTracking = isEnabled(outputTypes, ioType::ITSTracks);
188+
cfg.itsOverrBeamEst = isEnabled(inputTypes, ioType::MeanVertex);
185189

186190
Inputs ggInputs;
187191
auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, true, false, true, true, o2::base::GRPGeomRequest::Aligned, ggInputs, true);

Steer/DigitizerWorkflow/src/TPCDigitizerSpec.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "DataFormatsParameters/GRPObject.h"
3535
#include "DataFormatsTPC/TPCSectorHeader.h"
3636
#include "TPCBase/CDBInterface.h"
37+
#include "TPCBase/ParameterGEM.h"
3738
#include "DataFormatsTPC/Digit.h"
3839
#include "TPCSimulation/Digitizer.h"
3940
#include "TPCSimulation/Detector.h"
@@ -204,6 +205,14 @@ class TPCDPLDigitizerTask : public BaseDPLDigitizer
204205
mDigitizer.setMeanLumiDistortionsDerivative(mMeanLumiDistortionsDerivative);
205206
}
206207
}
208+
if (matcher == ConcreteDataMatcher(o2::header::gDataOriginTPC, "TPCGASPARAM", 0)) {
209+
LOGP(info, "TPC gas param updated");
210+
ParameterGas::Instance().printKeyValues(true, true);
211+
}
212+
if (matcher == ConcreteDataMatcher(o2::header::gDataOriginTPC, "TPCGEMPARAM", 0)) {
213+
LOGP(info, "TPC GEM param updated");
214+
ParameterGEM::Instance().printKeyValues(true, true);
215+
}
207216
}
208217

209218
void run(framework::ProcessingContext& pc)
@@ -215,6 +224,8 @@ class TPCDPLDigitizerTask : public BaseDPLDigitizer
215224
cdb.setUseDefaults(!mUseCalibrationsFromCCDB);
216225
// whatever are global settings for CCDB usage, we have to extract the TPC vdrift from CCDB for anchored simulations
217226
mTPCVDriftHelper.extractCCDBInputs(pc);
227+
pc.inputs().get<ParameterGas*>("gasparam");
228+
pc.inputs().get<ParameterGEM*>("gemparam");
218229
if (mDistortionType) {
219230
pc.inputs().get<SC*>("tpcdistortions");
220231
if (mDistortionType == 2) {
@@ -532,6 +543,8 @@ o2::framework::WorkflowSpec getTPCDigitizerSpec(int nLanes, std::vector<int> con
532543
// add the channel for the GRP information to the first processor
533544
for (auto& spec : pipelines) {
534545
o2::tpc::VDriftHelper::requestCCDBInputs(spec.inputs); // add the same CCDB request to each pipeline
546+
spec.inputs.emplace_back("gasparam", o2::header::gDataOriginTPC, "TPCGASPARAM", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::ParGas)));
547+
spec.inputs.emplace_back("gemparam", o2::header::gDataOriginTPC, "TPCGEMPARAM", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::ParGEM)));
535548
if (distortionType) {
536549
spec.inputs.emplace_back("tpcdistortions", o2::header::gDataOriginTPC, "TPCDIST", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::DistortionMapMC), {}, 1)); // time-dependent
537550
// load derivative map in case scaling was requested

0 commit comments

Comments
 (0)