Project
Loading...
Searching...
No Matches
SAMPAProcessing.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
15
18
19#include <fstream>
20#include <iostream>
21#include <sstream>
22#include <string>
23#include "Framework/Logger.h"
24
25using namespace o2::tpc;
26
27SAMPAProcessing::SAMPAProcessing() : mRandomNoiseRing()
28{
29 updateParameters();
30}
31
33{
34 mGasParam = &(ParameterGas::Instance());
35 mDetParam = &(ParameterDetector::Instance());
36 mEleParam = &(ParameterElectronics::Instance());
37 auto& cdb = CDBInterface::instance();
38 mPedestalMap = &(cdb.getPedestals());
39 mPedestalMapCRU = &(cdb.getPedestalsCRU());
40 mNoiseMap = &(cdb.getNoise());
41 mZeroSuppression = &(cdb.getZeroSuppressionThreshold());
42 mVDrift = vdrift > 0 ? vdrift : mGasParam->DriftV;
43}
44
45void SAMPAProcessing::getShapedSignal(float ADCsignal, float driftTime, std::vector<float>& signalArray) const
46{
47 const float timeBinTime = getTimeBinTime(driftTime);
48 const float offset = driftTime - timeBinTime;
49 for (float bin = 0; bin < mEleParam->NShapedPoints; bin += Vc::float_v::Size) {
50 Vc::float_v binvector;
51 for (int i = 0; i < Vc::float_v::Size; ++i) {
52 binvector[i] = bin + i;
53 }
54 Vc::float_v time = timeBinTime + binvector * mEleParam->ZbinWidth;
55 Vc::float_v signal = getGamma4(time, Vc::float_v(timeBinTime + offset), Vc::float_v(ADCsignal));
56 for (int i = 0; i < Vc::float_v::Size; ++i) {
57 signalArray[bin + i] = signal[i];
58 }
59 }
60}
Simple interface to the CDB manager.
int16_t time
Definition RawEventData.h:4
int32_t i
Definition of the SAMPA response.
static CDBInterface & instance()
void getShapedSignal(float ADCsignal, float driftTime, std::vector< float > &signalArray) const
float getTimeBinTime(float time) const
void updateParameters(float vdrift=0)
Update the OCDB parameters cached in the class. To be called once per event.
T getGamma4(T time, T startTime, T ADC) const
GLintptr offset
Definition glcorearb.h:660
Global TPC definitions and constants.
Definition SimTraits.h:167
float ZbinWidth
Width of a z bin [us].
float DriftV
Drift velocity [cm/us].