CbmRoot
Loading...
Searching...
No Matches
CbmTrdModuleSim.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#ifndef CBMTRDMODULESIM_H
6#define CBMTRDMODULESIM_H
7
8#include "CbmTrdCheckUtil.h"
10#include "CbmTrdRawToDigiR.h"
11
12#include <map>
13#include <memory>
14
15class TClonesArray;
16class CbmTrdPoint;
17class CbmTrdDigi;
18class CbmMatch;
19class CbmTrdDigitizer;
20class CbmTrdRadiator;
25public:
39 CbmTrdModuleSim(Int_t mod, Int_t ly, Int_t rot);
40
41 virtual ~CbmTrdModuleSim();
42
43 virtual void GetCounters(Int_t& nEl, Int_t& nLattice, Int_t& nOverThr) const
44 {
45 nEl = 0;
46 nLattice = 0;
47 nOverThr = 0;
48 }
49 virtual std::map<Int_t, std::pair<CbmTrdDigi*, CbmMatch*>>* GetDigiMap() { return &fDigiMap; }
50 virtual Int_t GetEventId() const { return fEventId; }
51 virtual Int_t GetInputId() const { return fInputId; }
52 virtual Int_t GetPointId() const { return fPointId; }
58 virtual Int_t FlushBuffer(ULong64_t time = 0) = 0;
65 virtual Bool_t MakeDigi(CbmTrdPoint* p, Double_t time, Bool_t TR = kFALSE) = 0;
69 virtual Bool_t MakeRaw() = 0;
70
71 // virtual void SetAsicPar(CbmTrdParSetAsic *p=NULL)=0;
72 void SetDigitizer(CbmTrdDigitizer* digitizer) { fDigitizer = digitizer; }
73 virtual void SetEventId(Int_t id) { fEventId = id; }
74 virtual void SetInputId(Int_t id) { fInputId = id; }
75 virtual void SetPointId(Int_t id) { fPointId = id; }
77 virtual void SetRadiator(std::shared_ptr<CbmTrdRadiator> radiator) { fRadiator = radiator; }
78 virtual void SetGamma(Double_t gamma = 0.) = 0;
79 virtual void SetPositionMC(Double_t pos[3]) { memcpy(fXYZ, pos, 3 * sizeof(Double_t)); }
80 virtual void SetLinkId(Int_t input, Int_t event = -1, Int_t point = -1)
81 {
82 fInputId = input;
83 fEventId = event;
84 fPointId = point;
85 }
86 virtual void ResetCounters() { ; }
87 virtual void SetMessageConverter(CbmTrdRawToDigiR* conv = NULL) = 0;
88 virtual void SetQA(CbmTrdCheckUtil* qa = NULL) = 0;
89 virtual void SetTimeSysOffset(int dt) { fTimeSysOffset = dt; }
90
91protected:
92 // definitions of MC input
93 Int_t fPointId;
94 Int_t fEventId;
95 Int_t fInputId;
96 Int_t fTimeSysOffset = 0;
97 Double_t fXYZ[3];
99
100 // calibration objects
102 std::shared_ptr<CbmTrdRadiator> fRadiator = nullptr;
103
104 std::map<Int_t, std::pair<CbmTrdDigi*, CbmMatch*>>
106 std::map<Int_t, std::vector<std::pair<CbmTrdDigi*, CbmMatch*>>>
108
109private:
112
113
114 ClassDef(CbmTrdModuleSim, 1)
115};
116#endif
Abstract class for the TRD module It provides access to the basic properties of the chamber as follow...
Abstract class for module wise digitization and raw format producing.
std::shared_ptr< CbmTrdRadiator > fRadiator
Pointer to digitizer.
virtual void SetTimeSysOffset(int dt)
virtual Bool_t MakeDigi(CbmTrdPoint *p, Double_t time, Bool_t TR=kFALSE)=0
Steering routine for converting MC point to digits.
CbmTrdModuleSim()
Default constructor.
@ kNoise
switch noise digits generation
@ kTime
select Time based/Event by event simulations
@ kWeightDistance
use weighting distance for link generation
void SetDigitizer(CbmTrdDigitizer *digitizer)
std::map< Int_t, std::vector< std::pair< CbmTrdDigi *, CbmMatch * > > > fBuffer
Local digits buffer as function of time for each TRD channel in the module.
Int_t fInputId
MC input file number.
virtual void SetLinkId(Int_t input, Int_t event=-1, Int_t point=-1)
Int_t fPointId
MC point id being processed.
virtual Int_t GetEventId() const
std::map< Int_t, std::pair< CbmTrdDigi *, CbmMatch * > > fDigiMap
Temporary storage for complete digis for each CBM address.
virtual Bool_t MakeRaw()=0
Steering routine for converting MC point to raw format.
virtual void SetPositionMC(Double_t pos[3])
virtual void SetPointId(Int_t id)
CbmTrdModuleSim(const CbmTrdModuleSim &ref)
Int_t fEventId
MC event id being processed.
virtual void SetInputId(Int_t id)
virtual void SetEventId(Int_t id)
virtual void ResetCounters()
virtual Int_t GetPointId() const
const CbmTrdModuleSim & operator=(const CbmTrdModuleSim &ref)
virtual void SetGamma(Double_t gamma=0.)=0
virtual std::map< Int_t, std::pair< CbmTrdDigi *, CbmMatch * > > * GetDigiMap()
Int_t fTimeSysOffset
Time offset of TRD digis to align them with other detectors (Bmon, ToF)
virtual void SetMessageConverter(CbmTrdRawToDigiR *conv=NULL)=0
Double_t fXYZ[3]
MC position of the point in module coordinates.
CbmTrdDigitizer * fDigitizer
virtual Int_t GetInputId() const
virtual Int_t FlushBuffer(ULong64_t time=0)=0
Flush local digi buffer.
virtual void GetCounters(Int_t &nEl, Int_t &nLattice, Int_t &nOverThr) const
virtual ~CbmTrdModuleSim()
virtual void SetQA(CbmTrdCheckUtil *qa=NULL)=0
virtual void SetRadiator(std::shared_ptr< CbmTrdRadiator > radiator)
Set the Radiator.