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
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ DataProcessorSpec getCosmicsMatchingSpec(GTrackID::mask_t src, bool useMC)

dataRequest->requestTracks(src, useMC);
dataRequest->requestClusters(src, false); // no MC labels for clusters needed for refit only
dataRequest->inputs.emplace_back("cldict", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary"));

outputs.emplace_back("GLO", "COSMICTRC", 0, Lifetime::Timeframe);
if (useMC) {
Expand Down
22 changes: 9 additions & 13 deletions Detectors/ITSMFT/ITS/macros/test/RunGPUTracking.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "ITStracking/Vertexer.h"
#include "MathUtils/Utils.h"
#include "DetectorsBase/Propagator.h"
#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CCDBTimeStampUtils.h"

#include "SimulationDataFormat/MCCompLabel.h"
#include "SimulationDataFormat/MCTruthContainer.h"
Expand All @@ -38,9 +40,9 @@ void RunGPUTracking(bool useLUT = true,
std::string path = "./",
std::string outputfile = "o2trac_its.root",
std::string inputClustersITS = "o2clus_its.root",
std::string dictfile = "",
std::string matLUTFile = "matbud.root",
std::string inputGRP = "o2sim_grp.root")
std::string inputGRP = "o2sim_grp.root",
long timestamp = 0)
{
o2::its::ROframe event(0, 7);

Expand Down Expand Up @@ -81,6 +83,11 @@ void RunGPUTracking(bool useLUT = true,
gman->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::T2GRot,
o2::math_utils::TransformType::L2G)); // request cached transforms

auto& mgr = o2::ccdb::BasicCCDBManager::instance();
mgr.setURL("http://alice-ccdb.cern.ch");
mgr.setTimestamp(timestamp ? timestamp : o2::ccdb::getCurrentTimestamp());
const o2::itsmft::TopologyDictionary* dict = mgr.get<o2::itsmft::TopologyDictionary>("ITS/Calib/ClusterDictionary");

//>>>---------- attach input data --------------->>>
TChain itsClusters("o2sim");
itsClusters.AddFile((path + inputClustersITS).data());
Expand Down Expand Up @@ -118,17 +125,6 @@ void RunGPUTracking(bool useLUT = true,
itsClusters.SetBranchAddress("ITSClustersROF", &rofs);
itsClusters.GetEntry(0);

o2::itsmft::TopologyDictionary dict;
if (dictfile.empty()) {
dictfile = o2::base::DetectorNameConf::getAlpideClusterDictionaryFileName(o2::detectors::DetID::ITS, "");
}
std::ifstream file(dictfile.c_str());
if (file.good()) {
LOG(info) << "Running with dictionary: " << dictfile.c_str();
dict.readFromFile(dictfile);
} else {
LOG(info) << "Running without dictionary !";
}
//-------------------------------------------------
std::unique_ptr<o2::gpu::GPUReconstruction> recCUDA(o2::gpu::GPUReconstruction::CreateInstance(o2::gpu::GPUDataTypes::DeviceType::CUDA, true));
auto* chainITSCUDA = recCUDA->AddChain<o2::gpu::GPUChainITS>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class EntropyDecoderSpec : public o2::framework::Task
bool mUseClusterDictionary{true};

std::string mCTFDictPath{};
std::string mClusDictPath{};
TStopwatch mTimer;
};

Expand Down
2 changes: 0 additions & 2 deletions Detectors/ITSMFT/common/workflow/src/EntropyDecoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ void EntropyDecoderSpec::init(o2::framework::InitContext& ic)
{
auto detID = mOrigin == o2::header::gDataOriginITS ? o2::detectors::DetID::ITS : o2::detectors::DetID::MFT;
mCTFDictPath = ic.options().get<std::string>("ctf-dict");
mClusDictPath = o2::header::gDataOriginITS ? o2::itsmft::ClustererParam<o2::detectors::DetID::ITS>::Instance().dictFilePath : o2::itsmft::ClustererParam<o2::detectors::DetID::MFT>::Instance().dictFilePath;
mClusDictPath = o2::base::DetectorNameConf::getAlpideClusterDictionaryFileName(detID, mClusDictPath);
mMaskNoise = ic.options().get<bool>("mask-noise");
mUseClusterDictionary = !ic.options().get<bool>("ignore-cluster-dictionary");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ class DetectorData
{
public:
void init();
void setITSDict(const o2::itsmft::TopologyDictionary* d);
void setMFTDict(const o2::itsmft::TopologyDictionary* d);

o2::itsmft::TopologyDictionary mITSDict;
o2::itsmft::TopologyDictionary mMFTDict;
const o2::itsmft::TopologyDictionary* mITSDict = nullptr;
const o2::itsmft::TopologyDictionary* mMFTDict = nullptr;
std::unique_ptr<EveConfiguration> mConfig;
std::unique_ptr<o2::trd::GeometryFlat> mTrdGeo;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ class EveWorkflowHelper
void drawTRDClusters(const o2::trd::TrackTRD& trc, float trackTime);
void drawTOFClusters(GID gid, float trackTime);
void drawPoint(float x, float y, float z, float trackTime) { mEvent.addCluster(x, y, z, trackTime); }
void prepareITSClusters(const o2::itsmft::TopologyDictionary& dict); // fills mITSClustersArray
void prepareMFTClusters(const o2::itsmft::TopologyDictionary& dict); // fills mMFTClustersArray
void prepareITSClusters(const o2::itsmft::TopologyDictionary* dict); // fills mITSClustersArray
void prepareMFTClusters(const o2::itsmft::TopologyDictionary* dict); // fills mMFTClustersArray
void clear() { mEvent.clear(); }

void save(const std::string& jsonPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ class O2DPLDisplaySpec : public o2::framework::Task
void init(o2::framework::InitContext& ic) final;
void run(o2::framework::ProcessingContext& pc) final;
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final;

private:
void updateTimeDependentParams(o2::framework::ProcessingContext& pc);

bool mUseMC = false;
bool mEveHostNameMatch; // empty or correct hostname
std::string mJsonPath; // folder where files are stored
Expand Down
32 changes: 12 additions & 20 deletions EventVisualisation/Workflow/src/DetectorData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,6 @@ void DetectorData::init()
mTrdGeo.reset(new o2::trd::GeometryFlat(*gm));
mConfig->configCalib.trdGeometry = mTrdGeo.get();

std::string dictFileITS = o2::itsmft::ClustererParam<o2::detectors::DetID::ITS>::Instance().dictFilePath;
dictFileITS = o2::base::DetectorNameConf::getAlpideClusterDictionaryFileName(o2::detectors::DetID::ITS, dictFileITS);
if (o2::utils::Str::pathExists(dictFileITS)) {
mITSDict.readFromFile(dictFileITS);
LOG(info) << "Running with provided ITS clusters dictionary: " << dictFileITS;
} else {
LOG(info) << "Dictionary " << dictFileITS << " is absent, ITS expects cluster patterns for all clusters";
}
mConfig->configCalib.itsPatternDict = &mITSDict;

std::string dictFileMFT = o2::itsmft::ClustererParam<o2::detectors::DetID::MFT>::Instance().dictFilePath;
dictFileMFT = o2::base::DetectorNameConf::getAlpideClusterDictionaryFileName(o2::detectors::DetID::MFT, dictFileMFT);
if (o2::utils::Str::pathExists(dictFileMFT)) {
mMFTDict.readFromFile(dictFileMFT);
LOG(info) << "Running with provided MFT clusters dictionary: " << dictFileMFT;
} else {
LOG(info) << "Dictionary " << dictFileMFT << " is absent, MFT expects cluster patterns for all clusters";
}
mConfig->configCalib.mftPatternDict = &mMFTDict;

o2::tof::Geo::Init();

o2::its::GeometryTGeo::Instance()->fillMatrixCache(
Expand All @@ -77,3 +57,15 @@ void DetectorData::init()
o2::math_utils::TransformType::L2G,
o2::math_utils::TransformType::T2L));
}

void DetectorData::setITSDict(const o2::itsmft::TopologyDictionary* d)
{
mITSDict = d;
mConfig->configCalib.itsPatternDict = d;
}

void DetectorData::setMFTDict(const o2::itsmft::TopologyDictionary* d)
{
mMFTDict = d;
mConfig->configCalib.mftPatternDict = d;
}
8 changes: 4 additions & 4 deletions EventVisualisation/Workflow/src/EveWorkflowHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -198,27 +198,27 @@ void EveWorkflowHelper::addTrackToEvent(const o2::track::TrackParCov& tr, GID gi
}
}

void EveWorkflowHelper::prepareITSClusters(const o2::itsmft::TopologyDictionary& dict)
void EveWorkflowHelper::prepareITSClusters(const o2::itsmft::TopologyDictionary* dict)
{
const auto& ITSClusterROFRec = mRecoCont.getITSClustersROFRecords();
const auto& clusITS = mRecoCont.getITSClusters();
if (clusITS.size() && ITSClusterROFRec.size()) {
const auto& patterns = mRecoCont.getITSClustersPatterns();
auto pattIt = patterns.begin();
mITSClustersArray.reserve(clusITS.size());
o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray, &dict);
o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray, dict);
}
}

void EveWorkflowHelper::prepareMFTClusters(const o2::itsmft::TopologyDictionary& dict) // do we also have something as ITS...dict?
void EveWorkflowHelper::prepareMFTClusters(const o2::itsmft::TopologyDictionary* dict) // do we also have something as ITS...dict?
{
const auto& MFTClusterROFRec = this->mRecoCont.getMFTClustersROFRecords();
const auto& clusMFT = this->mRecoCont.getMFTClusters();
if (clusMFT.size() && MFTClusterROFRec.size()) {
const auto& patterns = this->mRecoCont.getMFTClustersPatterns();
auto pattIt = patterns.begin();
this->mMFTClustersArray.reserve(clusMFT.size());
o2::mft::ioutils::convertCompactClusters(clusMFT, pattIt, this->mMFTClustersArray, &dict);
o2::mft::ioutils::convertCompactClusters(clusMFT, pattIt, this->mMFTClustersArray, dict);
}
}

Expand Down
19 changes: 19 additions & 0 deletions EventVisualisation/Workflow/src/O2DPLDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc)
return; // skip this run - it is too often
}
this->mTimeStamp = currentTime;
updateTimeDependentParams(pc);

EveWorkflowHelper helper;
helper.getRecoContainer().collectData(pc, *mDataRequest);
Expand All @@ -102,6 +103,24 @@ void O2DPLDisplaySpec::endOfStream(EndOfStreamContext& ec)
{
}

void O2DPLDisplaySpec::updateTimeDependentParams(ProcessingContext& pc)
{
// pc.inputs().get<o2::itsmft::TopologyDictionary*>("cldictITS"); // called by the RecoContainer
// pc.inputs().get<o2::itsmft::TopologyDictionary*>("cldictMFT"); // called by the RecoContainer
}

void O2DPLDisplaySpec::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
{
if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) {
LOG(info) << "ITS cluster dictionary updated";
mData.setITSDict((const o2::itsmft::TopologyDictionary*)obj);
}
if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) {
LOG(info) << "MFT cluster dictionary updated";
mData.setMFTDict((const o2::itsmft::TopologyDictionary*)obj);
}
}

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
LOG(info) << "------------------------ defineDataProcessing " << O2DPLDisplaySpec::mWorkflowVersion << " ------------------------------------";
Expand Down