Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions Detectors/Upgrades/ALICE3/TRK/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

o2_add_library(TRKBase
SOURCES src/GeometryTGeo.cxx
src/AlmiraParam.cxx
src/TRKBaseParam.cxx
src/SegmentationChip.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase)

o2_target_root_dictionary(TRKBase
HEADERS include/TRKBase/GeometryTGeo.h
HEADERS include/TRKBase/AlmiraParam.h
include/TRKBase/GeometryTGeo.h
include/TRKBase/TRKBaseParam.h
include/TRKBase/SegmentationChip.h)
include/TRKBase/SegmentationChip.h)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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.

#ifndef O2_TRK_ALMIRAPARAM_H
#define O2_TRK_ALMIRAPARAM_H

#include "CommonConstants/LHCConstants.h"
#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"

namespace o2
{
namespace trk
{
constexpr float DEFAlmiraStrobeDelay = 0.f; ///< default strobe delay in ns wrt ROF start, to be tuned with the real chip response

struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
int roFrameLengthInBC = o2::constants::lhc::LHCMaxBunches / 198; ///< ROF length in BC for continuous mode
float strobeDelay = DEFAlmiraStrobeDelay; ///< strobe start in ns wrt ROF start
float strobeLengthCont = -1.; ///< if < 0, full ROF length minus delay
int roFrameBiasInBC = 0; ///< ROF start bias in BC wrt orbit start

O2ParamDef(AlmiraParam, "TRKAlmiraParam");
};

} // namespace trk

namespace framework
{
template <typename T>
struct is_messageable;

template <>
struct is_messageable<o2::trk::AlmiraParam> : std::true_type {
};
} // namespace framework

} // namespace o2

#endif
14 changes: 14 additions & 0 deletions Detectors/Upgrades/ALICE3/TRK/base/src/AlmiraParam.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// 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.

#include "TRKBase/AlmiraParam.h"

O2ParamImpl(o2::trk::AlmiraParam);
4 changes: 3 additions & 1 deletion Detectors/Upgrades/ALICE3/TRK/base/src/TRKBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::trk::AlmiraParam> + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::trk::TRKBaseParam> + ;

#pragma link C++ class o2::trk::AlmiraParam + ;
#pragma link C++ class o2::trk::GeometryTGeo +
#pragma link C++ class o2::trk::TRKBaseParam + ;
#pragma link C++ class o2::trk::SegmentationChip + ;

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer

bool continuous = true; ///< flag for continuous simulation
float noisePerPixel = DEFNoisePerPixel(); ///< ALPIDE Noise per channel
float strobeFlatTop = 7500.; ///< strobe shape flat top
float strobeMaxRiseTime = 1100.; ///< strobe max rise time
float strobeQRiseTime0 = 450.; ///< q @ which strobe rise time is 0
float strobeFlatTop = 20.; ///< strobe shape flat top
float strobeMaxRiseTime = 0.; ///< strobe max rise time
float strobeQRiseTime0 = 0.; ///< q @ which strobe rise time is 0

double timeOffset = 0.; ///< time offset (in seconds!) to calculate ROFrame from hit time
int chargeThreshold = 75; ///< charge threshold in Nelectrons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class DigiParams

bool isTimeOffsetSet() const { return mTimeOffset > -infTime; }

const o2::trk::ChipSimResponse* getAlpSimResponse() const { return mAlpSimResponse.get(); }
void setAlpSimResponse(const o2::itsmft::AlpideSimResponse*);
const o2::trk::ChipSimResponse* getResponse() const { return mResponse.get(); }
void setResponse(const o2::itsmft::AlpideSimResponse*);

const SignalShape& getSignalShape() const { return mSignalShape; }
SignalShape& getSignalShape() { return (SignalShape&)mSignalShape; }
Expand Down Expand Up @@ -123,7 +123,7 @@ class DigiParams

o2::itsmft::AlpideSignalTrapezoid mSignalShape; ///< signal timeshape parameterization

std::unique_ptr<o2::trk::ChipSimResponse> mAlpSimResponse; //!< pointer on external response
std::unique_ptr<o2::trk::ChipSimResponse> mResponse; //!< pointer on external response

// auxiliary precalculated parameters
float mROFrameLengthInv = 0; ///< inverse length of RO frame in ns
Expand Down
4 changes: 2 additions & 2 deletions Detectors/Upgrades/ALICE3/TRK/simulation/src/DigiParams.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void DigiParams::print() const
mSignalShape.print();
}

void DigiParams::setAlpSimResponse(const o2::itsmft::AlpideSimResponse* resp)
void DigiParams::setResponse(const o2::itsmft::AlpideSimResponse* resp)
{
LOG(debug) << "Response function data path: " << resp->getDataPath();
LOG(debug) << "Response function info: ";
// resp->print();
if (!resp) {
LOGP(fatal, "cannot set response function from null");
}
mAlpSimResponse = std::make_unique<o2::trk::ChipSimResponse>(resp);
mResponse = std::make_unique<o2::trk::ChipSimResponse>(resp);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void Digitizer::init()
}

// setting the correct response function (for the moment, for both VD and MLOT the same response function is used)
mChipSimResp = mParams.getAlpSimResponse();
mChipSimResp = mParams.getResponse();
mChipSimRespVD = mChipSimResp; /// for the moment considering the same response
mChipSimRespMLOT = mChipSimResp; /// for the moment considering the same response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ DataProcessorSpec getTrackerSpec(bool useMC, const std::string& hitRecoConfig, o
}

// inputs.emplace_back("itscldict", "TRK", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary"));
// inputs.emplace_back("itsalppar", "TRK", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
// inputs.emplace_back("TRK_almiraparam", "TRK", "ALMIRAPARAM", 0, Lifetime::Condition, ccdbParamSpec("TRK/Config/AlmiraParam"));

// outputs.emplace_back("TRK", "TRACKCLSID", 0, Lifetime::Timeframe);
// outputs.emplace_back("TRK", "TRKTrackROF", 0, Lifetime::Timeframe);
Expand Down
42 changes: 17 additions & 25 deletions Steer/DigitizerWorkflow/src/TRKDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "DataFormatsITSMFT/ROFRecord.h"
#include "TRKSimulation/Digitizer.h"
#include "TRKSimulation/DPLDigitizerParam.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "TRKBase/AlmiraParam.h"
#include "TRKBase/GeometryTGeo.h"
#include "TRKBase/TRKBaseParam.h"

Expand Down Expand Up @@ -208,7 +208,7 @@ class TRKDPLDigitizerTask : BaseDPLDigitizer
if (!file) {
LOG(fatal) << "Cannot open response file " << mLocalRespFile;
}
mDigitizer.getParams().setAlpSimResponse((const o2::itsmft::AlpideSimResponse*)file->Get("response1"));
mDigitizer.getParams().setResponse((const o2::itsmft::AlpideSimResponse*)file->Get("response1"));
}

void updateTimeDependentParams(ProcessingContext& pc)
Expand All @@ -225,32 +225,24 @@ class TRKDPLDigitizerTask : BaseDPLDigitizer
mDigitizer.setGeometry(geom);

const auto& dopt = o2::trk::DPLDigitizerParam<o2::detectors::DetID::TRK>::Instance();
pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>*>("ITS_alppar");
const auto& aopt = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
digipar.setContinuous(dopt.continuous);
// pc.inputs().get<o2::trk::AlmiraParam*>("TRK_almiraparam");
const auto& aopt = o2::trk::AlmiraParam::Instance();
auto frameNS = aopt.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS;
digipar.setContinuous(true);
digipar.setROFrameBiasInBC(aopt.roFrameBiasInBC);
if (dopt.continuous) {
auto frameNS = aopt.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS;
digipar.setROFrameLengthInBC(aopt.roFrameLengthInBC);
digipar.setROFrameLength(frameNS); // RO frame in ns
digipar.setStrobeDelay(aopt.strobeDelay); // Strobe delay wrt beginning of the RO frame, in ns
digipar.setStrobeLength(aopt.strobeLengthCont > 0 ? aopt.strobeLengthCont : frameNS - aopt.strobeDelay); // Strobe length in ns
} else {
digipar.setROFrameLength(aopt.roFrameLengthTrig); // RO frame in ns
digipar.setStrobeDelay(aopt.strobeDelay); // Strobe delay wrt beginning of the RO frame, in ns
digipar.setStrobeLength(aopt.strobeLengthTrig); // Strobe length in ns
}
digipar.setROFrameLengthInBC(aopt.roFrameLengthInBC);
digipar.setROFrameLength(frameNS); // RO frame in ns
digipar.setStrobeDelay(aopt.strobeDelay);
digipar.setStrobeLength(aopt.strobeLengthCont > 0 ? aopt.strobeLengthCont : frameNS - aopt.strobeDelay);
// parameters of signal time response: flat-top duration, max rise time and q @ which rise time is 0
digipar.getSignalShape().setParameters(dopt.strobeFlatTop, dopt.strobeMaxRiseTime, dopt.strobeQRiseTime0);
digipar.setChargeThreshold(dopt.chargeThreshold); // charge threshold in electrons
digipar.setNoisePerPixel(dopt.noisePerPixel); // noise level
digipar.setTimeOffset(dopt.timeOffset);
digipar.setNSimSteps(dopt.nSimSteps);

mROMode = digipar.isContinuous() ? o2::parameters::GRPObject::CONTINUOUS : o2::parameters::GRPObject::PRESENT;
LOG(info) << mID.getName() << " simulated in "
<< ((mROMode == o2::parameters::GRPObject::CONTINUOUS) ? "CONTINUOUS" : "TRIGGERED")
<< " RO mode";
mROMode = o2::parameters::GRPObject::CONTINUOUS;
LOG(info) << mID.getName() << " simulated in CONTINUOUS RO mode";

// if (oTRKParams::Instance().useDeadChannelMap) {
// pc.inputs().get<o2::itsmft::NoiseMap*>("TRK_dead"); // trigger final ccdb update
Expand All @@ -265,9 +257,9 @@ class TRKDPLDigitizerTask : BaseDPLDigitizer

void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
{
if (matcher == ConcreteDataMatcher(detectors::DetID::ITS, "ALPIDEPARAM", 0)) {
LOG(info) << mID.getName() << " Alpide param updated";
const auto& par = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
if (matcher == ConcreteDataMatcher(mOrigin, "ALMIRAPARAM", 0)) {
LOG(info) << mID.getName() << " Almira param updated";
const auto& par = o2::trk::AlmiraParam::Instance();
par.printKeyValues();
return;
}
Expand All @@ -280,7 +272,7 @@ class TRKDPLDigitizerTask : BaseDPLDigitizer
LOG(info) << mID.getName() << " loaded APTSResponseData";
if (mLocalRespFile.empty()) {
LOG(info) << "Using CCDB/APTS response file";
mDigitizer.getParams().setAlpSimResponse((const o2::itsmft::AlpideSimResponse*)obj);
mDigitizer.getParams().setResponse((const o2::itsmft::AlpideSimResponse*)obj);
mDigitizer.setResponseName("APTS");
} else {
LOG(info) << "Response function will be loaded from local file: " << mLocalRespFile;
Expand Down Expand Up @@ -318,7 +310,7 @@ DataProcessorSpec getTRKDigitizerSpec(int channel, bool mctruth)
auto detOrig = o2::header::gDataOriginTRK;
std::vector<InputSpec> inputs;
inputs.emplace_back("collisioncontext", "SIM", "COLLISIONCONTEXT", static_cast<SubSpecificationType>(channel), Lifetime::Timeframe);
inputs.emplace_back("ITS_alppar", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
// inputs.emplace_back("TRK_almiraparam", "TRK", "ALMIRAPARAM", 0, Lifetime::Condition, ccdbParamSpec("TRK/Config/AlmiraParam"));
// if (oTRKParams::Instance().useDeadChannelMap) {
// inputs.emplace_back("TRK_dead", "TRK", "DEADMAP", 0, Lifetime::Condition, ccdbParamSpec("TRK/Calib/DeadMap"));
// }
Expand Down
Loading