Skip to content

Commit b7f0c8c

Browse files
committed
its3 digitization parameter sets
1 parent 25c5276 commit b7f0c8c

File tree

11 files changed

+283
-48
lines changed

11 files changed

+283
-48
lines changed

Detectors/Upgrades/ITS3/simulation/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ o2_add_library(ITS3Simulation
1515
src/DescriptorInnerBarrelITS3.cxx
1616
src/Digitizer.cxx
1717
src/DigiParams.cxx
18+
src/ITS3DPLDigitizerParam.cxx
19+
src/ChipDigitsContainer.cxx
1820
PUBLIC_LINK_LIBRARIES O2::SimulationDataFormat
19-
O2::ITSBase O2::ITSMFTSimulation
21+
O2::ITSBase O2::ITSMFTSimulation O2::ITSMFTBase
2022
ROOT::Physics)
2123

2224
o2_target_root_dictionary(ITS3Simulation
@@ -25,6 +27,8 @@ o2_target_root_dictionary(ITS3Simulation
2527
include/ITS3Simulation/DescriptorInnerBarrelITS3.h
2628
include/ITS3Simulation/Digitizer.h
2729
include/ITS3Simulation/DigiParams.h
30+
include/ITS3Simulation/ITS3DPLDigitizerParam.h
31+
include/ITS3Simulation/ChipDigitsContainer.h
2832
)
2933

3034
o2_data_file(COPY data DESTINATION Detectors/ITS3/simulation)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef ALICEO2_ITS3_CHIPDIGITSCONTAINER_
13+
#define ALICEO2_ITS3_CHIPDIGITSCONTAINER_
14+
15+
#include "ITSMFTBase/SegmentationAlpide.h" // Base class in o2::itsmft namespace
16+
#include "ITSMFTSimulation/ChipDigitsContainer.h" // Base class in o2::itsmft namespace
17+
#include "ITS3Base/SegmentationMosaix.h" // OB segmentation implementation
18+
#include "ITS3Base/SpecsV2.h" // Provides SpecsV2::isDetITS3() interface
19+
#include "ITS3Simulation/DigiParams.h" // ITS3-specific DigiParams interface
20+
#include <TRandom.h>
21+
22+
namespace o2
23+
{
24+
namespace its3
25+
{
26+
27+
// IB uses the Alpide segmentation,
28+
// OB uses the Mosaix segmentation.
29+
using SegmentationIB = SegmentationMosaix;
30+
using SegmentationOB = o2::itsmft::SegmentationAlpide;
31+
class ChipDigitsContainer : public o2::itsmft::ChipDigitsContainer
32+
{
33+
private:
34+
bool innerBarrel; ///< true if the chip belongs to the inner barrel (IB), false if outer barrel (OB)
35+
int maxRows; ///< maximum number of rows
36+
int maxCols; ///< maximum number of columns
37+
38+
public:
39+
explicit ChipDigitsContainer(UShort_t idx = 0);
40+
41+
/// Returns whether the chip is in the inner barrel (IB)
42+
bool isIB() const;
43+
/// Adds noise digits, deleted the one using the itsmft::DigiParams interface
44+
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;
45+
void addNoise(UInt_t rofMin, UInt_t rofMax, const o2::its3::DigiParams* params);
46+
47+
ClassDefNV(ChipDigitsContainer, 1);
48+
};
49+
50+
} // namespace its3
51+
} // namespace o2
52+
53+
#endif // ALICEO2_ITS3_CHIPDIGITSCONTAINER_

Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/DigiParams.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,28 @@ namespace o2::its3
1919

2020
class DigiParams final : public o2::itsmft::DigiParams
2121
{
22+
private:
23+
float mIBNoisePerPixel = 1.e-8;
24+
int mIBChargeThreshold = 150; ///< charge threshold in Nelectrons
25+
int mIBMinChargeToAccount = 15; ///< minimum charge contribution to account
26+
int mIBNSimSteps = 18; ///< number of steps in response simulation
27+
float mIBNSimStepsInv = 0; ///< its inverse
28+
2229
public:
30+
DigiParams();
31+
32+
void setIBNoisePerPixel(float v) { mIBNoisePerPixel = v; }
33+
float getIBNoisePerPixel() const { return mIBNoisePerPixel; }
34+
35+
void setIBChargeThreshold(int v, float frac2Account = 0.1);
36+
int getIBChargeThreshold() const { return mIBChargeThreshold; }
37+
38+
void setIBNSimSteps(int v);
39+
int getIBNSimSteps() const { return mIBNSimSteps; }
40+
float getIBNSimStepsInv() const { return mIBNSimStepsInv; }
41+
42+
int getIBMinChargeToAccount() const { return mIBMinChargeToAccount; }
43+
2344
const o2::itsmft::AlpideSimResponse* getAlpSimResponse() const = delete;
2445
void setAlpSimResponse(const o2::itsmft::AlpideSimResponse* par) = delete;
2546

Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include "Rtypes.h"
2222
#include "TObject.h"
2323

24-
#include "ITSMFTSimulation/ChipDigitsContainer.h"
2524
#include "ITSMFTSimulation/AlpideSimResponse.h"
2625
#include "ITSMFTSimulation/Hit.h"
2726
#include "ITSBase/GeometryTGeo.h"
2827
#include "ITS3Base/SegmentationMosaix.h"
2928
#include "ITS3Simulation/DigiParams.h"
29+
#include "ITS3Simulation/ChipDigitsContainer.h"
3030
#include "DataFormatsITSMFT/Digit.h"
3131
#include "DataFormatsITSMFT/ROFRecord.h"
3232
#include "CommonDataFormat/InteractionRecord.h"
@@ -78,7 +78,7 @@ class Digitizer : public TObject
7878

7979
private:
8080
void processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID, int srcID);
81-
void registerDigits(o2::itsmft::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
81+
void registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roFrame, float tInROF, int nROF,
8282
uint16_t row, uint16_t col, int nEle, o2::MCCompLabel& lbl);
8383

8484
ExtraDig* getExtraDigBuffer(uint32_t roFrame)
@@ -118,7 +118,7 @@ class Digitizer : public TObject
118118

119119
const o2::its::GeometryTGeo* mGeometry = nullptr; ///< ITS3 geometry
120120

121-
std::vector<o2::itsmft::ChipDigitsContainer> mChips; ///< Array of chips digits containers
121+
std::vector<o2::its3::ChipDigitsContainer> mChips; ///< Array of chips digits containers
122122
std::deque<std::unique_ptr<ExtraDig>> mExtraBuff; ///< burrer (per roFrame) for extra digits
123123

124124
std::vector<o2::itsmft::Digit>* mDigits = nullptr; //! output digits
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
8+
#ifndef ALICEO2_ITS3DPLDIGITIZERPARAM_H_
9+
#define ALICEO2_ITS3DPLDIGITIZERPARAM_H_
10+
11+
#include "CommonUtils/ConfigurableParam.h"
12+
#include "CommonUtils/ConfigurableParamHelper.h"
13+
#include "ITSMFTSimulation/DPLDigitizerParam.h"
14+
#include <string>
15+
16+
namespace o2
17+
{
18+
namespace its3
19+
{
20+
21+
struct ITS3DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<ITS3DPLDigitizerParam> {
22+
float IBNoisePerPixel = 1.e-8; ///< MOSAIX Noise per channel
23+
int IBChargeThreshold = 150; ///< charge threshold in Nelectrons for IB
24+
int IBMinChargeToAccount = 15; ///< minimum charge contribution to account for IB
25+
int nIBSimSteps = 18; ///< number of steps in response for IB
26+
27+
O2ParamDef(ITS3DPLDigitizerParam, "ITS3DPLDigitizerParam");
28+
};
29+
30+
} // namespace its3
31+
} // namespace o2
32+
33+
#endif
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#include "ITS3Simulation/ChipDigitsContainer.h"
13+
14+
namespace o2
15+
{
16+
namespace its3
17+
{
18+
19+
ChipDigitsContainer::ChipDigitsContainer(UShort_t idx)
20+
: o2::itsmft::ChipDigitsContainer(idx),
21+
innerBarrel(constants::detID::isDetITS3(idx)),
22+
maxRows(innerBarrel ? SegmentationOB::NRows : SegmentationIB::NRows),
23+
maxCols(innerBarrel ? SegmentationOB::NCols : SegmentationIB::NCols)
24+
{
25+
}
26+
27+
bool ChipDigitsContainer::isIB() const
28+
{
29+
return innerBarrel;
30+
}
31+
32+
void ChipDigitsContainer::addNoise(UInt_t rofMin, UInt_t rofMax, const o2::its3::DigiParams* params)
33+
{
34+
UInt_t row = 0;
35+
UInt_t col = 0;
36+
Int_t nhits = 0;
37+
constexpr float ns2sec = 1e-9;
38+
float mean = 0.f;
39+
int nel = 0;
40+
41+
if (isIB()) {
42+
// Inner barrel: use ITS3-specific noise interface with OB segmentation.
43+
mean = params->getIBNoisePerPixel() * SegmentationOB::NPixels;
44+
nel = static_cast<int>(params->getIBChargeThreshold() * 1.1);
45+
} else {
46+
// Outer barrel: use base class noise interface with IB segmentation.
47+
mean = params->getNoisePerPixel() * SegmentationIB::NPixels;
48+
nel = static_cast<int>(params->getChargeThreshold() * 1.1);
49+
}
50+
51+
for (UInt_t rof = rofMin; rof <= rofMax; ++rof) {
52+
nhits = gRandom->Poisson(mean);
53+
for (Int_t i = 0; i < nhits; ++i) {
54+
row = gRandom->Integer(maxRows);
55+
col = gRandom->Integer(maxCols);
56+
if (mNoiseMap && mNoiseMap->isNoisy(mChipIndex, row, col))
57+
continue;
58+
if (mDeadChanMap && mDeadChanMap->isNoisy(mChipIndex, row, col))
59+
continue;
60+
auto key = getOrderingKey(rof, row, col);
61+
if (!findDigit(key))
62+
addDigit(key, rof, row, col, nel, o2::MCCompLabel(true));
63+
}
64+
}
65+
}
66+
67+
} // namespace its3
68+
} // namespace o2

Detectors/Upgrades/ITS3/simulation/src/DigiParams.cxx

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,50 @@ ClassImp(o2::its3::DigiParams);
2020
namespace o2::its3
2121
{
2222

23+
DigiParams::DigiParams()
24+
{
25+
// make sure the defaults are consistent
26+
setIBNSimSteps(mIBNSimSteps);
27+
}
28+
29+
void DigiParams::setIBNSimSteps(int v)
30+
{
31+
// set number of sampling steps in silicon
32+
mIBNSimSteps = v > 0 ? v : 1;
33+
mIBNSimStepsInv = 1.f / mIBNSimSteps;
34+
}
35+
36+
void DigiParams::setIBChargeThreshold(int v, float frac2Account)
37+
{
38+
// set charge threshold for digits creation and its fraction to account
39+
// contribution from single hit
40+
mIBChargeThreshold = v;
41+
mIBMinChargeToAccount = v * frac2Account;
42+
if (mIBMinChargeToAccount < 0 || mIBMinChargeToAccount > mIBChargeThreshold) {
43+
mIBMinChargeToAccount = mIBChargeThreshold;
44+
}
45+
LOG(info) << "Set Mosaix charge threshold to " << mIBChargeThreshold
46+
<< ", single hit will be accounted from " << mIBMinChargeToAccount
47+
<< " electrons";
48+
}
49+
2350
void DigiParams::print() const
2451
{
2552
// print settings
2653
LOGF(info, "ITS3 DigiParams settings:");
27-
LOGF(info, "Continuous readout : %s", isContinuous() ? "ON" : "OFF");
28-
LOGF(info, "Readout Frame Length(ns) : %f", getROFrameLength());
29-
LOGF(info, "Strobe delay (ns) : %f", getStrobeDelay());
30-
LOGF(info, "Strobe length (ns) : %f", getStrobeLength());
31-
LOGF(info, "Threshold (N electrons) : %d", getChargeThreshold());
32-
LOGF(info, "Min N electrons to account : %d", getMinChargeToAccount());
33-
LOGF(info, "Number of charge sharing steps : %d", getNSimSteps());
34-
LOGF(info, "ELoss to N electrons factor : %e", getEnergyToNElectrons());
35-
LOGF(info, "Noise level per pixel : %e", getNoisePerPixel());
54+
LOGF(info, "Continuous readout : %s", isContinuous() ? "ON" : "OFF");
55+
LOGF(info, "Readout Frame Length(ns) : %f", getROFrameLength());
56+
LOGF(info, "Strobe delay (ns) : %f", getStrobeDelay());
57+
LOGF(info, "Strobe length (ns) : %f", getStrobeLength());
58+
LOGF(info, "IB Threshold (N electrons) : %d", getIBChargeThreshold());
59+
LOGF(info, "OB Threshold (N electrons) : %d", getChargeThreshold());
60+
LOGF(info, "Min N electrons to account for IB : %d", getIBMinChargeToAccount());
61+
LOGF(info, "Min N electrons to account for OB : %d", getMinChargeToAccount());
62+
LOGF(info, "Number of charge sharing steps of IB : %d", getIBNSimSteps());
63+
LOGF(info, "Number of charge sharing steps of OB : %d", getNSimSteps());
64+
LOGF(info, "ELoss to N electrons factor : %e", getEnergyToNElectrons());
65+
LOGF(info, "Noise level per pixel of IB : %e", getIBNoisePerPixel());
66+
LOGF(info, "Noise level per pixel of OB : %e", getNoisePerPixel());
3667
LOGF(info, "Charge time-response:\n");
3768
getSignalShape().print();
3869
}

0 commit comments

Comments
 (0)