From 8bc9df3db5c4af1d386592021ecee14560633cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= <26327373+vkucera@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:28:28 +0100 Subject: [PATCH] EMCAL: Delete unused files --- DataFormats/Detectors/EMCAL/doxymodules.h | 16 -- .../DataFormatsEMCAL/EMCALChannelData.h | 55 ------ .../Detectors/EMCAL/src/EMCALChannelData.cxx | 19 -- .../calib/test/testBadChannelScaleFactors.cxx | 65 ------- Detectors/EMCAL/doxymodules.h | 83 --------- .../reconstruction/run/rawReaderTRUDigits.cxx | 171 ------------------ 6 files changed, 409 deletions(-) delete mode 100644 DataFormats/Detectors/EMCAL/doxymodules.h delete mode 100644 DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/EMCALChannelData.h delete mode 100644 DataFormats/Detectors/EMCAL/src/EMCALChannelData.cxx delete mode 100644 Detectors/EMCAL/calib/test/testBadChannelScaleFactors.cxx delete mode 100644 Detectors/EMCAL/doxymodules.h delete mode 100644 Detectors/EMCAL/reconstruction/run/rawReaderTRUDigits.cxx diff --git a/DataFormats/Detectors/EMCAL/doxymodules.h b/DataFormats/Detectors/EMCAL/doxymodules.h deleted file mode 100644 index ed9087569f8c7..0000000000000 --- a/DataFormats/Detectors/EMCAL/doxymodules.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/** - * @defgroup EMCALDataFormat EMCAL data format - * @ingroup DetectorEMCAL - * @brief Data format for EMCAL - */ \ No newline at end of file diff --git a/DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/EMCALChannelData.h b/DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/EMCALChannelData.h deleted file mode 100644 index 3c014d37e6f9e..0000000000000 --- a/DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/EMCALChannelData.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file EMCALChannelData.h -/// \brief - -/// \class EMCALChannelCalibrator -/// \brief Class to store the data format for calibraton of the EMCal -/// \author Hannah Bossi, Yale University -/// \ingroup DetectorEMCAL -/// \since Feb 11, 2021 - -#ifndef ALICEO2_EMCALCHANNELDATA_H -#define ALICEO2_EMCALCHANNELDATA_H - -#include "Rtypes.h" - -namespace o2 -{ -namespace dataformats -{ -class EMCALChannelData -{ - public: - EMCALChannelData(int cellID, int timestamp, int flags = 0, int events) : mEMCALCellID(cellID), mTimestamp(timestamp), mFlags(flags){}; - EMCALChannelData() = default; - ~EMCALChannelData() = default; - - void setEMCALCellID(int index) { mEMCALCellID = index; } - int getEMCALCellID() const { return mEMCALCellID; } - - void setTimestamp(int ts) { mTimestamp = ts; } - int getTimestamp() const { return mTimestamp; } - - void setFlags(int flags) { mFlags = flags; } - float getFlags() const { return mFlags; } - - private: - int mEMCALCellID; ///< EMCal Cell ID - int mTimestamp; ///< timestamp in seconds - unsigned char mFlags; ///< bit mask with quality flags (to be defined) - - ClassDefNV(EMCALChannelData, 1); -}; -} // namespace dataformats -} // namespace o2 -#endif diff --git a/DataFormats/Detectors/EMCAL/src/EMCALChannelData.cxx b/DataFormats/Detectors/EMCAL/src/EMCALChannelData.cxx deleted file mode 100644 index 8affa29259f7a..0000000000000 --- a/DataFormats/Detectors/EMCAL/src/EMCALChannelData.cxx +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file EMCALChannelData.cxx -/// \brief Class to store the data format for calibraton of the EMCal - -#include "DataFormatsEMCAL/EMCALChannelData.h" - -using namespace o2::dataformats; - -ClassImp(o2::dataformats::EMCALChannelData; diff --git a/Detectors/EMCAL/calib/test/testBadChannelScaleFactors.cxx b/Detectors/EMCAL/calib/test/testBadChannelScaleFactors.cxx deleted file mode 100644 index af0019ba7e593..0000000000000 --- a/Detectors/EMCAL/calib/test/testBadChannelScaleFactors.cxx +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -#define BOOST_TEST_MODULE Test_EMCAL_Calib -#define BOOST_TEST_MAIN -#define BOOST_TEST_DYN_LINK -#include -#include "EMCALCalib/BadChannelMap.h" -#include "EMCALCalib/EMCALChannelScaleFactors.h" -#include "EMCALBase/Geometry.h" - -#include - -namespace o2 -{ - -namespace emcal -{ - -BOOST_AUTO_TEST_CASE(BadChannelScaleFactor_test) -{ - - auto geo = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); - - struct BadChannelScaleFactorTest { - BadChannelScaleFactorTest(int id, float e, float scale) : cellID(id), energy(e), scaleFactor(scale) {} - int cellID; - float energy; - float scaleFactor; - }; - - std::vector vecEnergyIntervals = {0., 1., 5., 10., 10000}; - std::vector vecScaleFactors; - o2::emcal::EMCALChannelScaleFactors scaleFactors; - - for (int iCell = 0; iCell < geo->GetNCells(); iCell++) { - float energy = 100 * ((double)rand() / (RAND_MAX)); - float scaleFactor = 1.0 + 0.1 * ((double)rand() / (RAND_MAX)); - vecScaleFactors.push_back(BadChannelScaleFactorTest(iCell, energy, scaleFactor)); - - // find index of energy interval - auto it = std::find_if(vecEnergyIntervals.begin(), vecEnergyIntervals.end(), [&](float energyInterval) { - return energy < energyInterval; - }); - // cout << "iCell: " << iCell << " energy: " << energy << " scaleFactor: " << scaleFactor << " energyInterval: " << *it << endl; - - scaleFactors.insertVal(iCell, vecEnergyIntervals[*it], vecEnergyIntervals[*it + 1], scaleFactor); - } - - for (auto& scaleFactor : vecScaleFactors) { - float scaleFactorFromMap = scaleFactors.getScaleVal(scaleFactor.cellID, scaleFactor.energy); - BOOST_CHECK_CLOSE(scaleFactor.scaleFactor, scaleFactorFromMap, 0.0001); - } -} -} // namespace emcal - -} // namespace o2 \ No newline at end of file diff --git a/Detectors/EMCAL/doxymodules.h b/Detectors/EMCAL/doxymodules.h deleted file mode 100644 index 90c822264f6cd..0000000000000 --- a/Detectors/EMCAL/doxymodules.h +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/** - * @defgroup DetectorEMCAL EMCAL - * @brief EMCAL simulation and reconstruction - * - * See \ref refDetectorsEMCAL for more information - */ - -/** - * @defgroup EMCALbase EMCAL base - * @brief Main EMCAL components - * @ingroup DetectorEMCAL - * - * Main EMCAL components used in various libraries - * - Geometry - * - Mapping - * - Basic data types not part of the EMCAL format - */ - -/** - * @defgroup EMCALcalibration EMCAL calibration - * @brief EMCAL calibration objects - * @ingroup DetectorEMCAL - * - * EMCAL calibration objects for - * - Bad channel map - * - Time calibration - * - Time slewing parameters - * - Gain calibration - * - Temperature calibration - * - FEE DCS parameters - * - Pedestal data - * In addition providing an interface convenient CCDB access and methods - * to recalibrate add cell level. - */ - -/** - * @defgroup EMCALcalib EMCAL calib - * @brief EMCAL bad channel calibration - * @ingroup DetectorEMCAL - * - * EMCAL calibrator performing - * - Bad channel calibration - * - Time calibration - * and corresponding workflows for calibration tasks. - */ - -/** - * @defgroup EMCALsimulation EMCAL simulation - * @brief EMCAL simulation code - * @ingroup DetectorEMCAL - * - * EMCAL simulation package. See \ref refEMCALsimulation - * for more information - */ - -/** - * @defgroup EMCALreconstruction EMCAL reconstruction - * @brief EMCAL reconstruction code - * @ingroup DetectorEMCAL - * - * EMCAL reconstruction package. See \ref refEMCALreconstruction - * for more information - */ - -/** - * @defgroup EMCALworkflow EMCAL workflow - * @brief EMCAL reconstruction workflow - * @ingroup DetectorEMCAL - * - * EMCAL reconstruction workflow package. See \ref refEMCALworkflow - * for more information. - */ \ No newline at end of file diff --git a/Detectors/EMCAL/reconstruction/run/rawReaderTRUDigits.cxx b/Detectors/EMCAL/reconstruction/run/rawReaderTRUDigits.cxx deleted file mode 100644 index 6fc119dc69521..0000000000000 --- a/Detectors/EMCAL/reconstruction/run/rawReaderTRUDigits.cxx +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file rawReaderFileNew.cxx -/// \author Markus Fasel , Oak Ridge National Laboratory - -#include -#include - -#include - -#include "DetectorsRaw/RawFileReader.h" -#include "DetectorsRaw/RDHUtils.h" -#include "EMCALBase/Mapper.h" -#include "EMCALBase/TriggerMappingV2.h" -#include "EMCALReconstruction/AltroDecoder.h" -#include "EMCALReconstruction/RawReaderMemory.h" -#include - -namespace bpo = boost::program_options; -// using namespace o2::emcal; - -int main(int argc, char** argv) -{ - bpo::variables_map vm; - bpo::options_description opt_general("Usage:\n " + std::string(argv[0]) + - " \n" - " Tool will decode the DDLx data for EMCAL 0\n" - "Commands / Options"); - bpo::options_description opt_hidden(""); - bpo::options_description opt_all; - bpo::positional_options_description opt_pos; - - try { - auto add_option = opt_general.add_options(); - add_option("help,h", "Print this help message"); - add_option("verbose,v", bpo::value()->default_value(0), "Select verbosity level [0 = no output]"); - add_option("version", "Print version information"); - add_option("input-file,i", bpo::value()->required(), "Specifies input file."); - add_option("debug,d", bpo::value()->default_value(0), "Select debug output level [0 = no debug output]"); - - opt_all.add(opt_general).add(opt_hidden); - bpo::store(bpo::command_line_parser(argc, argv).options(opt_all).positional(opt_pos).run(), vm); - - if (vm.count("help") || argc == 1) { - std::cout << opt_general << std::endl; - exit(0); - } - - if (vm.count("version")) { - // std::cout << GitInfo(); - exit(0); - } - - bpo::notify(vm); - } catch (bpo::error& e) { - std::cerr << "ERROR: " << e.what() << std::endl - << std::endl; - std::cerr << opt_general << std::endl; - exit(1); - } catch (std::exception& e) { - std::cerr << e.what() << ", application will now exit" << std::endl; - exit(2); - } - - auto rawfilename = vm["input-file"].as(); - - o2::raw::RawFileReader reader; - reader.setDefaultDataOrigin(o2::header::gDataOriginEMC); - reader.setDefaultDataDescription(o2::header::gDataDescriptionRawData); - reader.setDefaultReadoutCardType(o2::raw::RawFileReader::RORC); - reader.addFile(rawfilename); - reader.init(); - - o2::emcal::MappingHandler mapper; - o2::emcal::TriggerMappingV2 triggermapping; - - std::unique_ptr treefile(TFile::Open("trudata.root", "RECREATE")); - TTree trudata("trudata", "Tree with TRU data"); - // branches in tree - struct collisiontrigger { - unsigned long bc; - unsigned long orbit; - } mycollision; - int absFastOR; - int starttime; - std::vector timesamples; - tree->Branch(&mycollision, "collisiontrigger", "bc,orbit/l"); - tree->Branch(&starttime, "starttime", "starttime/i"); - tree->Branch(×amples, "timesamples", ""); // @todo check how to write std::vector to tree; - - while (1) { - int tfID = reader.getNextTFToRead(); - if (tfID >= reader.getNTimeFrames()) { - LOG(info) << "nothing left to read after " << tfID << " TFs read"; - break; - } - std::vector dataBuffer; // where to put extracted data - for (int il = 0; il < reader.getNLinks(); il++) { - auto& link = reader.getLink(il); - std::cout << "Decoding link " << il << std::endl; - - auto sz = link.getNextTFSize(); // size in bytes needed for the next TF of this link - dataBuffer.resize(sz); - link.readNextTF(dataBuffer.data()); - - // Parse - o2::emcal::RawReaderMemory parser(dataBuffer); - while (parser.hasNext()) { - parser.next(); - auto rdh = parser.getRawHeader(); - auto ddl = o2::raw::RDHUtils::getFEEID(parser.getRawHeader()); - // Exclude STU DDLs - if (ddl >= 40) { - continue; - } - - mycollision.bc = o2::raw::RDHUtils::getTriggerBC(rdh); - mycollision.orbit = o2::raw::RDHUtils::getTriggerOrbit(rdh); - - o2::emcal::AltroDecoder decoder(parser); - decoder.decode(); - auto& ddlmapping = mapper.getMappingForDDL(ddl); - - std::cout << decoder.getRCUTrailer() << std::endl; - for (auto& chan : decoder.getChannels()) { - if (ddlmapping.getChannelType(chan.getHardwareAddress) != o2::emcal::ChannelType_t::TRU) { - continue; - } - std::cout << "Hw address: " << chan.getHardwareAddress() << std::endl; - // Get absolute FastOR index - this will tell us where on the EMCAL surface the FastOR is - // TRU index is encoded in column, needs to be converted to an absoluted FastOR ID via the - // trigger mapping. The absoluted FastOR ID can be connected via the geometry to tower IDs - // from the FEC data. - // we are only interested in the FastORs for now, skip patches starting from 96 - auto fastorInTRU = ddlmapping.getColumn(chan.getHardwareAddress()); - if (fastorInTRU >= 96) { - // indices starting from 96 encode patches, not FastORs - continue; - } - auto truindex = triggermapping.getTRUIndexFromOnlineHardareAddree(chan.getHardwareAddress(), ddl, ddl / 2); - auto absFastOrID = triggermapping.getAbsFastORIndexFromIndexInTRU(truindex, fastorInTRU); - - for (auto& bunch : chan.getBunches()) { - std::cout << "BunchLength: " << int(bunch.getBunchLength()) << std::endl; - auto adcs = bunch.getADC(); - int time = bunch.getStartTime(); - starttime = time; - timesamples.clear(); - timesamples.resize(adcs.size()); - std::copy(adcs.begin(), adcs.end(), timesamples.begin()); - trudata.Fill(); - for (int i = adcs.size() - 1; i >= 0; i--) { - std::cout << "Timebin " << time << ", ADC " << adcs[i] << std::endl; - time--; - } - } - } - } - } - reader.setNextTFToRead(++tfID); - } -} \ No newline at end of file