Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PWGJE/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@

if(FastJet_FOUND)

o2physics_add_dpl_workflow(jet-deriveddata-producer

Check failure on line 16 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-producer does not match its file name derivedDataProducer.cxx. (Matches jetDeriveddataProducer.cxx.)
SOURCES derivedDataProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::EventFilteringUtils O2Physics::AnalysisCCDB
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-trigger-producer

Check failure on line 21 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-trigger-producer does not match its file name derivedDataTriggerProducer.cxx. (Matches jetDeriveddataTriggerProducer.cxx.)
SOURCES derivedDataTriggerProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-selector

Check failure on line 26 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-selector does not match its file name derivedDataSelector.cxx. (Matches jetDeriveddataSelector.cxx.)
SOURCES derivedDataSelector.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-deriveddata-writer

Check failure on line 31 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-deriveddata-writer does not match its file name derivedDataWriter.cxx. (Matches jetDeriveddataWriter.cxx.)
SOURCES derivedDataWriter.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-luminosity-producer

Check failure on line 36 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-luminosity-producer does not match its file name luminosityProducer.cxx. (Matches jetLuminosityProducer.cxx.)
SOURCES luminosityProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-luminosity-calculator

Check failure on line 41 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-luminosity-calculator does not match its file name luminosityCalculator.cxx. (Matches jetLuminosityCalculator.cxx.)
SOURCES luminosityCalculator.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-eventweight-mcd

Check failure on line 46 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-eventweight-mcd does not match its file name jetEventWeightMCD.cxx. (Matches jetEventweightMcd.cxx.)
SOURCES jetEventWeightMCD.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-eventweight-mcp

Check failure on line 51 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-eventweight-mcp does not match its file name jetEventWeightMCP.cxx. (Matches jetEventweightMcp.cxx.)
SOURCES jetEventWeightMCP.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -63,12 +63,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-hf-definition

Check failure on line 66 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-hf-definition does not match its file name heavyFlavourDefinition.cxx. (Matches jetHfDefinition.cxx.)
SOURCES heavyFlavourDefinition.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(jet-taggerhf

Check failure on line 71 in PWGJE/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name jet-taggerhf does not match its file name jetTaggerHF.cxx. (Matches jetTaggerhf.cxx.)
SOURCES jetTaggerHF.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore O2Physics::MLCore
COMPONENT_NAME Analysis)
Expand All @@ -93,7 +93,7 @@

o2physics_add_dpl_workflow(emcal-correction-task
SOURCES emcalCorrectionTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsBase O2::EMCALBase O2::EMCALReconstruction O2::EMCALCalibration
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(emcal-matchedtracks-writer
Expand Down
36 changes: 34 additions & 2 deletions PWGJE/TableProducer/emcalCorrectionTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "EMCALBase/ClusterFactory.h"
#include "EMCALBase/Geometry.h"
#include "EMCALBase/NonlinearityHandler.h"
#include "EMCALCalibration/EMCALTempCalibExtractor.h"
#include "EMCALReconstruction/Clusterizer.h"
#include "Framework/ASoA.h"
#include "Framework/AnalysisDataModel.h"
Expand Down Expand Up @@ -113,6 +114,9 @@ struct EmcalCorrectionTask {
Configurable<float> trackMinPt{"trackMinPt", 0.3, "Minimum pT for tracks to perform track matching, to reduce computing time. Tracks below a certain pT will be loopers anyway."};
Configurable<bool> fillQA{"fillQA", false, "Switch to turn on QA histograms."};
Configurable<bool> useCCDBAlignment{"useCCDBAlignment", false, "EXPERTS ONLY! Switch to use the alignment object stored in CCDB instead of using the default alignment from the global geometry object."};
Configurable<bool> applyTempCalib{"applyTempCalib", false, "Switch to turn on Temperature calibration."};
Configurable<std::string> pathTempCalibCCDB{"pathTempCalibCCDB", "Users/j/jokonig/EMCalTempCalibParams", "Path in the ccdb where slope and intercept for each cell are stored"}; // change to official path as soon as it is available
Configurable<bool> useTempCalibMean{"useTempCalibMean", false, "Switch to turn on Temperature mean calculation instead of median."};

// Require EMCAL cells (CALO type 1)
Filter emccellfilter = aod::calo::caloType == selectedCellType;
Expand Down Expand Up @@ -142,6 +146,10 @@ struct EmcalCorrectionTask {
// EMCal geometry
o2::emcal::Geometry* geometry;

// EMCal cell temperature calibrator
std::unique_ptr<o2::emcal::EMCALTempCalibExtractor> mTempCalibExtractor;
bool mIsTempCalibInitialized = false;

std::vector<std::pair<int, int>> mExtraTimeShiftRunRanges;

// Current run number
Expand Down Expand Up @@ -171,6 +179,10 @@ struct EmcalCorrectionTask {
geometry->SetMisalMatrixFromCcdb();
}

if (applyTempCalib) {
mTempCalibExtractor = std::make_unique<o2::emcal::EMCALTempCalibExtractor>();
}

// read all the cluster definitions specified in the options
if (clusterDefinitions->length()) {
std::stringstream parser(clusterDefinitions.value);
Expand Down Expand Up @@ -316,6 +328,11 @@ struct EmcalCorrectionTask {
// get run number
runNumber = bc.runNumber();

if (applyTempCalib && !mIsTempCalibInitialized) { // needs to be called once
mTempCalibExtractor->InitializeFromCCDB(pathTempCalibCCDB, static_cast<uint64_t>(runNumber));
mIsTempCalibInitialized = true;
}

// Convert aod::Calo to o2::emcal::Cell which can be used with the clusterizer.
// In particular, we need to filter only EMCAL cells.

Expand Down Expand Up @@ -343,6 +360,9 @@ struct EmcalCorrectionTask {
if (applyCellAbsScale) {
amplitude *= getAbsCellScale(cell.cellNumber());
}
if (applyTempCalib) {
amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
}
cellsBC.emplace_back(cell.cellNumber(),
amplitude,
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType()), runNumber),
Expand Down Expand Up @@ -565,6 +585,11 @@ struct EmcalCorrectionTask {
// get run number
runNumber = bc.runNumber();

if (applyTempCalib && !mIsTempCalibInitialized) { // needs to be called once
mTempCalibExtractor->InitializeFromCCDB(pathTempCalibCCDB, static_cast<uint64_t>(runNumber));
mIsTempCalibInitialized = true;
}

auto collisionsInBC = collisions.sliceBy(collisionsPerBC, bc.globalIndex());
auto cellsInBC = cells.sliceBy(cellsPerFoundBC, bc.globalIndex());

Expand All @@ -578,9 +603,16 @@ struct EmcalCorrectionTask {
std::vector<o2::emcal::Cell> cellsBC;
std::vector<int64_t> cellIndicesBC;
for (const auto& cell : cellsInBC) {
auto amplitude = cell.amplitude();
if (static_cast<bool>(hasShaperCorrection) && emcal::intToChannelType(cell.cellType()) == emcal::ChannelType_t::LOW_GAIN) { // Apply shaper correction to LG cells
amplitude = o2::emcal::NonlinearityHandler::evaluateShaperCorrectionCellEnergy(amplitude);
}
if (applyTempCalib) {
amplitude *= mTempCalibExtractor->getGainCalibFactor(static_cast<uint16_t>(cell.cellNumber()));
}
cellsBC.emplace_back(cell.cellNumber(),
cell.amplitude(),
cell.time() + getCellTimeShift(cell.cellNumber(), cell.amplitude(), o2::emcal::intToChannelType(cell.cellType()), runNumber),
amplitude,
cell.time() + getCellTimeShift(cell.cellNumber(), amplitude, o2::emcal::intToChannelType(cell.cellType()), runNumber),
o2::emcal::intToChannelType(cell.cellType()));
cellIndicesBC.emplace_back(cell.globalIndex());
}
Expand Down
Loading