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::trk;
21
23{
24 // make sure the defaults are consistent
25 setNSimSteps(mNSimSteps);
26}
27
29{
30 // set ROFrame length in nanosecongs
31 mROFrameLength = lNS;
32 assert(mROFrameLength > 1.);
33 mROFrameLengthInv = 1. / mROFrameLength;
34}
35
37{
38 // set number of sampling steps in silicon
39 mNSimSteps = v > 0 ? v : 1;
40 mNSimStepsInv = 1.f / mNSimSteps;
41}
42
43void DigiParams::setChargeThreshold(int v, float frac2Account)
44{
45 // set charge threshold for digits creation and its fraction to account
46 // contribution from single hit
47 mChargeThreshold = v;
48 mMinChargeToAccount = v * frac2Account;
49 if (mMinChargeToAccount < 0 || mMinChargeToAccount > mChargeThreshold) {
50 mMinChargeToAccount = mChargeThreshold;
51 }
52 LOG(info) << "Set charge threshold to " << mChargeThreshold
53 << ", single hit will be accounted from " << mMinChargeToAccount
54 << " electrons";
55}
56
57//______________________________________________
59{
60 // print settings
61 printf("TRK digitization params:\n");
62 printf("Continuous readout : %s\n", mIsContinuous ? "ON" : "OFF");
63 printf("Readout Frame Length(ns) : %f\n", mROFrameLength);
64 printf("Strobe delay (ns) : %f\n", mStrobeDelay);
65 printf("Strobe length (ns) : %f\n", mStrobeLength);
66 printf("Threshold (N electrons) : %d\n", mChargeThreshold);
67 printf("Min N electrons to account : %d\n", mMinChargeToAccount);
68 printf("Number of charge sharing steps : %d\n", mNSimSteps);
69 printf("ELoss to N electrons factor : %e\n", mEnergyToNElectrons);
70 printf("Noise level per pixel : %e\n", mNoisePerPixel);
71 printf("Charge time-response:\n");
72 mSignalShape.print();
73}
74
76{
77 if (!resp) {
78 LOGP(fatal, "cannot set response function from null");
79 }
80 mAlpSimResponse = std::make_unique<o2::trk::ChipSimResponse>(resp);
81}
Simulation parameters for the TRK digitizer. Based on the ITS2 and ITS3 digitizer parameters.
virtual void print() const
void setChargeThreshold(int v, float frac2Account=0.1)
void setNSimSteps(int v)
void setROFrameLength(float ns)
void setAlpSimResponse(const o2::itsmft::AlpideSimResponse *)
const GLdouble * v
Definition glcorearb.h:832
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"