Skip to content

Commit

Permalink
Write only TRU digits to AOD trig table; Wrong DDL fix in rawConverte…
Browse files Browse the repository at this point in the history
…r; Remove Decompose fail message in clusterizer; fix validity range
  • Loading branch information
Dmitri Peresunko authored and shahor02 committed Apr 13, 2022
1 parent fa2865b commit 4f46f5a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ class CellHelper
{
return cell.getAbsId();
}
// If this cell - trigger one?
static bool isTRU(const o2::emcal::Cell& cell)
{
return cell.getTRU();
}

static bool isTRU(const o2::phos::Cell& cell)
{
return cell.getTRU();
}

static int16_t getFastOrAbsID(const o2::emcal::Cell& cell)
{
Expand All @@ -450,7 +460,7 @@ class CellHelper

static int16_t getFastOrAbsID(const o2::phos::Cell& cell)
{
return cell.getAbsId();
return cell.getTRUId();
}

static float getAmplitude(const o2::emcal::Cell& cell)
Expand Down
16 changes: 9 additions & 7 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1015,12 +1015,14 @@ void AODProducerWorkflowDPL::fillCaloTable(TEventHandler* caloEventHandler, cons
caloType); // 1 = emcal, -1 = undefined, 0 = phos

// todo: fix dummy values in CellHelper when it is clear what is filled for trigger information
caloCellTRGTableCursor(0,
bcID,
CellHelper::getFastOrAbsID(cell),
CellHelper::getLnAmplitude(cell),
CellHelper::getTriggerBits(cell),
caloType);
if (CellHelper::isTRU(cell)) { // Write only trigger cells into this table
caloCellTRGTableCursor(0,
bcID,
CellHelper::getFastOrAbsID(cell),
CellHelper::getLnAmplitude(cell),
CellHelper::getTriggerBits(cell),
caloType);
}
}
}
}
Expand Down Expand Up @@ -1742,7 +1744,7 @@ AODProducerWorkflowDPL::TrackExtraInfo AODProducerWorkflowDPL::processBarrelTrac
auto tofSignal = (tofMatch.getSignal() - exp) * 1e-3; // time in ns wrt TF start
setTrackTime(tofSignal, 0.2, true); // FIXME: calculate actual resolution (if possible?)
}
if (contributorsGID[GIndex::Source::TRD].isIndexSet()) { // ITS-TPC-TRD-TOF, TPC-TRD-TOF, TPC-TRD, ITS-TPC-TRD
if (contributorsGID[GIndex::Source::TRD].isIndexSet()) { // ITS-TPC-TRD-TOF, TPC-TRD-TOF, TPC-TRD, ITS-TPC-TRD
const auto& trdOrig = data.getTrack<o2::trd::TrackTRD>(contributorsGID[GIndex::Source::TRD]); // refitted TRD trac
extraInfoHolder.trdChi2 = trdOrig.getChi2();
extraInfoHolder.trdPattern = getTRDPattern(trdOrig);
Expand Down
3 changes: 2 additions & 1 deletion Detectors/PHOS/calib/src/PHOSHGLGRatioCalibDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void PHOSHGLGRatioCalibDevice::sendOutput(DataAllocator& output)
// prepare all info to be sent to CCDB
auto flName = o2::ccdb::CcdbApi::generateFileName("CalibParams");
std::map<std::string, std::string> md;
o2::ccdb::CcdbObjectInfo info("PHS/Calib/CalibParams", "CalibParams", flName, md, mRunStartTime, 99999999999999);
long validityTime = mRunStartTime + 31622400000; // one year validity range
o2::ccdb::CcdbObjectInfo info("PHS/Calib/CalibParams", "CalibParams", flName, md, mRunStartTime, validityTime);
info.setMetaData(md);
auto image = o2::ccdb::CcdbApi::createObjectImage(mCalibParams.get(), &info);

Expand Down
3 changes: 2 additions & 1 deletion Detectors/PHOS/calib/src/PHOSPedestalCalibDevice.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ void PHOSPedestalCalibDevice::sendOutput(DataAllocator& output)
// prepare all info to be sent to CCDB
auto flName = o2::ccdb::CcdbApi::generateFileName("Pedestals");
std::map<std::string, std::string> md;
o2::ccdb::CcdbObjectInfo info("PHS/Calib/Pedestals", "Pedestals", flName, md, mRunStartTime, 99999999999999);
long validityTime = mRunStartTime + 7776000000; //3 months validity time
o2::ccdb::CcdbObjectInfo info("PHS/Calib/Pedestals", "Pedestals", flName, md, mRunStartTime, validityTime);
info.setMetaData(md);
auto image = o2::ccdb::CcdbApi::createObjectImage(mPedestals.get(), &info);

Expand Down
16 changes: 11 additions & 5 deletions Detectors/PHOS/reconstruction/src/Clusterer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,18 @@ void Clusterer::unfoldOneCluster(Cluster& iniClu, char nMax, std::vector<Cluster
}
// now exact solution for amplitudes
bk.SetMatrix(B);
if (bk.Solve(C)) {
for (int iclu = 0; iclu < nMax; iclu++) {
double eOld = meMax[iclu];
meMax[iclu] = C(iclu);
// insuficientAccuracy|=fabs(meMax[iclu]-eOld)> meMax[iclu]*o2::phos::PHOSSimParams::Instance().mUnfogingEAccuracy ;
if (bk.Decompose()) {
if (bk.Solve(C)) {
for (int iclu = 0; iclu < nMax; iclu++) {
double eOld = meMax[iclu];
meMax[iclu] = C(iclu);
// insuficientAccuracy|=fabs(meMax[iclu]-eOld)> meMax[iclu]*o2::phos::PHOSSimParams::Instance().mUnfogingEAccuracy ;
}
} else {
LOG(warning) << "Failed to decompose matrix of size " << nMax;
}
} else {
LOG(warning) << "Failed to decompose matrix of size " << nMax;
}
insuficientAccuracy &= (chi2 > o2::phos::PHOSSimParams::Instance().mUnfogingChi2Accuracy * nMax);
nIterations++;
Expand Down
2 changes: 1 addition & 1 deletion Detectors/PHOS/workflow/src/RawToCellConverterSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void RawToCellConverterSpec::run(framework::ProcessingContext& ctx)
auto triggerOrbit = o2::raw::RDHUtils::getTriggerOrbit(header);
auto ddl = o2::raw::RDHUtils::getFEEID(header);

if (ddl > o2::phos::Mapping::NDDL || ddl < 0) { // only 14 correct DDLs
if (ddl >= o2::phos::Mapping::NDDL || ddl < 0) { // only 0..13 correct DDLs
LOG(error) << "DDL=" << ddl;
mOutputHWErrors.emplace_back(14, 16, char(ddl)); // Add non-existing DDL as DDL 15
continue; // skip STU ddl
Expand Down

0 comments on commit 4f46f5a

Please sign in to comment.