Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pierre-Alain Loizeau
cbmroot
Commits
77b7973a
Commit
77b7973a
authored
Nov 11, 2021
by
Alexandru Bercuci
Committed by
Volker Friese
Nov 11, 2021
Browse files
Hit reconstruction for TRD-2D. Introduces calibrated TrdDigis.
parent
2c789b6d
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
6053 additions
and
421 deletions
+6053
-421
core/data/trd/CbmTrdCluster.cxx
core/data/trd/CbmTrdCluster.cxx
+6
-1
core/data/trd/CbmTrdHit.cxx
core/data/trd/CbmTrdHit.cxx
+2
-1
core/data/trd/CbmTrdHit.h
core/data/trd/CbmTrdHit.h
+3
-1
core/detectors/trd/CbmTrdParModGas.cxx
core/detectors/trd/CbmTrdParModGas.cxx
+27
-0
core/detectors/trd/CbmTrdParModGas.h
core/detectors/trd/CbmTrdParModGas.h
+5
-0
macro/trd/geometry/trd.v18/Create_TRD_Geometry_v18b.C
macro/trd/geometry/trd.v18/Create_TRD_Geometry_v18b.C
+4365
-0
reco/detectors/trd/CMakeLists.txt
reco/detectors/trd/CMakeLists.txt
+1
-0
reco/detectors/trd/CbmTrdDigiRec.cxx
reco/detectors/trd/CbmTrdDigiRec.cxx
+118
-0
reco/detectors/trd/CbmTrdDigiRec.h
reco/detectors/trd/CbmTrdDigiRec.h
+67
-0
reco/detectors/trd/CbmTrdHitProducer.cxx
reco/detectors/trd/CbmTrdHitProducer.cxx
+15
-6
reco/detectors/trd/CbmTrdModuleRec.h
reco/detectors/trd/CbmTrdModuleRec.h
+4
-4
reco/detectors/trd/CbmTrdModuleRecT.cxx
reco/detectors/trd/CbmTrdModuleRecT.cxx
+1262
-374
reco/detectors/trd/CbmTrdModuleRecT.h
reco/detectors/trd/CbmTrdModuleRecT.h
+135
-14
reco/detectors/trd/CbmTrdRecoLinkDef.h
reco/detectors/trd/CbmTrdRecoLinkDef.h
+2
-1
sim/detectors/trd/CbmTrdModuleSimT.cxx
sim/detectors/trd/CbmTrdModuleSimT.cxx
+30
-15
sim/detectors/trd/CbmTrdModuleSimT.h
sim/detectors/trd/CbmTrdModuleSimT.h
+11
-4
No files found.
core/data/trd/CbmTrdCluster.cxx
View file @
77b7973a
...
...
@@ -140,7 +140,12 @@ Int_t CbmTrdCluster::IsChannelInRange(Int_t ch) const
Bool_t
CbmTrdCluster
::
Merge
(
CbmTrdCluster
*
second
)
{
if
(
GetRow
()
!=
second
->
GetRow
())
return
kFALSE
;
if
(
TMath
::
Abs
(
second
->
fStartTime
-
fStartTime
)
>
20
)
return
kFALSE
;
// time difference condition
if
(
fNCols
==
1
||
second
->
fNCols
==
1
)
{
if
(
TMath
::
Abs
(
second
->
fStartTime
-
fStartTime
)
>
50
)
return
kFALSE
;
}
else
if
(
TMath
::
Abs
(
second
->
fStartTime
-
fStartTime
)
>
20
)
return
kFALSE
;
// look before current
if
(
second
->
fStartCh
+
second
->
fNCols
==
fStartCh
&&
!
second
->
HasOpenStop
()
&&
!
HasOpenStart
())
{
// cout<<"Merge before with "<<second->ToString();
...
...
core/data/trd/CbmTrdHit.cxx
View file @
77b7973a
...
...
@@ -18,7 +18,7 @@
using
std
::
endl
;
using
std
::
stringstream
;
CbmTrdHit
::
CbmTrdHit
()
:
CbmPixelHit
(),
fDefine
(
0
),
fELoss
(
-
1.
)
CbmTrdHit
::
CbmTrdHit
()
:
CbmPixelHit
(),
fDefine
(
0
),
fNeighborId
(
-
1
),
fELoss
(
-
1.
)
{
SetType
(
kTRDHIT
);
SetTime
(
-
1
);
...
...
@@ -29,6 +29,7 @@ CbmTrdHit::CbmTrdHit(Int_t address, const TVector3& pos, const TVector3& dpos, D
Double_t
eLoss
,
Double_t
time
,
Double_t
timeError
)
:
CbmPixelHit
(
address
,
pos
,
dpos
,
dxy
,
refId
)
,
fDefine
(
0
)
,
fNeighborId
(
-
1
)
,
fELoss
(
eLoss
)
{
SetType
(
kTRDHIT
);
...
...
core/data/trd/CbmTrdHit.h
View file @
77b7973a
...
...
@@ -80,6 +80,7 @@ public:
Bool_t
GetMaxType
()
const
{
return
TESTBIT
(
fDefine
,
kMaxType
);
}
Bool_t
HasOverFlow
()
const
{
return
TESTBIT
(
fDefine
,
kOvfl
);
}
Bool_t
IsRowCross
()
const
{
return
TESTBIT
(
fDefine
,
kRowCross
);
}
Bool_t
IsUsed
()
const
{
return
(
GetRefId
()
<
0
);
}
/** Setters **/
void
SetELoss
(
Double_t
loss
)
{
fELoss
=
loss
;
}
...
...
@@ -94,9 +95,10 @@ public:
private:
UChar_t
fDefine
;
// hit extra info
Int_t
fNeighborId
;
// refId in case of row cross clusters
Double32_t
fELoss
;
// Energy deposit due to TR + dEdx
ClassDef
(
CbmTrdHit
,
3
);
ClassDef
(
CbmTrdHit
,
4
);
};
#endif
core/detectors/trd/CbmTrdParModGas.cxx
View file @
77b7973a
...
...
@@ -118,6 +118,33 @@ Float_t CbmTrdParModGas::EkevFC(Float_t ekev) const
// return (sFASP-s0FASP)/gFASP;
}
//_______________________________________________________________________________________________
Float_t
CbmTrdParModGas
::
EfCkeV
(
Float_t
efC
)
const
{
/** Convert energy deposit to no of primary ionisations and apply gas gain.
* Currently gas gain is evaluated from 55Fe spectrum analysis on ArCO2(80/20)
*/
Int_t
gasId
=
GetNobleGasType
()
-
1
;
Float_t
wi
=
(
1.
-
fPercentCO2
)
*
fgkWi
[
gasId
]
+
fPercentCO2
*
fgkWi
[
2
];
//gas gain
// G = G[ev->ADC] * wi[ArCO2]/C[mV->ADC]/A[fC->mV]/e
// G[ev->ADC] : measured gain based on 55Fe spectrum (expo)
// wi[ArCO2] : average energy to produce a ele-ion pair in mixture (27.24 ev)
// C[mV->ADC] : FASP out [2V] to ADC range [4096 ch] (2)
// A[fC->mV] : FASP gain from CADENCE (6)
// e : 1.6e-4 [fC] electric charge
Double_t
gain
=
170.25
*
TMath
::
Exp
(
fgkGGainUaPar
[
0
]
+
fgkGGainUaPar
[
1
]
*
fUa
*
1.e-3
)
/
12.
;
// for Xe correct Ar gain measurements TODO
if
(
gasId
==
0
)
gain
*=
0.6
;
Float_t
ekev
=
efC
*
wi
/
gain
/
0.16
;
if
(
VERBOSE
)
printf
(
" ua[V]=%d gain[%5.2e] wi[eV]=%5.2f :: E[keV]=%6.3f E[fC]=%6.2f
\n
"
,
fUa
,
gain
,
wi
,
ekev
,
efC
);
return
ekev
;
}
//_______________________________________________________________________________________________
Int_t
CbmTrdParModGas
::
GetShellId
(
const
Char_t
shell
)
const
{
...
...
core/detectors/trd/CbmTrdParModGas.h
View file @
77b7973a
...
...
@@ -49,6 +49,11 @@ public:
* \return charge at FASP input in fC
*/
Float_t
EkevFC
(
Float_t
ekev
)
const
;
/** \brief Convert pad-plane charge in fC to energy deposit [keV] taking into account the gas gain
* \param[in] efc charge in fC
* \return energy deposit in keV
*/
Float_t
EfCkeV
(
Float_t
efc
)
const
;
TString
GetFileName
()
const
{
return
fFileNamePID
;
}
Double_t
GetNobleGas
()
const
{
return
1.
-
fPercentCO2
;
}
const
Char_t
*
GetNobleGasName
()
const
{
return
(
GetNobleGasType
()
-
1
?
"Ar"
:
"Xe"
);
}
...
...
macro/trd/geometry/trd.v18/Create_TRD_Geometry_v18b.C
0 → 100644
View file @
77b7973a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
reco/detectors/trd/CMakeLists.txt
View file @
77b7973a
...
...
@@ -52,6 +52,7 @@ CbmTrdHitProducer.cxx
CbmTrdModuleRec.cxx
CbmTrdModuleRecR.cxx
CbmTrdModuleRecT.cxx
CbmTrdDigiRec.cxx
unpack/CbmTrdUnpackConfig.cxx
unpack/CbmTrdUnpackAlgoBaseR.cxx
...
...
reco/detectors/trd/CbmTrdDigiRec.cxx
0 → 100644
View file @
77b7973a
/* Copyright (C) 2018-2020 Horia Hulubei National Institute of Physics and Nuclear Engineering, Bucharest
SPDX-License-Identifier: GPL-3.0-only
Authors: Alexandru Bercuci[committer] */
#include "CbmTrdDigiRec.h"
#include "CbmTrdFASP.h"
ClassImp
(
CbmTrdDigiRec
)
//_____________________________________________________________________________
CbmTrdDigiRec
::
CbmTrdDigiRec
()
:
CbmTrdDigi
()
,
fStatus
(
0
)
{
fG
[
0
]
=
1.
;
fG
[
1
]
=
1.
;
memset
(
fT
,
0
,
3
*
sizeof
(
Double_t
));
}
//_____________________________________________________________________________
CbmTrdDigiRec
::
CbmTrdDigiRec
(
const
CbmTrdDigi
&
d
,
Double_t
*
G
,
Double_t
*
T
)
:
CbmTrdDigi
(
d
),
fStatus
(
0
)
{
if
(
G
)
{
fG
[
0
]
=
G
[
0
];
fG
[
1
]
=
G
[
1
];
}
else
{
fG
[
0
]
=
1.
;
fG
[
1
]
=
1.
;
}
if
(
T
)
memcpy
(
fT
,
T
,
3
*
sizeof
(
Double_t
));
else
memset
(
fT
,
0
,
3
*
sizeof
(
Double_t
));
Int_t
dt
;
Double_t
t
,
r
=
CbmTrdDigi
::
GetCharge
(
t
,
dt
);
if
(
t
>
4094
)
SETBIT
(
fStatus
,
0
);
if
(
r
>
4094
)
SETBIT
(
fStatus
,
1
);
}
//_____________________________________________________________________________
CbmTrdDigiRec
::
CbmTrdDigiRec
(
const
CbmTrdDigi
&
d
,
const
CbmTrdDigi
&
dr
,
Double_t
*
G
,
Double_t
*
T
)
:
CbmTrdDigi
(
d
)
,
fStatus
(
0
)
{
/** Constructor and RAW digi merger
*/
if
(
G
)
{
fG
[
0
]
=
G
[
0
];
fG
[
1
]
=
G
[
1
];
}
else
{
fG
[
0
]
=
1.
;
fG
[
1
]
=
1.
;
}
if
(
T
)
memcpy
(
fT
,
T
,
3
*
sizeof
(
Double_t
));
else
memset
(
fT
,
0
,
3
*
sizeof
(
Double_t
));
Int_t
dt
;
Double_t
t
,
r
=
dr
.
GetCharge
(
t
,
dt
);
if
(
r
>
4094
)
SETBIT
(
fStatus
,
1
);
CbmTrdDigi
::
GetCharge
(
t
,
dt
);
if
(
t
>
4094
)
SETBIT
(
fStatus
,
0
);
dt
=
dr
.
GetTimeDAQ
()
-
GetTimeDAQ
();
SetCharge
(
t
,
r
,
dt
);
Int_t
rtrg
(
dr
.
GetTriggerType
()
&
2
),
ttrg
(
GetTriggerType
()
&
1
);
SetTriggerType
(
rtrg
|
ttrg
);
//merge the triggers
}
//_____________________________________________________________________________
Double_t
CbmTrdDigiRec
::
GetCharge
(
Int_t
typ
,
Bool_t
&
on
)
const
{
Int_t
dT
;
Double_t
T
,
R
=
CbmTrdDigi
::
GetCharge
(
T
,
dT
);
on
=
kTRUE
;
if
(
typ
)
{
// rectangular pairing
if
(
R
>
0
)
{
R
-=
CbmTrdFASP
::
GetBaselineCorr
();
return
fG
[
1
]
*
R
;
}
else
on
=
kFALSE
;
}
else
{
// tilt pairing
if
(
T
>
0
)
{
T
-=
CbmTrdFASP
::
GetBaselineCorr
();
return
fG
[
0
]
*
T
;
}
else
on
=
kFALSE
;
}
return
0.
;
}
//_____________________________________________________________________________
Double_t
CbmTrdDigiRec
::
GetTime
(
Int_t
typ
)
const
{
Int_t
dT
;
Double_t
T
,
R
=
CbmTrdDigi
::
GetCharge
(
T
,
dT
);
if
(
typ
)
{
// rectangular pairing
Double_t
R0
=
R
-
fT
[
2
];
return
GetTimeDAQ
()
+
dT
+
fT
[
0
]
*
R0
*
R0
+
fT
[
1
]
*
R0
;
}
else
{
// tilt pairing
Double_t
T0
=
T
-
fT
[
2
];
return
GetTimeDAQ
()
+
fT
[
0
]
*
T0
*
T0
+
fT
[
1
]
*
T0
;
}
}
//_____________________________________________________________________________
void
CbmTrdDigiRec
::
Init
(
Double_t
g
[
2
],
Double_t
t
[
3
])
{
fG
[
0
]
=
g
[
0
];
fG
[
1
]
=
g
[
1
];
memcpy
(
fT
,
t
,
3
*
sizeof
(
Double_t
));
}
reco/detectors/trd/CbmTrdDigiRec.h
0 → 100644
View file @
77b7973a
/* Copyright (C) 2018-2020 Horia Hulubei National Institute of Physics and Nuclear Engineering, Bucharest
SPDX-License-Identifier: GPL-3.0-only
Authors: Alexandru Bercuci[committer] */
#ifndef CBMTRDDIGIREC_H
#define CBMTRDDIGIREC_H
#include "CbmTrdDigi.h"
/** @class CbmTrdDigiRec
** @brief Extend the TRD(2D) digi class to incorporate FEE calibration.
** @author Alexandru Bercucic <abercuci@niham.nipne.ro>
** @since 01.10.2021
** @date 01.10.2021
**
** The digi class contains the information as it is produced by the FEE (ASIC/GETS)
** The variation from channel to channel is captured by running the pulser on anode wires
** using various signal values, frequencies, etc. The calibrated baselines, gains, jitter,
** etc. are transported via the parameter files and are applied to the data within the digRec
** class which is in the end used to calculate the TRD hit parameters.
**/
class
CbmTrdDigiRec
:
public
CbmTrdDigi
{
friend
class
CbmTrdModuleRecT
;
public:
/** \brief Default constructor*/
CbmTrdDigiRec
();
/** \brief Wrap CbmTrdDigi constructor*/
CbmTrdDigiRec
(
const
CbmTrdDigi
&
d
,
Double_t
*
g
=
NULL
,
Double_t
*
t
=
NULL
);
virtual
~
CbmTrdDigiRec
()
{
;
}
/** \brief Return calibrated tilt signal
* \param[out] on flag signal exists */
Double_t
GetTiltCharge
(
Bool_t
&
on
)
const
{
return
GetCharge
(
0
,
on
);
}
/** \brief Return calibrated tilt time [ns]*/
Double_t
GetTiltTime
()
const
{
return
GetTime
(
0
);
}
/** \brief Return calibrated rect signal
* \param[out] on flag signal exists */
Double_t
GetRectCharge
(
Bool_t
&
on
)
const
{
return
GetCharge
(
1
,
on
);
}
/** \brief Return calibrated rect time [ns]*/
Double_t
GetRectTime
()
const
{
return
GetTime
(
1
);
}
/** \brief Return calibrated signal
* \param[in] typ tilt [0], rect [1]
* \param[out] on flag signal exists
*/
Double_t
GetCharge
(
Int_t
typ
,
Bool_t
&
on
)
const
;
/** \brief Return calibrated time
* \param[in] typ tilt [0], rect [1]
*/
Double_t
GetTime
(
Int_t
typ
)
const
;
Bool_t
HasRectOvf
()
const
{
return
TESTBIT
(
fStatus
,
1
);
}
Bool_t
HasTiltOvf
()
const
{
return
TESTBIT
(
fStatus
,
0
);
}
/** \brief Init FEE gain and time walk corrections */
void
Init
(
Double_t
g
[
2
],
Double_t
t
[
3
]);
protected:
/** \brief Constructor and merger*/
CbmTrdDigiRec
(
const
CbmTrdDigi
&
dt
,
const
CbmTrdDigi
&
dr
,
Double_t
*
g
=
NULL
,
Double_t
*
t
=
NULL
);
private:
UChar_t
fStatus
;
//< bit map to store calibration flags
Double_t
fG
[
2
];
//< FEE gain correction for channel T & R
Double_t
fT
[
3
];
//< FEE time walk correction as function of charge
ClassDef
(
CbmTrdDigiRec
,
1
);
// Wrapper around the RAW TRD digi (CbmTrdDigi) to acount for calibration
};
#endif
reco/detectors/trd/CbmTrdHitProducer.cxx
View file @
77b7973a
...
...
@@ -80,11 +80,19 @@ void CbmTrdHitProducer::addModuleHits(CbmTrdModuleRec* mod, Int_t* hitCounter, C
//____________________________________________________________________________________
CbmTrdModuleRec
*
CbmTrdHitProducer
::
AddModule
(
Int_t
address
,
TGeoPhysicalNode
*
node
)
{
TString
s
(
node
->
GetName
());
Int_t
typ
=
TString
(
s
[
s
.
Index
(
"module"
)
+
6
]).
Atoi
();
CbmTrdGeoHandler
geoHandler
;
Int_t
moduleAddress
=
geoHandler
.
GetModuleAddress
(
node
->
GetName
()),
moduleType
=
geoHandler
.
GetModuleType
(
node
->
GetName
()),
lyId
=
CbmTrdAddress
::
GetLayerId
(
address
);
if
(
moduleAddress
!=
address
)
{
LOG
(
error
)
<<
"CbmTrdHitProducer::AddModule: Module ID "
<<
address
<<
" does not match geometry definition "
<<
moduleAddress
<<
". Module init failed!"
;
return
NULL
;
}
LOG
(
debug
)
<<
GetName
()
<<
"::AddModule("
<<
node
->
GetName
()
<<
" "
<<
(
moduleType
<
9
?
'R'
:
'T'
)
<<
"] mod["
<<
moduleAddress
<<
"] ly["
<<
lyId
<<
"] det["
<<
moduleAddress
<<
"]"
;
CbmTrdModuleRec
*
module
(
NULL
);
if
(
typ
=
=
9
)
{
module
=
fModules
[
address
]
=
new
CbmTrdModuleRecT
(
address
);
}
if
(
moduleType
>
=
9
)
{
module
=
fModules
[
address
]
=
new
CbmTrdModuleRecT
(
address
);
}
else
{
module
=
fModules
[
address
]
=
new
CbmTrdModuleRecR
(
address
);
}
...
...
@@ -125,7 +133,7 @@ CbmTrdModuleRec* CbmTrdHitProducer::AddModule(Int_t address, TGeoPhysicalNode* n
module
->
SetChmbPar
(
pChmb
);
// try to load Gain parameters for module
if
(
typ
=
=
9
)
{
if
(
moduleType
>
=
9
)
{
const
CbmTrdParModGain
*
pGain
(
NULL
);
if
(
!
fGainPar
||
!
(
pGain
=
(
const
CbmTrdParModGain
*
)
fGainPar
->
GetModulePar
(
address
)))
{
//LOG(warn) << GetName() << "::AddModule : No Gain params for modAddress "<< address <<". Using default.";
...
...
@@ -187,6 +195,7 @@ void CbmTrdHitProducer::processCluster(const Int_t clusterIdx)
auto
mod
=
imod
->
second
;
std
::
vector
<
const
CbmTrdDigi
*>
digivec
=
{};
// get digis for current cluster
for
(
Int_t
iDigi
=
0
;
iDigi
<
cluster
->
GetNofDigis
();
iDigi
++
)
{
const
CbmTrdDigi
*
digi
=
CbmDigiManager
::
Instance
()
->
Get
<
CbmTrdDigi
>
(
cluster
->
GetDigi
(
iDigi
));
...
...
@@ -194,7 +203,6 @@ void CbmTrdHitProducer::processCluster(const Int_t clusterIdx)
if
(
digi
->
GetType
()
==
CbmTrdDigi
::
eCbmTrdAsicType
::
kSPADIC
&&
digi
->
GetCharge
()
<=
0
)
continue
;
digivec
.
emplace_back
(
digi
);
}
mod
->
MakeHit
(
clusterIdx
,
cluster
,
&
digivec
);
fNrClusters
++
;
...
...
@@ -207,7 +215,8 @@ Int_t CbmTrdHitProducer::addHits(CbmEvent* event)
for
(
std
::
map
<
Int_t
,
CbmTrdModuleRec
*>::
iterator
imod
=
fModules
.
begin
();
imod
!=
fModules
.
end
();
imod
++
)
{
auto
mod
=
imod
->
second
;
mod
->
Finalize
();
mod
->
PreProcessHits
();
mod
->
PostProcessHits
();
addModuleHits
(
mod
,
&
hitCounter
,
event
);
}
...
...
reco/detectors/trd/CbmTrdModuleRec.h
View file @
77b7973a
...
...
@@ -38,10 +38,10 @@ public:
* \brief Clear local storage
**/
virtual
void
Clear
(
Option_t
*
opt
=
""
);
/**
* \brief Reconstruct physics observables on hits
*
*/
virtual
Bool_t
Finalize
()
{
return
kTRUE
;
}
/**
\brief Hit quality assesment */
virtual
Bool_t
PreProcessHits
()
{
return
kTRUE
;
}
/** \brief Hit quality assesment
*/
virtual
Bool_t
PostProcessHits
()
{
return
kTRUE
;
}
/**
* \brief Steering routine for finding digits clusters
**/
...
...
reco/detectors/trd/CbmTrdModuleRecT.cxx
View file @
77b7973a
This diff is collapsed.
Click to expand it.
reco/detectors/trd/CbmTrdModuleRecT.h
View file @
77b7973a
...
...
@@ -10,14 +10,29 @@
#include <list>
#include <map>
#include <vector>
#define NBINSCORRX
151
//! no of bins in the discretized correction LUT
#define NBINSCORRX
50
//! no of bins in the discretized correction LUT
#define NBINSCORRY 4 //! no of bins in the parametrization correction
#define NANODE 9
using
std
::
list
;
using
std
::
map
;
using
std
::
vector
;
class
TGraphErrors
;
class
CbmTrdDigiRec
;
class
TF1
;
/**
* \brief Triangular pad module; Cluster finding and hit reconstruction algorithms
**/
/** @class CbmTrdModuleRecT
** @brief Cluster finding and hit reconstruction algorithms for the TRD(2D) module.
** @author Alexandru Bercucic <abercuci@niham.nipne.ro>
** @since 01.02.2019
** @date 01.10.2021
**
** Extend the TRD module reconstructor for the particular case of inner TRD-2D modules.
** The class is a collection of algorithms to :
** - identify time and spatially correlated digis and build clusters
** - identify the type of clusters and apply further merging/deconvolution
** - apply FEE (channel gain, baseline) and detector (energy gain, maps, etc) calibration
** - steer the calculation of hit 4D parameters (x, y, t, E)
**/
class
CbmTrdModuleRecT
:
public
CbmTrdModuleRec
{
public:
enum
CbmTrdModuleRecTconfig
...
...
@@ -41,16 +56,67 @@ public:
* \param[in] d drawing toggle
*/
virtual
inline
void
Config
(
Bool_t
v
,
Bool_t
d
);
virtual
void
DrawHit
(
CbmTrdHit
*
)
const
{
;
}
/** \brief Count RO channels (R or T) with data**/
virtual
Int_t
GetOverThreshold
()
const
;
/** \brief Check hit quality (deconvolute pile-ups, etc)**/
virtual
Bool_t
PreProcessHits
();
/** \brief Finalize hits (merge RC hits, etc)**/
virtual
Bool_t
Finalize
();
virtual
Bool_t
PostProcessHits
();
/** \brief Finalize clusters **/
virtual
Int_t
FindClusters
();
/** \brief Steering routine for building hits **/
virtual
Bool_t
MakeHits
();
/** \brief Steering routine for converting cluster to hit **/
virtual
CbmTrdHit
*
MakeHit
(
Int_t
cId
,
const
CbmTrdCluster
*
c
,
std
::
vector
<
const
CbmTrdDigi
*>*
digis
);
/** \brief Load RAW digis into working array of RECO digis
* \param[in] din list of RAW digis in increasing order of column no
* \param[in] cid cluster index in the cluster array
* \return no of digis loaded
*/
Int_t
LoadDigis
(
vector
<
const
CbmTrdDigi
*>*
din
,
Int_t
cid
);
Int_t
ProjectDigis
(
Int_t
cid
,
Int_t
cjd
=
-
1
);
/** \brief Implement topologic cuts for hit merging
* \return index of anode wire wrt to boundary or 0 if check fails
*/
Int_t
CheckMerge
(
Int_t
cid
,
Int_t
cjd
);
/** \brief Algorithm for hit merging
* \param[in] h hit to be modified by addition of hp.
* \param[in] a0 anode hypothesis around boundary (see CheckMerge function).
* \return TRUE if succesful.
*/
Bool_t
MergeHits
(
CbmTrdHit
*
h
,
Int_t
a0
);
Bool_t
BuildHit
(
CbmTrdHit
*
h
);
UShort_t
GetHitMap
()
const
{
return
vyM
;
}
/** \brief x position correction based on LUT
* \param[in] dx offset computed on charge sharing expressed in [pw]
* \param[in] typ hit type central pad [0] or edge [1]
* \param[in] cls correction class x wrt center [0] row-cross [1] row-cross biassed x [2]
* \return correction expresed in [cm]
*/
Double_t
GetXcorr
(
Double_t
dx
,
Int_t
typ
,
Int_t
cls
=
0
)
const
;
/** \brief y position correction based on LUT
* \param[in] dy offset computed on charge sharing expressed in [ph]
* \param[in] cls correction class
* \return correction expresed in [cm]
*/
Double_t
GetYcorr
(
Double_t
dy
,
Int_t
cls
=
0
)
const
;
/** \brief Shift graph representation to [-0.5, 0.5]
* \param[in] dx offset wrt center pad [pw]
*/
void
RecenterXoffset
(
Double_t
&
dx
);
/** \brief Shift graph representation to [-0.5, 0.5]
* \param[in] dy offset wrt center pad [ph]
*/
void
RecenterYoffset
(
Double_t
&
dy
);
/** \brief Hit classification wrt center pad
* \return hit type : center hit [0]; side hit [1]
*/
Int_t
GetHitClass
()
const
;
/** \brief Hit classification wrt signal bias
* \return hit type : center hit [0]; side hit [1]
*/
Int_t
GetHitRcClass
(
Int_t
a0
)
const
;
protected:
private:
...
...
@@ -59,8 +125,18 @@ private:
Bool_t
CDRAW
()
const
{
return
TESTBIT
(
fConfigMap
,
kDraw
);
}
Bool_t
CWRITE
()
const
{
return
TESTBIT
(
fConfigMap
,
kVerbose
);
}
Double_t
GetXoffset
(
Int_t
n0
)
const
;
Double_t
GetYoffset
(
Int_t
n0
)
const
;
/** \brief Implement cuts for hit convolution definition
* \param[in] h hit to be analysed.
* \return TRUE if double cluster
*/
Bool_t
CheckConvolution
(
CbmTrdHit
*
h
)
const
;
/** \brief Algorithm for cluster spliting
* \param[in] h hit to be analysed.
* \return TRUE if succesful. The extra cluster is added to the end of the hits array
*/
Bool_t
Deconvolute
(
CbmTrdHit
*
h
);
Double_t
GetXoffset
(
Int_t
n0
=
0
)
const
;
Double_t
GetYoffset
(
Int_t
n0
=
0
)
const
;
/** \brief Load digis info into local data structures
* \param[in] digis initial digis list shrinked for incomplete digis.
* \param[in] vdgM list of merged digis
...
...
@@ -71,6 +147,9 @@ private:
*/
Int_t
LoadDigis
(
std
::
vector
<
const
CbmTrdDigi
*>*
digis
,
std
::
vector
<
CbmTrdDigi
*>*
vdgM
,
std
::
vector
<
Bool_t
>*
vmask
,
ULong64_t
&
t0
,
Int_t
&
cM
);
Int_t
LoadDigisRC
(
vector
<
const
CbmTrdDigi
*>*
digis
,
const
Int_t
r0
,
const
Int_t
a0
,
/*vector<CbmTrdDigi*> *vdgM, */
ULong64_t
&
t0
,
Int_t
&
cM
);
/** \brief Merge R/T signals to digis if topological conditions in cluster are fulfilled
* \param[in] digis initial digis list.
* \param[out] vdgM list of merged digis
...
...
@@ -79,25 +158,61 @@ private:
*/
Bool_t
MergeDigis
(
std
::
vector
<
const
CbmTrdDigi
*>*
digis
,
std
::
vector
<
CbmTrdDigi
*>*
vdgM
,
std
::
vector
<
Bool_t
>*
vmask
);
Bool_t
HasLeftSgn
()
const
{
return
TESTBIT
(
vyM
,
3
);
}
Bool_t
HasOvf
()
const
{
return
TESTBIT
(
vyM
,
12
);
}
Bool_t
IsBiasX
()
const
{
return
TESTBIT
(
vyM
,
4
);
}
Bool_t
IsBiasXleft
()
const
{
return
TESTBIT
(
vyM
,
5
);
}
Bool_t
IsBiasXmid
()
const
{
return
TESTBIT
(
vyM
,
6
);
}
Bool_t
IsBiasXright
()
const
{
return
TESTBIT
(
vyM
,
7
);
}
Bool_t
IsBiasY
()
const
{
return
TESTBIT
(
vyM
,
8
);
}
Bool_t
IsBiasYleft
()
const
{
return
TESTBIT
(
vyM
,
9
);
}
Bool_t
IsLeftHit
()
const
{
return
TESTBIT
(
vyM
,
2
);
}
Bool_t
IsMaxTilt
()
const
{
return
TESTBIT
(
vyM
,
0
);
}
Bool_t
IsOpenLeft
()
const
{
return
(
viM
%
2
&&
!
IsMaxTilt
())
||
(
!
(
viM
%
2
)
&&
IsMaxTilt
());
}
inline
Bool_t
IsOpenRight
()
const
;
Bool_t
IsSymmHit
()
const
{
return
TESTBIT
(
vyM
,
1
);
}
void
SetBiasX
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
4
)
:
CLRBIT
(
vyM
,
4
);
}
void
SetBiasXleft
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
5
)
:
CLRBIT
(
vyM
,
5
);
}
void
SetBiasXmid
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
6
)
:
CLRBIT
(
vyM
,
6
);
}
void
SetBiasXright
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
7
)
:
CLRBIT
(
vyM
,
7
);
}
void
SetBiasY
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
8
)
:
CLRBIT
(
vyM
,
8
);
}
void
SetBiasYleft
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
9
)
:
CLRBIT
(
vyM
,
9
);
}
void
SetBiasYmid
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
10
)
:
CLRBIT
(
vyM
,
10
);
}
void
SetBiasYright
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
11
)
:
CLRBIT
(
vyM
,
11
);
}
void
SetLeftSgn
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
3
)
:
CLRBIT
(
vyM
,
3
);
}
void
SetLeftHit
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
2
)
:
CLRBIT
(
vyM
,
2
);
}
void
SetSymmHit
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
1
)
:
CLRBIT
(
vyM
,
1
);
}
void
SetMaxTilt
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
0
)
:
CLRBIT
(
vyM
,
0
);
}
void
SetOvf
(
Bool_t
set
=
1
)
{
set
?
SETBIT
(
vyM
,
12
)
:
CLRBIT
(
vyM
,
12
);
}
UChar_t
fConfigMap
;
// task configuration settings
ULong64_t
fT0
;
//! start time of event/time slice [clk]
std
::
map
<
Int_t
,
std
::
list
<
CbmTrdCluster
*>>
fBuffer
;
//row-wise organized clusters
std
::
vector
<
Double_t
>
vs
;
//! working copy of signals from cluster
std
::
vector
<
Double_t
>
vse
;
//! working copy of signal errors from cluster
std
::
vector
<
Char_t
>
vt
;
//! working copy of signal relative timing
std
::
vector
<
Double_t
>
vx
;
//! working copy of signal relative positions
std
::
vector
<
Double_t
>
vxe
;
//! working copy of signal relative position errors
std
::
map
<
Int_t
,
vector
<
CbmTrdDigiRec
*>>
fDigis
;
//!cluster-wise organized calibrated digi
// working representation of a hit on which the reconstruction is performed
ULong64_t
vt0
;
//! start time of current hit [clk]
UChar_t
vcM
;
//! maximum col
UChar_t
vrM
;
//! maximum row
UChar_t
viM
;
//! index of maximum signal in the projection
UShort_t
vyM
;
//! bit map for cluster topology classification
std
::
vector
<
Double_t
>
vs
;
//! working copy of signals from cluster
std
::
vector
<
Double_t
>
vse
;
//! working copy of signal errors from cluster
std
::
vector
<
Char_t
>
vt
;
//! working copy of signal relative timing
std
::
vector
<
Double_t
>
vx
;
//! working copy of signal relative positions
std
::
vector
<
Double_t
>
vxe
;
//! working copy of signal relative position errors
static
Float_t
fgCorrXdx
;
//! step of the discretized correction LUT
static
Float_t
fgCorrXval
[
2
][
NBINSCORRX
];
//! discretized correction LUT
static
Float_t
fgCorrXval
[
3
][
NBINSCORRX
];
//! discretized correction LUT
static
Float_t
fgCorrYval
[
NBINSCORRY
][
2
];
//! discretized correction params
static
Float_t
fgCorrRcXval
[
2
][
NBINSCORRX
];
//! discretized correction LUT
static
Float_t
fgCorrRcXbiasXval
[
3
][
NBINSCORRX
];
//! discretized correction LUT
static
Double_t
fgDT
[
3
];
//! FASP delay wrt signal
static
TGraphErrors
*
fgEdep
;
//! data handler for cluster PRF
static
TF1
*
fgPRF
;
//! fitter for cluster PRF
static
TGraphErrors
*
fgT
;
//! data handler for cluster TRF
ClassDef
(
CbmTrdModuleRecT
,
1
)
// Triangular pad module; Cluster finding and hit reconstruction algorithms
2
)
// Triangular pad module; Cluster finding and hit reconstruction algorithms
};
void
CbmTrdModuleRecT
::
Config
(
Bool_t
v
,
Bool_t
d
)
...
...
@@ -111,4 +226,10 @@ void CbmTrdModuleRecT::Config(Bool_t v, Bool_t d)
CLRBIT
(
fConfigMap
,
kDraw
);
printf
(
"CbmTrdModuleRecT::Draw[%c]
\n
"
,
CDRAW
()
?
'y'
:
'n'
);
}
Bool_t
CbmTrdModuleRecT
::
IsOpenRight
()
const
{
Int_t
nR
=
vs
.
size
()
-
1
-
viM
;
return
(
nR
%
2
&&
IsMaxTilt
())
||
(
!
(
nR
%
2
)
&&
!
IsMaxTilt
());
}
#endif
reco/detectors/trd/CbmTrdRecoLinkDef.h
View file @
77b7973a
/* Copyright (C) 2020 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
SPDX-License-Identifier: GPL-3.0-only
Authors: Pascal Raisig [committer] */
Authors: Pascal Raisig [committer]
, Alexandru Bercuci
*/
// $Id: TrdRecoLinkDef.h $