Skip to content

Commit 2de9c5c

Browse files
matthias-kleinersawenzel
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 b63541a commit 2de9c5c

File tree

10 files changed

+50
-4
lines changed

10 files changed

+50
-4
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
@@ -47,6 +47,16 @@ struct ParameterGas : public o2::conf::ConfigurableParamHelper<ParameterGas> {
4747
};
4848

4949
} // namespace tpc
50+
51+
namespace framework
52+
{
53+
template <typename T>
54+
struct is_messageable;
55+
template <>
56+
struct is_messageable<o2::tpc::ParameterGas> : std::true_type {
57+
};
58+
} // namespace framework
59+
5060
} // namespace o2
5161

5262
#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
@@ -72,6 +72,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
7272
{"filtered-input", VariantType::Bool, false, {"Filtered tracks, clusters input, prefix dataDescriptors with F"}},
7373
{"select-ir-frames", VariantType::Bool, false, {"Subscribe and filter according to external IR Frames"}},
7474
{"tpc-deadMap-sources", VariantType::Int, -1, {"Sources to consider for TPC dead channel map creation; -1=all, 0=deactivated"}},
75+
{"tpc-mc-time-gain", VariantType::Bool, false, {"use time gain calibration for MC (true) or for data (false)"}},
7576
};
7677
o2::tpc::CorrectionMapsLoader::addGlobalOptions(options);
7778
o2::raw::HBFUtilsInitializer::addConfigOption(options);
@@ -185,7 +186,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
185186
!cfgc.options().get<bool>("ignore-dist-stf"), //
186187
cfgc.options().get<bool>("select-ir-frames"),
187188
cfgc.options().get<bool>("filtered-input"),
188-
cfgc.options().get<int>("tpc-deadMap-sources"));
189+
cfgc.options().get<int>("tpc-deadMap-sources"),
190+
cfgc.options().get<bool>("tpc-mc-time-gain"));
189191

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

GPU/Workflow/include/GPUWorkflow/GPUWorkflowSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class GPURecoWorkflowSpec : public o2::framework::Task
107107
bool enableCTPLumi = false;
108108
int32_t enableDoublePipeline = 0;
109109
int32_t tpcDeadMapSources = -1;
110+
bool tpcUseMCTimeGain = false; // use time gain calibration for MC (true) or from data (false)
110111
bool decompressTPC = false;
111112
bool decompressTPCFromROOT = false;
112113
bool caClusterer = false;

GPU/Workflow/src/GPUWorkflowSpec.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,11 @@ Inputs GPURecoWorkflowSpec::inputs()
11091109
}
11101110
inputs.emplace_back("tpcgain", gDataOriginTPC, "PADGAINFULL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalPadGainFull)));
11111111
inputs.emplace_back("tpcgainresidual", gDataOriginTPC, "PADGAINRESIDUAL", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalPadGainResidual), {}, 1)); // time-dependent
1112-
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGain), {}, 1)); // time-dependent
1112+
if (mSpecConfig.tpcUseMCTimeGain) {
1113+
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGainMC), {}, 1)); // time-dependent
1114+
} else {
1115+
inputs.emplace_back("tpctimegain", gDataOriginTPC, "TIMEGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTimeGain), {}, 1)); // time-dependent
1116+
}
11131117
inputs.emplace_back("tpctopologygain", gDataOriginTPC, "TOPOLOGYGAIN", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::CalTopologyGain)));
11141118
inputs.emplace_back("tpcthreshold", gDataOriginTPC, "PADTHRESHOLD", 0, Lifetime::Condition, ccdbParamSpec("TPC/Config/FEEPad"));
11151119
o2::tpc::VDriftHelper::requestCCDBInputs(inputs);

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

Lines changed: 2 additions & 0 deletions
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);
@@ -185,6 +186,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
185186
cfg.tpcTriggerHandling = isEnabled(outputTypes, ioType::TPCTriggers) || cfg.caClusterer;
186187
cfg.enableDoublePipeline = cfgc.options().get<bool>("enableDoublePipeline");
187188
cfg.tpcDeadMapSources = cfgc.options().get<int32_t>("tpc-deadMap-sources");
189+
cfg.tpcUseMCTimeGain = cfgc.options().get<bool>("tpc-mc-time-gain");
188190
cfg.runITSTracking = isEnabled(outputTypes, ioType::ITSTracks);
189191
cfg.itsOverrBeamEst = isEnabled(inputTypes, ioType::MeanVertex);
190192

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"
@@ -207,6 +208,14 @@ class TPCDPLDigitizerTask : public BaseDPLDigitizer
207208
mDigitizer.setMeanLumiDistortionsDerivative(mMeanLumiDistortionsDerivative);
208209
}
209210
}
211+
if (matcher == ConcreteDataMatcher(o2::header::gDataOriginTPC, "TPCGASPARAM", 0)) {
212+
LOGP(info, "TPC gas param updated");
213+
ParameterGas::Instance().printKeyValues(true, true);
214+
}
215+
if (matcher == ConcreteDataMatcher(o2::header::gDataOriginTPC, "TPCGEMPARAM", 0)) {
216+
LOGP(info, "TPC GEM param updated");
217+
ParameterGEM::Instance().printKeyValues(true, true);
218+
}
210219
}
211220

212221
void run(framework::ProcessingContext& pc)
@@ -218,6 +227,8 @@ class TPCDPLDigitizerTask : public BaseDPLDigitizer
218227
cdb.setUseDefaults(!mUseCalibrationsFromCCDB);
219228
// whatever are global settings for CCDB usage, we have to extract the TPC vdrift from CCDB for anchored simulations
220229
mTPCVDriftHelper.extractCCDBInputs(pc);
230+
pc.inputs().get<ParameterGas*>("gasparam");
231+
pc.inputs().get<ParameterGEM*>("gemparam");
221232
if (mDistortionType) {
222233
pc.inputs().get<SC*>("tpcdistortions");
223234
if (mDistortionType == 2) {
@@ -539,6 +550,8 @@ o2::framework::WorkflowSpec getTPCDigitizerSpec(int nLanes, std::vector<int> con
539550
// add the channel for the GRP information to the first processor
540551
for (auto& spec : pipelines) {
541552
o2::tpc::VDriftHelper::requestCCDBInputs(spec.inputs); // add the same CCDB request to each pipeline
553+
spec.inputs.emplace_back("gasparam", o2::header::gDataOriginTPC, "TPCGASPARAM", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::ParGas)));
554+
spec.inputs.emplace_back("gemparam", o2::header::gDataOriginTPC, "TPCGEMPARAM", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::ParGEM)));
542555
if (distortionType) {
543556
spec.inputs.emplace_back("tpcdistortions", o2::header::gDataOriginTPC, "TPCDIST", 0, Lifetime::Condition, ccdbParamSpec(o2::tpc::CDBTypeMap.at(o2::tpc::CDBType::DistortionMapMC), {}, 1)); // time-dependent
544557
// load derivative map in case scaling was requested

0 commit comments

Comments
 (0)