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 @@ -114,7 +114,7 @@ class AlpideSimResponse

public:
AlpideSimResponse() = default;
~AlpideSimResponse() = default;
virtual ~AlpideSimResponse() = default;

void initData(int tableNumber, std::string dataPath, const bool quiet = true);

Expand Down Expand Up @@ -145,7 +145,7 @@ class AlpideSimResponse
const std::string& getColRowDataFmt() const { return mColRowDataFmt; }
void print() const;

ClassDefNV(AlpideSimResponse, 2);
ClassDef(AlpideSimResponse, 2);
};

//-----------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,16 @@ void CreateDictionariesITS3(bool saveDeltas = true,
mMosaixSegmentations[layer].curvedToFlat(locC.X(), locC.Y(), xFlat, yFlat);
locC.SetCoordinates(xFlat, yFlat, locC.Z());
}

auto pitchX = (ib) ? o2::its3::SegmentationMosaix::PitchRow : o2::itsmft::SegmentationAlpide::PitchRow;
auto pitchZ = (ib) ? o2::its3::SegmentationMosaix::PitchCol : o2::itsmft::SegmentationAlpide::PitchCol;
dX = xyzLocM.X() - locC.X();
dZ = xyzLocM.Z() - locC.Z();
dX /= (ib) ? o2::its3::SegmentationMosaix::PitchRow : o2::itsmft::SegmentationAlpide::PitchRow;
dZ /= (ib) ? o2::its3::SegmentationMosaix::PitchCol : o2::itsmft::SegmentationAlpide::PitchCol;

float outLimitDx{-1}, outLimitDz{-1};
if (checkOutliers > 0.) {
outLimitDx = topology.getRowSpan() * checkOutliers;
outLimitDz = topology.getColumnSpan() * checkOutliers;
outLimitDx = topology.getRowSpan() * checkOutliers * pitchX;
outLimitDz = topology.getColumnSpan() * checkOutliers * pitchZ;
bool isOutDx = std::abs(dX) > outLimitDx;
bool isOutDz = std::abs(dZ) > outLimitDz;
if (isOutDx || isOutDz) { // ignore outlier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ void BuildTopologyDictionary::accountTopologyImpl(const itsmft::ClusterTopology&
++tot;
bool useDf = dX < IgnoreVal / 2; // we may need to account the frequency but to not update the centroid

// std::pair<unordered_map<unsigned long, itsmft::TopoStat>::iterator,bool> ret;
// auto ret = mTopologyMap.insert(std::make_pair(cluster.getHash(), std::make_pair(cluster, 1)));
auto& topoStat = tstat[cluster.getHash()];
topoStat.countsTotal++;
if (topoStat.countsTotal == 1) { // a new topology is inserted
Expand All @@ -59,7 +57,7 @@ void BuildTopologyDictionary::accountTopologyImpl(const itsmft::ClusterTopology&
topoStat.countsWithBias = 1;
} else { // assign expected sigmas from the pixel X, Z sizes
topInf.mXsigma2 = sigmaX * sigmaX / 12.f / (float)std::min(10, topInf.mSizeX);
topInf.mZsigma2 = sigmaZ * sigmaZ / (float)std::min(10, topInf.mSizeZ);
topInf.mZsigma2 = sigmaZ * sigmaZ / 12.f / (float)std::min(10, topInf.mSizeZ);
}
tinfo.emplace(cluster.getHash(), topInf);
} else {
Expand Down Expand Up @@ -128,7 +126,7 @@ void BuildTopologyDictionary::setThresholdImpl(double thr, TopoFreq& tfreq, Topo
{
setNCommonImpl(0, tfreq, tstat, ncommon, ntot);
freqthres = thr;
for (auto& q : tfreq) {
for (const auto& q : tfreq) {
if (((double)q.first) / ntot > thr) {
++ncommon;
} else {
Expand Down Expand Up @@ -205,7 +203,7 @@ void BuildTopologyDictionary::groupRareTopologiesImpl(TopoFreq& tfreq, TopoInfo&
gr.mHash = tfreq[j].second;
gr.mFrequency = ((double)(tfreq[j].first)) / ntot;
totFreq += gr.mFrequency;
// rough estimation for the error considering a8 uniform distribution
// rough estimation for the error considering a uniform distribution
const auto& topo = tinfo.find(gr.mHash)->second;
gr.mErrX = std::sqrt(topo.mXsigma2);
gr.mErrZ = std::sqrt(topo.mZsigma2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,18 @@
#ifndef ALICEO2_ITS3_CHIPDIGITSCONTAINER_
#define ALICEO2_ITS3_CHIPDIGITSCONTAINER_

#include "ITSMFTBase/SegmentationAlpide.h" // Base class in o2::itsmft namespace
#include "ITSMFTSimulation/ChipDigitsContainer.h" // Base class in o2::itsmft namespace
#include "ITS3Base/SegmentationMosaix.h" // OB segmentation implementation
#include "ITS3Base/SpecsV2.h" // Provides SpecsV2::isDetITS3() interface
#include "ITS3Simulation/DigiParams.h" // ITS3-specific DigiParams interface
#include "ITSMFTBase/SegmentationAlpide.h"
#include "ITSMFTSimulation/ChipDigitsContainer.h"
#include "ITS3Base/SegmentationMosaix.h"
#include "ITS3Base/SpecsV2.h"
#include "ITS3Simulation/DigiParams.h"
#include <TRandom.h>

namespace o2::its3
{

class ChipDigitsContainer : public o2::itsmft::ChipDigitsContainer
{
private:
bool innerBarrel; ///< true if the chip belongs to the inner barrel (IB), false if outer barrel (OB)
int maxRows; ///< maximum number of rows
int maxCols; ///< maximum number of columns

public:
explicit ChipDigitsContainer(UShort_t idx = 0);

Expand All @@ -51,9 +46,14 @@ class ChipDigitsContainer : public o2::itsmft::ChipDigitsContainer
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::itsmft::DigiParams* params, int maxRows = o2::itsmft::SegmentationAlpide::NRows, int maxCols = o2::itsmft::SegmentationAlpide::NCols) = delete;
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::its3::DigiParams* params);

private:
bool innerBarrel{false}; ///< true if the chip belongs to the inner barrel (IB), false if outer barrel (OB)
int maxRows{-1}; ///< maximum number of rows
int maxCols{-1}; ///< maximum number of columns

ClassDefNV(ChipDigitsContainer, 1);
};

} // namespace o2::its3

#endif // ALICEO2_ITS3_CHIPDIGITSCONTAINER_
#endif // ALICEO2_ITS3_CHIPDIGITSCONTAINER_
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ChipSimResponse : public o2::itsmft::AlpideSimResponse
public:
ChipSimResponse() = default;
ChipSimResponse(const ChipSimResponse& other) = default;
ChipSimResponse(const o2::itsmft::AlpideSimResponse* base) : o2::itsmft::AlpideSimResponse(*base) {}

float getRespCentreDep() const { return mRespCentreDep; }
void computeCentreFromData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Digitizer : public TObject
using ExtraDig = std::vector<itsmft::PreDigitLabelRef>; ///< container for extra contributions to PreDigits

public:
~Digitizer();

void setDigits(std::vector<o2::itsmft::Digit>* dig) { mDigits = dig; }
void setMCLabels(o2::dataformats::MCTruthContainer<o2::MCCompLabel>* mclb) { mMCLabels = mclb; }
void setROFRecords(std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
Expand Down
18 changes: 8 additions & 10 deletions Detectors/Upgrades/ITS3/simulation/src/ChipDigitsContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@

#include "ITS3Simulation/ChipDigitsContainer.h"

namespace o2
{
namespace its3
{
using namespace o2::its3;

ChipDigitsContainer::ChipDigitsContainer(UShort_t idx)
: o2::itsmft::ChipDigitsContainer(idx) {}
Expand Down Expand Up @@ -48,16 +45,17 @@ void ChipDigitsContainer::addNoise(UInt_t rofMin, UInt_t rofMax, const o2::its3:
for (Int_t i = 0; i < nhits; ++i) {
row = gRandom->Integer(maxRows);
col = gRandom->Integer(maxCols);
if (mNoiseMap && mNoiseMap->isNoisy(mChipIndex, row, col))
if (mNoiseMap && mNoiseMap->isNoisy(mChipIndex, row, col)) {
continue;
if (mDeadChanMap && mDeadChanMap->isNoisy(mChipIndex, row, col))
}
if (mDeadChanMap && mDeadChanMap->isNoisy(mChipIndex, row, col)) {
continue;
}
auto key = getOrderingKey(rof, row, col);
if (!findDigit(key))
if (!findDigit(key)) {
addDigit(key, rof, row, col, nel, o2::MCCompLabel(true));
}
}
}
}

} // namespace its3
} // namespace o2
// namespace its3
16 changes: 14 additions & 2 deletions Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/// \file Digitizer.cxx
/// \brief Implementation of the ITS3 digitizer

#include "ITS3Simulation/ChipSimResponse.h"
#include "ITSMFTBase/SegmentationAlpide.h"
#include "ITS3Simulation/Digitizer.h"
#include "ITS3Base/ITS3Params.h"
Expand All @@ -34,6 +35,11 @@ using o2::itsmft::PreDigit;

using namespace o2::its3;

Digitizer::~Digitizer()
{
delete mSimRespIB;
}

void Digitizer::init()
{
const int numOfChips = mGeometry->getNumberOfChips();
Expand All @@ -57,8 +63,14 @@ void Digitizer::init()
if (!fOB || fOB->IsZombie() || !fOB->IsOpen()) {
LOGP(fatal, "Cannot open file {}", fileOB);
}
mParams.setIBSimResponse(mSimRespIB = fIB->Get<o2::its3::ChipSimResponse>(nameIB));
mParams.setOBSimResponse(mSimRespOB = fOB->Get<o2::itsmft::AlpideSimResponse>(nameOB));
if ((mSimRespIB = new o2::its3::ChipSimResponse(fIB->Get<o2::itsmft::AlpideSimResponse>(nameIB))) == nullptr) {
LOGP(fatal, "Cannot create response function for IB");
}
if ((mSimRespOB = fOB->Get<o2::itsmft::AlpideSimResponse>(nameOB)) == nullptr) {
LOGP(fatal, "Cannot create response function for OB");
}
mParams.setIBSimResponse(mSimRespIB);
mParams.setOBSimResponse(mSimRespOB);
fIB->Close();
fOB->Close();
};
Expand Down