Go to the documentation of this file.
20 #include <FairLogger.h>
21 #include <FairRootManager.h>
22 #include <FairRunAna.h>
23 #include <FairRuntimeDb.h>
27 #include <TClonesArray.h>
28 #include <TGeoPhysicalNode.h>
29 #include <TStopwatch.h>
39 using std::setprecision;
45 : FairTask(
"TrdClusterFinder", 1)
55 , fModClusterDigiMap()
102 LOG(fatal) << GetName() <<
"::AddModule : No Geo params for module "
103 << address <<
". Using default.";
111 LOG(warn) << GetName() <<
"::AddModule : No Read-Out params for modAddress "
112 << address <<
". Using default.";
120 LOG(warn) << GetName() <<
"::AddModule : No ASIC params for modAddress "
121 << address <<
". Using default.";
130 LOG(warn) << GetName() <<
"::AddModule : No Gas params for modAddress "
131 << address <<
". Using default.";
151 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetAsic"));
153 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetGas"));
155 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetDigi"));
157 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetGain"));
165 FairRootManager* ioman = FairRootManager::Instance();
171 fClusters =
new TClonesArray(
"CbmTrdCluster", 100);
173 "TrdCluster",
"TRD",
fClusters, IsOutputBranchPersistent(
"TrdCluster"));
175 if (!
IsTimeBased() && !ioman->GetObject(
"Event")) {
176 LOG(warn) << GetName()
177 <<
": Event mode selected but no event array found! Run in "
201 LOG(info) <<
"================ TRD Cluster Finder ===============";
202 LOG(info) <<
" Free streaming : " << (
IsTimeBased() ?
"yes" :
"no");
203 LOG(info) <<
" Multi hit detect : " << (
HasMultiHit() ?
"yes" :
"no");
204 LOG(info) <<
" Row merger : " << (
HasRowMerger() ?
"yes" :
"no");
205 LOG(info) <<
" c-Neighbour enable: " << (
HasNeighbourCol() ?
"yes" :
"no");
206 LOG(info) <<
" r-Neighbour enable: " << (
HasNeighbourRow() ?
"yes" :
"no");
207 LOG(info) <<
" Write clusters : " << (
HasDumpClusters() ?
"yes" :
"no");
236 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
244 std::map<Int_t, CbmTrdModuleRec*>::iterator imod =
255 Int_t digiCounter(0), clsCounter(0);
256 for (std::map<Int_t, CbmTrdModuleRec*>::iterator imod =
fModules.begin();
266 for (std::map<Int_t, CbmTrdModuleRec*>::iterator imod =
fModules.begin();
269 imod->second->Clear(
"cls");
273 LOG(info) << GetName() <<
"::Exec : Digis : " << nDigis <<
" / "
276 LOG(info) << GetName() <<
"::Exec : Clusters : " << clsCounter;
277 LOG(info) << GetName() <<
"::Exec : real time=" << timer.RealTime()
278 <<
" CPU time=" << timer.CpuTime();
288 if (!clusters)
return 0;
293 Int_t ncl(
fClusters->GetEntriesFast()), mcl(0), ncols(0);
295 for (Int_t ic(0); ic < clusters->GetEntriesFast(); ic++) {
298 if (!cls->HasTrianglePads()) {
302 LOG(error) <<
"CbmTrdClusterFinder::AddClusters : Can't find "
303 "ParModDigi for address"
304 << cls->GetAddress();
311 for (Int_t
id = 0;
id < cls->GetNofDigis();
id++) {
314 Int_t colId = digiChannel % ncols;
315 Int_t globalRow = digiChannel / ncols;
317 Int_t combiId = globalRow * ncols + colId;
318 cols.SetBitNumber(combiId);
319 rows.SetBitNumber(globalRow);
322 cls->SetNCols(cols.CountBits());
323 cls->SetNRows(rows.CountBits());
325 clsSave =
new ((*fClusters)[ncl++])
328 if (cls->GetMatch() != NULL)
virtual const CbmTrdParSet * GetModuleSet(Int_t detId) const
Bool_t AddCluster(CbmTrdCluster *c)
Save one finished cluster to the output.
virtual Bool_t AddDigi(const CbmTrdDigi *, Int_t)
Add digi to local module.
Describe TRD module working settings (HV, etc)
InitStatus Init()
Initialisation.
Int_t GetAddressChannel() const
Getter read-out id.
Describe TRD module ASIC settings (electronic gain, delays, etc)
static Bool_t HasDumpClusters()
static Int_t GetNofDigis(ECbmModuleId systemId)
Abstract class for module wise cluster finding and hit reconstruction.
virtual void SetAsicPar(CbmTrdParSetAsic *p=nullptr)
static CbmDigiManager * Instance()
Static instance.
Data Container for TRD clusters.
Int_t AddClusters(TClonesArray *clusters, Bool_t moveOwner=kTRUE)
friend class CbmTrdModuleRecT
Definition of geometry for one TRD module.
CbmTrdParSetGain * fGainPar
parameter list for keV->ADC gain conversion
void SetTrianglePads(Bool_t set=kTRUE)
Helper class to extract information from the GeoManager.
const Digi * Get(Int_t index) const
Get a digi object.
static Bool_t HasNeighbourRow()
Definition of chamber gain conversion for one TRD module.
static Bool_t HasRowMerger()
static Float_t fgMinimumChargeTH
virtual TClonesArray * GetClusters()
CbmTrdParSetDigi * fDigiPar
parameter list for read-out geometry
virtual const CbmTrdParMod * GetModulePar(Int_t detId) const
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
static Bool_t HasMultiHit()
virtual void SetDigiPar(const CbmTrdParModDigi *p)
static Bool_t HasNeighbourCol()
CbmTrdModuleRec * AddModule(const CbmTrdDigi *d)
CbmTrdParSetGas * fGasPar
parameter list for HV status
virtual void SetChmbPar(const CbmTrdParModGas *p)
virtual Int_t GetOverThreshold() const
CbmTrdClusterFinder()
Default constructor.
@ kTrd
Transition Radiation Detector.
CbmTrdParSetAsic * fAsicPar
parameter list for ASIC characterization
static Int_t fgConfig
Configuration map for the clusterizer. See CbmTrdRecDef for details.
CbmTrdAsicType GetType() const
Channel FEE SPADIC/FASP according to CbmTrdAsicType.
virtual void SetParContainers()
virtual void SetGeoPar(const CbmTrdParModGeo *p)
CbmTrdParSetGeo * fGeoPar
parameter list for modules geometry
static Bool_t IsTimeBased()
static void SetTimeBased(Bool_t set=kTRUE)
friend F32vec4 fabs(const F32vec4 &a)
~CbmTrdClusterFinder()
Default destructor.
std::map< Int_t, CbmTrdModuleRec * > fModules
list of modules being processed
virtual void Exec(Option_t *option)
Executed task.
Data Container for TRD clusters.
virtual void SetGainPar(const CbmTrdParModGain *p)
Definition of gas parameters for one TRD module.
Definition of gain parameters for one TRD module.
Int_t GetNofColumns() const
virtual Int_t FindClusters()=0
Steering routine for finding digits clusters.
friend class CbmTrdModuleRecR
Int_t GetAddressModule() const
Getter module address in the experiment.
virtual InitStatus Init()