Skip to content

Commit

Permalink
mv calib api and event maker to tof base
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Nov 22, 2021
1 parent f3c6fd9 commit d3d2ce4
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CalibTimeSlewingParamTOF

CalibTimeSlewingParamTOF();

CalibTimeSlewingParamTOF(const CalibTimeSlewingParamTOF& source) = default;
CalibTimeSlewingParamTOF(const CalibTimeSlewingParamTOF& source);

CalibTimeSlewingParamTOF& operator=(const CalibTimeSlewingParamTOF& source) = default;

Expand Down
13 changes: 13 additions & 0 deletions DataFormats/Detectors/TOF/src/CalibTimeSlewingParamTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,20 @@ CalibTimeSlewingParamTOF& CalibTimeSlewingParamTOF::operator+=(const CalibTimeSl
(*(mChannelStart[i])) = (*(other.mChannelStart[i]));
*(mFractionUnderPeak[i]) = *(other.mFractionUnderPeak[i]);
*(mSigmaPeak[i]) = *(other.mSigmaPeak[i]);
*(mGlobalOffset[i]) = *(other.mGlobalOffset[i]);
}
}
return *this;
}
//______________________________________________
CalibTimeSlewingParamTOF::CalibTimeSlewingParamTOF(const CalibTimeSlewingParamTOF& source)
{
bind();
for (int i = 0; i < NSECTORS; i++) {
*(mTimeSlewing[i]) = *(source.mTimeSlewing[i]);
(*(mChannelStart[i])) = (*(source.mChannelStart[i]));
*(mFractionUnderPeak[i]) = *(source.mFractionUnderPeak[i]);
*(mSigmaPeak[i]) = *(source.mSigmaPeak[i]);
*(mGlobalOffset[i]) = *(source.mGlobalOffset[i]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "TOFBase/Geo.h"
#include "TOFBase/Utils.h"
#include "DataFormatsTOF/Cluster.h"
#include "TOFReconstruction/EventTimeMaker.h"
#include "TOFBase/EventTimeMaker.h"
//#include "GlobalTracking/MatchTOF.h"
#include "GlobalTrackingWorkflow/TOFEventTimeChecker.h"

Expand Down
5 changes: 4 additions & 1 deletion Detectors/TOF/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ o2_add_library(TOFBase
src/Strip.cxx
src/WindowFiller.cxx
src/Utils.cxx
src/CalibTOFapi.cxx
src/EventTimeMaker.cxx
PUBLIC_LINK_LIBRARIES Boost::serialization FairRoot::Base Microsoft.GSL::GSL
O2::DetectorsBase O2::CommonDataFormat O2::DetectorsRaw
O2::DataFormatsTOF)

o2_target_root_dictionary(TOFBase
HEADERS include/TOFBase/Geo.h include/TOFBase/Digit.h include/TOFBase/Utils.h
include/TOFBase/Strip.h include/TOFBase/WindowFiller.h)
include/TOFBase/Strip.h include/TOFBase/WindowFiller.h include/TOFBase/CalibTOFapi.h
include/TOFBase/EventTimeMaker.h)

o2_add_test(TOFIndex
SOURCES test/testTOFIndex.cxx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "FairLogger.h" // for LOG

using namespace o2::tof;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "TRandom.h"
#include "TMath.h"
#include "TOFReconstruction/EventTimeMaker.h"
#include "TOFBase/EventTimeMaker.h"

namespace o2
{
Expand Down
5 changes: 5 additions & 0 deletions Detectors/TOF/base/src/TOFBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@
#pragma link C++ class vector < o2::tof::ReadoutWindowData> + ;
#pragma link C++ class o2::tof::DigitHeader + ;
#pragma link C++ class vector < o2::tof::DigitHeader> + ;
#pragma link C++ class o2::tof::CalibTOFapi + ;
#pragma link C++ class o2::tof::eventTimeTrack + ;
#pragma link C++ class o2::tof::eventTimeTrackTest + ;
#pragma link C++ class vector < o2::tof::eventTimeTrack> + ;
#pragma link C++ class vector < o2::tof::eventTimeTrackTest> + ;
#pragma link C++ class vector < unsigned int> + ;
#endif
6 changes: 2 additions & 4 deletions Detectors/TOF/calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

o2_add_library(TOFCalibration
TARGETVARNAME targetName
SOURCES src/CalibTOFapi.cxx
src/CalibTOF.cxx
SOURCES src/CalibTOF.cxx
src/CollectCalibInfoTOF.cxx
src/LHCClockCalibrator.cxx
src/TOFChannelCalibrator.cxx
Expand All @@ -30,8 +29,7 @@ o2_add_library(TOFCalibration


o2_target_root_dictionary(TOFCalibration
HEADERS include/TOFCalibration/CalibTOFapi.h
include/TOFCalibration/CalibTOF.h
HEADERS include/TOFCalibration/CalibTOF.h
include/TOFCalibration/LHCClockCalibrator.h
include/TOFCalibration/TOFChannelCalibrator.h
include/TOFCalibration/TOFCalibCollector.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "TF1.h"
#include "TFile.h"
#include "TGraphErrors.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"

class TTree;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "DetectorsCalibration/TimeSlotCalibration.h"
#include "DetectorsCalibration/TimeSlot.h"
#include "DataFormatsTOF/CalibInfoTOF.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#include "TOFBase/Geo.h"
#include "CCDB/CcdbObjectInfo.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#include "TOFBase/Geo.h"
#include "CCDB/CcdbObjectInfo.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"

#include <array>
#include <boost/histogram.hpp>
Expand Down
1 change: 0 additions & 1 deletion Detectors/TOF/calibration/src/TOFCalibrationLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::tof::CalibTOFapi + ;
#pragma link C++ class o2::globaltracking::CalibTOF + ;
#pragma link C++ class o2::globaltracking::CollectCalibInfoTOF + ;

Expand Down
6 changes: 3 additions & 3 deletions Detectors/TOF/calibration/src/TOFChannelCalibrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void TOFChannelData::fill(const gsl::span<const o2::dataformats::CalibInfoTOF> d

dtcorr = Utils::subtractInteractionBC(dtcorr, true);

LOG(INFO) << "inserting in channel " << ch << ": dt = " << Utils::subtractInteractionBC(dt, true) << ", tot = " << tot << ", corr = " << corr << ", corrected dt = " << dtcorr;
LOG(DEBUG) << "inserting in channel " << ch << ": dt = " << Utils::subtractInteractionBC(dt, true) << ", tot = " << tot << ", corr = " << corr << ", corrected dt = " << dtcorr;

#ifdef DEBUGGING
mChannelDist->Fill(ch, dtcorr);
Expand Down Expand Up @@ -425,7 +425,7 @@ void TOFChannelCalibrator<T>::finalizeSlotWithCosmics(Slot& slot)
// for the CCDB entry
std::map<std::string, std::string> md;
TimeSlewing& ts = mCalibTOFapi->getSlewParamObj(); // we take the current CCDB object, since we want to simply update the offset
ts.bind();
// ts.bind();

int nbins = c->getNbins();
float range = c->getRange();
Expand Down Expand Up @@ -642,7 +642,7 @@ void TOFChannelCalibrator<T>::finalizeSlotWithTracks(Slot& slot)
// for the CCDB entry
std::map<std::string, std::string> md;
TimeSlewing& ts = mCalibTOFapi->getSlewParamObj(); // we take the current CCDB object, since we want to simply update the offset
ts.bind();
// ts.bind();

#ifdef WITH_OPENMP
if (mNThreads < 1) {
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TOF/prototyping/macroEvTime.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "TOFReconstruction/EventTimeMaker.h"
#include "TOFBase/EventTimeMaker.h"
#endif

using namespace o2::tof;
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TOF/prototyping/testCCDB.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <string>
#include "TTree.h"
#include "TFile.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "DataFormatsTOF/CalibTimeSlewingParamTOF.h"
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#endif
Expand Down
4 changes: 1 addition & 3 deletions Detectors/TOF/reconstruction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ o2_add_library(TOFReconstruction
src/DecoderBase.cxx
src/Decoder.cxx
src/CTFCoder.cxx
src/EventTimeMaker.cxx
src/CosmicProcessor.cxx
PUBLIC_LINK_LIBRARIES O2::TOFBase O2::DataFormatsTOF
O2::SimulationDataFormat
O2::CommonDataFormat
O2::DataFormatsTOF
O2::rANS O2::DPLUtils
O2::TOFCalibration O2::DetectorsRaw)
O2::DetectorsRaw)

o2_target_root_dictionary(TOFReconstruction
HEADERS include/TOFReconstruction/DataReader.h
Expand All @@ -32,5 +31,4 @@ o2_target_root_dictionary(TOFReconstruction
include/TOFReconstruction/DecoderBase.h
include/TOFReconstruction/Decoder.h
include/TOFReconstruction/CTFCoder.h
include/TOFReconstruction/EventTimeMaker.h
include/TOFReconstruction/CosmicProcessor.h)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "TOFReconstruction/DataReader.h"
#include "SimulationDataFormat/MCTruthContainer.h"
#include "SimulationDataFormat/MCCompLabel.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "DataFormatsTOF/Diagnostic.h"

namespace o2
Expand Down
4 changes: 0 additions & 4 deletions Detectors/TOF/reconstruction/src/TOFReconstructionLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@
#pragma link C++ class o2::tof::compressed::Decoder + ;
#pragma link C++ class o2::tof::CTFCoder + ;
#pragma link C++ class o2::tof::CosmicProcessor + ;
#pragma link C++ class o2::tof::eventTimeTrack + ;
#pragma link C++ class o2::tof::eventTimeTrackTest + ;
#pragma link C++ class vector < o2::tof::eventTimeTrack> + ;
#pragma link C++ class vector < o2::tof::eventTimeTrackTest> + ;

#endif
2 changes: 1 addition & 1 deletion Detectors/TOF/simulation/include/TOFSimulation/Digitizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "TOFSimulation/Detector.h"
#include "SimulationDataFormat/MCTruthContainer.h"
#include "TOFSimulation/MCLabel.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"

namespace o2
{
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TOF/workflow/src/TOFClusterizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "SimulationDataFormat/MCCompLabel.h"
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#include "DataFormatsTOF/CalibTimeSlewingParamTOF.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "TStopwatch.h"
#include "Framework/ConfigParamRegistry.h"
#include "Framework/DataRefUtils.h"
Expand Down
2 changes: 1 addition & 1 deletion Steer/DigitizerWorkflow/src/TOFDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <SimulationDataFormat/MCTruthContainer.h>
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#include "DataFormatsTOF/CalibTimeSlewingParamTOF.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "SimConfig/DigiParams.h"
#include "DetectorsBase/BaseDPLDigitizer.h"

Expand Down
3 changes: 1 addition & 2 deletions macro/run_clus_tof.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
#include "TOFReconstruction/ClustererTask.h"
#include "DataFormatsTOF/CalibLHCphaseTOF.h"
#include "DataFormatsTOF/CalibTimeSlewingParamTOF.h"
#include "TOFCalibration/CalibTOFapi.h"
#include "TOFBase/CalibTOFapi.h"
#include "TOFReconstruction/Clusterer.h"
#include "TOFReconstruction/DataReader.h"
#include "TOFCalibration/CalibTOFapi.h"
#endif

void run_clus_tof(std::string outputfile = "tofclusters.root", std::string inputfile = "tofdigits.root", bool isMC = true)
Expand Down

0 comments on commit d3d2ce4

Please sign in to comment.