Project
Loading...
Searching...
No Matches
DigiParams.cxx
Go to the documentation of this file.
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
14
15#include <cassert>
16#include "Framework/Logger.h"
19
20using namespace o2::trkft3;
21
22template <int DetIDV>
24{
25 // make sure the defaults are consistent
26 setNSimSteps(mNSimSteps);
27}
28
29template <int DetIDV>
31{
32 // set ROFrame length in nanosecongs
33 mROFrameLayerLength[layer] = lNS;
34 assert(mROFrameLayerLength[layer] > 1.);
35 mROFrameLayerLengthInv[layer] = 1. / mROFrameLayerLength[layer];
36}
37
38template <int DetIDV>
40{
41 // set number of sampling steps in silicon
42 mNSimSteps = v > 0 ? v : 1;
43 mNSimStepsInv = 1.f / mNSimSteps;
44}
45
46template <int DetIDV>
47void DigiParams<DetIDV>::setChargeThreshold(int v, float frac2Account)
48{
49 // set charge threshold for digits creation and its fraction to account
50 // contribution from single hit
51 mChargeThreshold = v;
52 mMinChargeToAccount = v * frac2Account;
53 if (mMinChargeToAccount < 0 || mMinChargeToAccount > mChargeThreshold) {
54 mMinChargeToAccount = mChargeThreshold;
55 }
56 LOG(info) << "Set charge threshold to " << mChargeThreshold
57 << ", single hit will be accounted from " << mMinChargeToAccount
58 << " electrons";
59}
60
61//______________________________________________
62template <int DetIDV>
64{
65 // print settings
66 printf("%s digitization params:\n", o2::detectors::DetID::getName(DetIDV));
67 printf("Threshold (N electrons) : %d\n", mChargeThreshold);
68 printf("Min N electrons to account : %d\n", mMinChargeToAccount);
69 printf("Number of charge sharing steps : %d\n", mNSimSteps);
70 printf("ELoss to N electrons factor : %e\n", mEnergyToNElectrons);
71 printf("Noise level per pixel : %e\n", mNoisePerPixel);
72 printf("Charge time-response:\n");
73 mSignalShape.print();
74}
75
76template <int DetIDV>
78{
79 LOG(debug) << "Response function data path: " << resp->getDataPath();
80 LOG(debug) << "Response function info: ";
81 // resp->print();
82 if (!resp) {
83 LOGP(fatal, "cannot set response function from null");
84 }
85 mResponse = std::make_unique<o2::trkft3::ChipSimResponse>(resp);
86}
87
Simulation parameters for the TRK digitizer. Based on the ITS2 and ITS3 digitizer parameters.
std::ostringstream debug
static constexpr const char * getName(ID id)
names of defined detectors
Definition DetID.h:146
const std::string & getDataPath() const
virtual void print() const
void setChargeThreshold(int v, float frac2Account=0.1)
void setResponse(const o2::itsmft::AlpideSimResponse *)
void setROFrameLength(float ns, int layer)
const GLdouble * v
Definition glcorearb.h:832
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"