Go to the documentation of this file.
20 #include "TGeoPhysicalNode.h"
21 #include <TClonesArray.h>
22 #include <TGeoManager.h>
23 #include <TStopwatch.h>
26 #include <FairLogger.h>
27 #include <FairRootManager.h>
28 #include <FairRunAna.h>
29 #include <FairRuntimeDb.h>
34 : FairTask(
"TrdHitProducer")
60 Int_t nhits {
hits->GetEntriesFast()};
68 TGeoPhysicalNode* node) {
69 TString s(node->GetName());
70 Int_t typ = TString(s[s.Index(
"module") + 6]).Atoi();
82 LOG(warn) << GetName() <<
": No geometry parameter container!";
86 LOG(warn) << GetName() <<
": No geometry parameters for module " << address;
95 LOG(warn) << GetName() <<
"::AddModule : No Read-Out params for modAddress "
96 << address <<
". Using default.";
104 LOG(warn) << GetName() <<
"::AddModule : No ASIC params for modAddress "
105 << address <<
". Using default.";
114 LOG(warn) << GetName() <<
"::AddModule : No Gas params for modAddress "
115 << address <<
". Using default.";
134 FairRootManager*
rootMgr = FairRootManager::Instance();
136 LOG(error) << GetName() <<
"::Init: "
137 <<
"ROOT manager is not instantiated!";
146 LOG(error) << GetName() <<
"::Init: "
147 <<
"no TrdCluster array!";
151 fHits =
new TClonesArray(
"CbmTrdHit", 100);
152 rootMgr->Register(
"TrdHit",
"TRD",
fHits, IsOutputBranchPersistent(
"TrdHit"));
158 std::map<Int_t, TGeoPhysicalNode*> moduleMap = geoHandler.
FillModuleMap();
161 Int_t nrNodes = moduleMap.size();
162 if (nrModules != nrNodes)
164 <<
"Geometry and parameter files have different number of modules.";
165 for (Int_t loop = 0; loop < nrModules; ++loop) {
167 std::map<Int_t, TGeoPhysicalNode*>::iterator it = moduleMap.find(address);
168 if (it == moduleMap.end()) {
169 LOG(fatal) <<
"Expected module with address " << address
170 <<
" wasn't found in the map with TGeoNode information.";
185 std::vector<const CbmTrdDigi*> digis;
186 Int_t nofCluster =
fClusters->GetEntries();
187 for (Int_t iCluster = 0; iCluster < nofCluster; iCluster++) {
194 std::map<Int_t, CbmTrdModuleRec*>::iterator imod =
199 for (Int_t iDigi = 0; iDigi < cluster->
GetNofDigis(); iDigi++) {
205 digis.push_back(digi);
210 mod->
MakeHit(iCluster, cluster, &digis);
215 for (std::map<Int_t, CbmTrdModuleRec*>::iterator imod =
fModules.begin();
230 LOG(info) << GetName() <<
"::Exec: "
231 <<
" Clusters : " <<
fClusters->GetEntriesFast();
232 LOG(info) << GetName() <<
"::Exec: "
233 <<
" Hits : " << hitCounter;
234 LOG(info) << GetName() <<
"::Exec: real time=" << timer.RealTime()
235 <<
" CPU time=" << timer.CpuTime();
244 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetAsic"));
246 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetGas"));
248 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetDigi"));
250 FairRunAna::Instance()->GetRuntimeDb()->getContainer(
"CbmTrdParSetGain"));
ClassImp(CbmTrdHitProducer)
virtual const CbmTrdParSet * GetModuleSet(Int_t detId) const
CbmTrdParSetAsic * fAsicPar
parameter list for ASIC characterization
CbmTrdParSetGas * fGasPar
parameter list for HV status
CbmTrdHitProducer()
Constructor.
Helper class to convert unique channel ID back and forth.
Int_t AddHits(TClonesArray *hits, Bool_t moveOwner=kTRUE)
CbmTrdParSetGain * fGainPar
parameter list for keV->ADC gain conversion
CbmTrdParSetDigi * fDigiPar
parameter list for read-out geometry
virtual CbmTrdHit * MakeHit(Int_t cId, const CbmTrdCluster *c, std::vector< const CbmTrdDigi * > *digis)=0
Steering routine for converting cluster to hit.
Describe TRD module working settings (HV, etc)
InitStatus Init()
Initialisation.
virtual ~CbmTrdHitProducer()
Destructor.
static FairRootManager * rootMgr
Describe TRD module ASIC settings (electronic gain, delays, etc)
Abstract class for module wise cluster finding and hit reconstruction.
virtual void SetAsicPar(CbmTrdParSetAsic *p=nullptr)
static CbmDigiManager * Instance()
Static instance.
Int_t GetNofDigis() const
Number of digis in cluster.
Data Container for TRD clusters.
virtual Int_t GetNrOfModules() const
CbmTrdModuleRec * AddModule(Int_t address, TGeoPhysicalNode *node)
virtual void Finish()
Inherited from FairTask.
Definition of geometry for one TRD module.
virtual Int_t GetModuleId(Int_t i) const
virtual Bool_t Finalize()
Reconstruct physics observables on hits.
Helper class to extract information from the GeoManager.
const Digi * Get(Int_t index) const
Get a digi object.
Definition of chamber gain conversion for one TRD module.
std::map< Int_t, CbmTrdModuleRec * > fModules
list of modules being processed
virtual TClonesArray * GetHits()
virtual const CbmTrdParMod * GetModulePar(Int_t detId) const
Class for hits in TRD detector.
virtual void SetDigiPar(const CbmTrdParModDigi *p)
std::map< Int_t, TGeoPhysicalNode * > FillModuleMap()
Fill map with information of the gas volumes for each detector.
virtual void SetChmbPar(const CbmTrdParModGas *p)
Rectangular pad module; Cluster finding and hit reconstruction algorithms.
virtual InitStatus Init()
Inherited form FairTask.
@ kTrd
Transition Radiation Detector.
Triangular pad module; Cluster finding and hit reconstruction algorithms.
CbmTrdAsicType GetType() const
Channel FEE SPADIC/FASP according to CbmTrdAsicType.
virtual void SetGeoPar(const CbmTrdParModGeo *p)
static vector< vector< QAHit > > hits
CbmTrdParSetGeo * fGeoPar
parameter list for modules geometry
Data Container for TRD clusters.
virtual void SetGainPar(const CbmTrdParModGain *p)
Double_t GetCharge() const
Charge getter for SPADIC.
virtual void SetParContainers()
Int_t GetDigi(Int_t index) const
Get digi at position index.
Definition of gas parameters for one TRD module.
Definition of gain parameters for one TRD module.
virtual void Exec(Option_t *option="")
Inherited from FairTask.