CbmRoot
Loading...
Searching...
No Matches
CbmMuchDigi.cxx
Go to the documentation of this file.
1/* Copyright (C) 2007-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Ryzhinskiy, Florian Uhlig, Volker Friese [committer], Evgeny Kryshen */
4
18#include "CbmMuchDigi.h"
19
20CbmMuchDigi::CbmMuchDigi(CbmMuchDigi* digi) : fTime(digi->fTime), fAddress(digi->fAddress), fCharge(digi->fCharge) {}
21
22
23CbmMuchDigi::CbmMuchDigi(const CbmMuchDigi& rhs) : fTime(rhs.fTime), fAddress(rhs.fAddress), fCharge(rhs.fCharge) {}
24
26{
27
28 if (this != &rhs) {
29 fAddress = rhs.fAddress;
30 fTime = rhs.fTime;
31 fCharge = rhs.fCharge;
32 }
33 return *this;
34}
35
36// ----- Set new charge ------------------------------------------------
37void CbmMuchDigi::SetAdc(int32_t adc)
38{
39 //ADC value should not be more than saturation
40 if (adc < 0) { fCharge = 0; }
41 else {
42 fCharge = adc;
43 }
44 // if Saturation
45 // int32_t saturation = (1<<12); //2 ^ 12 - 1;
46 int32_t saturation = (1 << 5); //2 ^ 5 - 1; // 32 for 5 bit adc*** modified by Ekata Nandy on 25/06/19***
47 if (fCharge >= saturation) {
48 //fCharge=saturation-1;
49 fCharge = saturation; //As ADC value starts from 1, so -1 removed. Modified by Ekata Nandy on 25/06/19
51 }
52 // if(fCharge < 0) fCharge=0;
53}
54// -------------------------------------------------------------------------
55
56
57// -------------------------------------------------------------------------
58void CbmMuchDigi::SetTime(uint64_t time) { fTime = time; }
59// -------------------------------------------------------------------------
60
61#ifndef NO_ROOT
63#endif
ClassImp(CbmConverterManager)
uint32_t fAddress
CbmMuchDigi & operator=(const CbmMuchDigi &)
bool fSaturationFlag
void SetTime(uint64_t time)
void SetAdc(int32_t adc)
uint16_t fCharge
uint64_t fTime