41#include "FairRootManager.h"
43#include "TClonesArray.h"
53#include <unordered_map>
55#include <yaml-cpp/yaml.h>
64 template<ca::EDetectorID DetID>
95 void Exec(Option_t* option);
198 template<ca::EDetectorID DetID>
202 fpBrHitsTmp->Delete();
204 fpBrHitsTmp =
nullptr;
207 if (fpBrHitMatchesTmp) {
208 fpBrHitMatchesTmp->Delete();
209 delete fpBrHitMatchesTmp;
210 fpBrHitMatchesTmp =
nullptr;
216 template<ca::EDetectorID DetID>
219 auto CheckBranch = [](
auto pBranch,
const char* brName) {
221 throw std::logic_error(Form(
"Branch %s is not available", brName));
226 auto* pFairManager = FairRootManager::Instance();
227 auto* pMcManager =
dynamic_cast<CbmMCDataManager*
>(pFairManager->GetObject(
"MCDataManager"));
228 CheckBranch(pMcManager,
"MCDataManager");
230 fpTimeSlice =
dynamic_cast<CbmTimeSlice*
>(pFairManager->GetObject(
"TimeSlice."));
231 fpRecoEvents =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"CbmEvent"));
232 fpMCEventList =
dynamic_cast<CbmMCEventList*
>(pFairManager->GetObject(
"MCEventList."));
234 CheckBranch(fpTimeSlice,
"TimeSlice.");
235 CheckBranch(fpMCEventList,
"MCEventList.");
236 fpMCEventHeader = pMcManager->GetObject(
"MCEventHeader.");
237 fpBrMCTracks = pMcManager->InitBranch(
"MCTrack");
238 CheckBranch(fpBrMCTracks,
"MCTrack");
241 case ca::EDetectorID::kMvd:
243 fpBrPoints = pMcManager->InitBranch(
"MvdPoint");
244 fpBrHits =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"MvdHit"));
245 fpBrHitMatches =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"MvdHitMatch"));
247 CheckBranch(fpBrPoints,
"MvdPoint");
248 CheckBranch(fpBrHits,
"MvdHit");
249 CheckBranch(fpBrHitMatches,
"MvdHitMatch");
251 case ca::EDetectorID::kSts:
253 fpBrPoints = pMcManager->InitBranch(
"StsPoint");
254 fpBrHits =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"StsHit"));
255 fpBrHitMatches =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"StsHitMatch"));
257 CheckBranch(fpBrPoints,
"StsPoint");
258 CheckBranch(fpBrHits,
"StsHit");
259 CheckBranch(fpBrHitMatches,
"StsHitMatch");
261 case ca::EDetectorID::kMuch:
263 fpBrPoints = pMcManager->InitBranch(
"MuchPoint");
264 fpBrHits =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"MuchPixelHit"));
265 fpBrHitMatches =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"MuchPixelHitMatch"));
267 CheckBranch(fpBrPoints,
"MuchPoint");
268 CheckBranch(fpBrHits,
"MuchPixelHit");
269 CheckBranch(fpBrHitMatches,
"MuchPixelHitMatch");
271 case ca::EDetectorID::kTrd:
273 fpBrPoints = pMcManager->InitBranch(
"TrdPoint");
274 fpBrHits =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"TrdHit"));
275 fpBrHitMatches =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"TrdHitMatch"));
277 CheckBranch(fpBrPoints,
"TrdPoint");
278 CheckBranch(fpBrHits,
"TrdHit");
279 CheckBranch(fpBrHitMatches,
"TrdHitMatch");
281 case ca::EDetectorID::kTof:
283 fpBrPoints = pMcManager->InitBranch(
"TofPoint");
284 fpBrHits =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"TofHit"));
285 fpBrHitMatches =
dynamic_cast<TClonesArray*
>(pFairManager->GetObject(
"TofHitMatch"));
287 CheckBranch(fpBrPoints,
"TofPoint");
288 CheckBranch(fpBrHits,
"TofHit");
289 CheckBranch(fpBrHitMatches,
"TofHitMatch");
291 case ca::EDetectorID::END:
292 LOG(fatal) <<
"CA ideal hit producer for " <<
kDetName[DetID]
293 <<
": Wrong template argument is used: ca::EDetectorID::END";
298 if (fsConfigName.size() != 0) {
303 std::any_of(fvStationPars.begin(), fvStationPars.end(), [](
const auto& p) { return p.fMode > 0; });
306 fbRunTheRoutine =
false;
309 std::stringstream msg;
310 msg <<
"\033[1;31mATTENTION! IDEAL HIT PRODUCER IS USED FOR " <<
kDetName[DetID] <<
"\033[0m";
311 LOG_IF(info, fbRunTheRoutine) << msg.str();
315 catch (
const std::logic_error& error) {
316 LOG(error) <<
"CA ideal hit producer for " <<
kDetName[DetID]
317 <<
": initialization failed. Reason: " << error.what();
323 template<ca::EDetectorID DetID>
326 int nStations = fpDetInterface->GetNtrackingStations();
327 fvStationPars.clear();
328 fvStationPars.resize(nStations);
333 config = YAML::LoadFile(fsConfigName)[
"ideal_hit_producer"];
335 std::string detBranchName =
"";
336 if constexpr (ca::EDetectorID::kMvd == DetID) {
337 detBranchName =
"mvd";
339 else if constexpr (ca::EDetectorID::kSts == DetID) {
340 detBranchName =
"sts";
342 else if constexpr (ca::EDetectorID::kMuch == DetID) {
343 detBranchName =
"much";
345 else if constexpr (ca::EDetectorID::kTrd == DetID) {
346 detBranchName =
"trd";
348 else if constexpr (ca::EDetectorID::kTof == DetID) {
349 detBranchName =
"tof";
352 const auto& parNode = config[
"parameters"][detBranchName];
353 const auto& flagNode = config[
"flags"][detBranchName];
355 for (
int iSt = 0; iSt < nStations; ++iSt) {
356 auto& par = fvStationPars[iSt];
357 auto& node = parNode[iSt];
358 short mode = flagNode[iSt].as<
int>(0);
360 par.fPhiU = node[
"du"][
"angle"].as<
double>() * 180. / M_PI;
361 par.fDu = node[
"du"][
"value"].as<
double>();
362 switch (node[
"du"][
"pdf"].as<char>()) {
363 case 'g': par.fPdfU = 0;
break;
364 case 'u': par.fPdfU = 1;
break;
365 default: par.fPdfU = -1;
break;
367 par.fPhiV = node[
"dv"][
"angle"].as<
double>() * 180. / M_PI;
368 par.fDv = node[
"dv"][
"value"].as<
double>();
369 switch (node[
"dv"][
"pdf"].as<char>()) {
370 case 'g': par.fPdfV = 0;
break;
371 case 'u': par.fPdfV = 1;
break;
372 default: par.fPdfV = -1;
break;
374 par.fDt = node[
"dt"][
"value"].as<
double>();
375 switch (node[
"dt"][
"pdf"].as<char>()) {
376 case 'g': par.fPdfT = 0;
break;
377 case 'u': par.fPdfT = 1;
break;
378 default: par.fPdfT = -1;
break;
401 catch (
const YAML::BadFile& err) {
402 std::stringstream msg;
403 msg <<
"YAML configuration file " << fsConfigName <<
" does not exist";
404 throw std::runtime_error(msg.str());
406 catch (
const YAML::ParserException& err) {
407 std::stringstream msg;
408 msg <<
"YAML configuration file " << fsConfigName <<
" is formatted improperly";
409 throw std::runtime_error(msg.str());
415 template<ca::EDetectorID DetID>
419 auto pos = TVector3{};
420 auto dpos = TVector3{};
422 pHit->PositionError(
dpos);
425 if constexpr (ca::EDetectorID::kMvd == DetID) {
426 auto statNr = pHit->GetStationNr();
427 auto iCentrX = pHit->GetIndexCentralX();
428 auto iCentrY = pHit->GetIndexCentralY();
429 auto iClust = pHit->GetClusterIndex();
430 auto flag = pHit->GetFlag();
431 new ((*fpBrHits)[fHitCounter])
CbmMvdHit(statNr,
pos,
dpos, iCentrX, iCentrY, iClust, flag);
434 auto address = pHit->GetAddress();
435 auto time = pHit->GetTime();
436 auto dtime = pHit->GetTimeError();
437 if constexpr (ca::EDetectorID::kSts == DetID) {
438 auto dxy = pHit->GetDxy();
439 auto iClustF = pHit->GetFrontClusterId();
440 auto iClustB = pHit->GetBackClusterId();
441 auto du = pHit->GetDu();
442 auto dv = pHit->GetDv();
443 new ((*fpBrHits)[fHitCounter])
CbmStsHit(address,
pos,
dpos, dxy, iClustF, iClustB, time, dtime, du, dv);
445 else if constexpr (ca::EDetectorID::kMuch == DetID) {
446 auto dxy = pHit->GetDxy();
447 auto refId = pHit->GetRefId();
448 auto planeId = pHit->GetPlaneId();
449 LOG(info) <<
"MUCH: " << pHit->GetRefId() <<
' ' << pHit->GetPlaneId();
452 else if constexpr (ca::EDetectorID::kTrd == DetID) {
453 auto dxy = pHit->GetDxy();
454 auto refId = pHit->GetRefId();
455 auto eLoss = pHit->GetELoss();
456 new ((*fpBrHits)[fHitCounter])
CbmTrdHit(address,
pos,
dpos, dxy, refId, eLoss, time, dtime);
458 else if constexpr (ca::EDetectorID::kTof == DetID) {
460 auto flag = pHit->GetFlag();
461 auto channel = pHit->GetCh();
462 new ((*fpBrHits)[fHitCounter])
CbmTofHit(address,
pos,
dpos, refId, time, dtime, flag, channel);
469 template<ca::EDetectorID DetID>
472 const auto* pHitMatch =
dynamic_cast<CbmMatch*
>(fpBrHitMatchesTmp->At(iH));
474 if (pHitMatch->GetNofLinks() > 0) {
475 const auto& link = pHitMatch->GetMatchedLink();
476 if (link.GetIndex() > -1) {
477 return std::make_optional(link);
485 template<ca::EDetectorID DetID>
489 case 0: value += fRandom.BoundedGaus<
double>(0., sigma, kHitWSize);
break;
490 case 1: value += fRandom.Uniform<
double>(0., sigma);
break;
491 default: LOG(fatal) <<
"IdealHitProducerDet::SmearValue: illegal option: opt = " << opt;
497 template<ca::EDetectorID DetID>
501 if (!fbRunTheRoutine) {
507 fpBrHitsTmp =
static_cast<TClonesArray*
>(fpBrHits->Clone(
"tmpHit"));
510 if (fpBrHitMatches) {
511 fpBrHitMatchesTmp =
static_cast<TClonesArray*
>(fpBrHitMatches->Clone(
"tmpHitMatch"));
512 fpBrHitMatches->Delete();
516 assert(fpBrHitMatches);
518 assert(fpBrHitMatchesTmp);
520 std::vector<double> vHitMcEventTime;
525 for (
int iH = 0; iH < fpBrHitsTmp->GetEntriesFast(); ++iH) {
526 auto* pHit =
static_cast<Hit_t*
>(fpBrHitsTmp->At(iH));
527 double tMC = pHit->GetTime();
530 int iSt = fpDetInterface->GetTrackingStationIndex(pHit);
534 const auto& setting = fvStationPars[iSt];
537 if (setting.fMode == 2) {
543 LOG(info) <<
"TOF is TZERO!";
548 if (setting.fMode == 1) {
550 auto oLinkToPoint = GetMatchedPointLink(iH);
551 if (oLinkToPoint == std::nullopt) {
554 auto& link = oLinkToPoint.value();
555 auto* pPoint =
static_cast<Point_t*
>(fpBrPoints->Get(link));
558 auto posIn = TVector3{};
559 auto posOut = TVector3{};
561 if constexpr (ca::EDetectorID::kTof == DetID) {
562 pPoint->Position(posIn);
563 pPoint->Position(posOut);
566 pPoint->Position(posIn);
567 pPoint->PositionOut(posOut);
569 auto pos = 0.5 * (posIn + posOut);
573 double t = pPoint->GetTime() + fpMCEventList->GetEventTime(link);
574 tMC = fpMCEventList->GetEventTime(link);
576 if (setting.fbSmear) {
577 double dx2 = pHit->GetDx() * pHit->GetDx();
578 double dxy = pHit->GetDxy();
579 double dy2 = pHit->GetDy() * pHit->GetDy();
586 double dt = pHit->GetTimeError();
587 this->SmearValue(u,
sqrt(fabs(du2)), setting.fPdfU);
588 this->SmearValue(
v,
sqrt(fabs(dv2)), setting.fPdfV);
589 this->SmearValue(t, dt, setting.fPdfT);
600 if constexpr (ca::EDetectorID::kSts == DetID) {
601 iCluster = std::max(pHit->GetFrontClusterId(), iCluster);
602 iCluster = std::max(pHit->GetBackClusterId(), iCluster);
606 vHitMcEventTime.push_back(tMC);
607 auto* pHitMatchNew =
new ((*fpBrHitMatches)[fHitCounter])
CbmMatch();
613 int nEvents = fpMCEventList->GetNofEvents();
614 for (
int iE = 0; iE < nEvents; ++iE) {
615 int fileId = fpMCEventList->GetFileIdByIndex(iE);
616 int eventId = fpMCEventList->GetEventIdByIndex(iE);
617 int nPoints = fpBrPoints->Size(fileId, eventId);
621 this->FillPointIsLegit(iE);
622 for (
int iP = 0; iP < nPoints; ++iP) {
623 if (!fvbPointIsLegit[iP]) {
626 auto* pPoint =
static_cast<Point_t*
>(fpBrPoints->Get(fileId, eventId, iP));
627 int iSt = fpDetInterface->GetTrackingStationIndex(pPoint->GetDetectorID());
632 const auto& setting = fvStationPars[iSt];
633 if (setting.fMode != 2) {
636 double du = setting.fDu;
637 double dv = setting.fDv;
638 double dt = setting.fDt;
645 auto posIn = TVector3{};
646 auto posOut = TVector3{};
648 if constexpr (ca::EDetectorID::kTof == DetID) {
649 pPoint->Position(posIn);
650 pPoint->Position(posOut);
653 pPoint->Position(posIn);
654 pPoint->PositionOut(posOut);
656 auto pos = 0.5 * (posIn + posOut);
660 double t = pPoint->GetTime() + fpMCEventList->GetEventTime(eventId, fileId);
662 double tMC = fpMCEventList->GetEventTime(eventId, fileId);
664 if (setting.fbSmear) {
666 this->SmearValue(u, du, setting.fPdfU);
667 this->SmearValue(
v, dv, setting.fPdfV);
668 this->SmearValue(t, dt, setting.fPdfT);
674 auto dpos = TVector3{std::sqrt(dx2), std::sqrt(dy2), dz};
677 if constexpr (ca::EDetectorID::kMvd == DetID) {
678 new ((*fpBrHits)[fHitCounter])
CbmMvdHit();
681 auto address = pPoint->GetDetectorID();
682 if constexpr (ca::EDetectorID::kSts == DetID) {
683 int32_t iClustF = iCluster;
684 int32_t iClustB = iCluster + 1;
685 new ((*fpBrHits)[fHitCounter])
CbmStsHit(address,
pos,
dpos, dxy, iClustF, iClustB, t, dt, du, dv);
688 else if constexpr (ca::EDetectorID::kMuch == DetID) {
691 int32_t planeId = -1;
694 else if constexpr (ca::EDetectorID::kTrd == DetID) {
696 auto eLoss = pPoint->GetEnergyLoss();
697 new ((*fpBrHits)[fHitCounter])
CbmTrdHit(address,
pos,
dpos, dxy, refId, eLoss, t, dt);
699 else if constexpr (ca::EDetectorID::kTof == DetID) {
703 new ((*fpBrHits)[fHitCounter])
CbmTofHit(address,
pos,
dpos, refId, t, dt, flag, channel);
708 auto* pHitMatchNew =
new ((*fpBrHitMatches)[fHitCounter])
CbmMatch();
709 pHitMatchNew->
AddLink(1., iP, eventId, fileId);
710 vHitMcEventTime.push_back(tMC);
712 assert(fpBrHitMatches->GetEntriesFast() == fHitCounter);
717 fpBrHitsTmp->Delete();
719 fpBrHitsTmp =
nullptr;
721 fpBrHitMatchesTmp->Delete();
722 delete fpBrHitMatchesTmp;
723 fpBrHitMatchesTmp =
nullptr;
727 for (Int_t iEvent = 0; iEvent < fpRecoEvents->GetEntriesFast(); iEvent++) {
730 double tStart =
event->GetStartTime();
731 double tEnd =
event->GetEndTime();
732 for (UInt_t iH = 0; iH < vHitMcEventTime.size(); iH++) {
733 double t = vHitMcEventTime[iH];
734 if ((t >= tStart && t <= tEnd) || tStart < 0 || tEnd < 0) {
735 event->AddData(fHitDataType, iH);
744 template<ca::EDetectorID DetID>
747 int iFile = fpMCEventList->GetFileIdByIndex(iEvGlob);
748 int iEvent = fpMCEventList->GetEventIdByIndex(iEvGlob);
749 int nPoints = fpBrPoints->Size(iFile, iEvent);
751 fvbPointIsLegit.clear();
752 fvbPointIsLegit.resize(nPoints);
753 if constexpr (ca::EDetectorID::kTof == DetID) {
754 constexpr int kNofBitsRpcAddress = 11;
755 std::map<std::pair<int, int>,
int> mMatchedPointId;
756 for (
int iH = 0; iH < fpBrHitMatches->GetEntriesFast(); ++iH) {
757 auto* pHitMatch =
dynamic_cast<CbmMatch*
>(fpBrHitMatches->At(iH));
758 LOG_IF(fatal, !pHitMatch) <<
"CA MC Module: hit match was not found for TOF hit " << iH;
759 double bestWeight = 0;
760 for (
int iLink = 0; iLink < pHitMatch->GetNofLinks(); ++iLink) {
761 const auto& link = pHitMatch->GetLink(iLink);
762 if (link.GetFile() != iFile || link.GetEntry() != iEvent) {
765 int iPext = link.GetIndex();
769 auto* pExtPoint =
static_cast<CbmTofPoint*
>(fpBrPoints->Get(link));
770 int trkId = pExtPoint->GetTrackID();
771 int rpcAddr = pExtPoint->GetDetectorID() << kNofBitsRpcAddress;
772 auto key = std::make_pair(trkId, rpcAddr);
773 auto prev = mMatchedPointId.find(key);
774 if (prev == mMatchedPointId.end()) {
775 bestWeight = link.GetWeight();
776 mMatchedPointId[key] = iPext;
779 if (bestWeight < link.GetWeight()) {
780 mMatchedPointId[key] = iPext;
789 int iPointSelected = -1;
791 int rpcAddrCurr = -1;
792 bool bTrkHasHits =
false;
793 double zDist = std::numeric_limits<double>::max();
794 double zCell = std::numeric_limits<double>::signaling_NaN();
795 for (
int iP = 0; iP < nPoints; ++iP) {
796 auto* pExtPoint =
dynamic_cast<CbmTofPoint*
>(fpBrPoints->Get(iFile, iEvent, iP));
797 LOG_IF(fatal, !pExtPoint) <<
"NO POINT: TOF: file, event, index = " << iFile <<
' ' << iEvent <<
' ' << iP;
799 int iTmc = pExtPoint->GetTrackID();
800 int rpcAddr = pExtPoint->GetDetectorID() << kNofBitsRpcAddress;
802 if (rpcAddrCurr != rpcAddr || iTmcCurr != iTmc) {
803 if (iPointSelected != -1) {
804 fvbPointIsLegit[iPointSelected] =
true;
807 rpcAddrCurr = rpcAddr;
808 auto key = std::make_pair(iTmc, rpcAddr);
809 auto found = mMatchedPointId.find(key);
810 bTrkHasHits = found != mMatchedPointId.end();
812 iPointSelected = found->second;
816 zCell = fpDetInterface->GetZrefModule(pExtPoint->GetDetectorID());
817 zDist = std::fabs(zCell - pExtPoint->GetZ());
823 auto newDist = std::fabs(pExtPoint->GetZ() - zCell);
824 if (newDist < zDist) {
832 if (iPointSelected != -1) {
833 fvbPointIsLegit[iPointSelected] =
true;
839 std::fill(fvbPointIsLegit.begin(), fvbPointIsLegit.end(),
true);
Random generator utility class for CA tracking.
Compile-time constants definition for the CA tracking algorithm.
Implementation of L1DetectorID enum class for CBM.
Class for pixel hits in MUCH detector.
Data class for a reconstructed hit in the STS.
Base abstract class for tracking detector interface to L1 (implementation of Checker)
Class for hits in TRD detector.
friend fvec sqrt(const fvec &a)
Class characterising one event by a collection of links (indices) to data objects,...
void ClearData(ECbmDataType type)
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
Access to a MC data branch for time-based analysis.
Container class for MC events with number, file and start time.
void AddLinks(const CbmMatch &match)
void AddLink(const CbmLink &newLink)
static CbmMuchTrackingInterface * Instance()
Gets pointer to the instance of the CbmMuchTrackingInterface.
static CbmMvdTrackingInterface * Instance()
Gets pointer to the instance of the CbmMvdTrackingInterface.
data class for a reconstructed 3-d hit in the STS
static CbmStsTrackingInterface * Instance()
Gets pointer to the instance of the CbmStsTrackingInterface class.
Bookkeeping of time-slice content.
static int32_t GetSmType(uint32_t address)
Geometric intersection of a MC track with a TOFb detector.
static CbmTofTrackingInterface * Instance()
Gets pointer to the instance of the CbmTofTrackingInterface.
Abstract class, which should be inherited by every detecting subsystem tracking interface class.
data class for a reconstructed Energy-4D measurement in the TRD
static CbmTrdTrackingInterface * Instance()
Gets pointer to the instance of the CbmTrdTrackingInterface.
A class, providing ROOT-free access to randomly generated variables.
void SetSeed(int seed)
Sets seed to the random generator.
A class to convert XY coordinates to UV coordinates.
std::tuple< double, double, double > ConvertCovMatrixUVtoXY(double du2, double duv, double dv2) const
Conversion function (du2, duv, dv2) -> (dx2, dxy, dy2)
std::pair< double, double > ConvertUVtoXY(double u, double v) const
Conversion function (x,y) -> (u,v)
std::tuple< double, double, double > ConvertCovMatrixXYtoUV(double dx2, double dxy, double dy2) const
Conversion function (dx2, dxy, dy2) -> (du2, duv, dv2)
std::pair< double, double > ConvertXYtoUV(double x, double y) const
Conversion function (x,y) -> (u,v)
Ideal hit producer class.
TClonesArray * fpRecoEvents
Array of reconstructed events.
std::vector< unsigned char > fvbPointIsLegit
Map of used point index.
static constexpr double kHitWSize
half-width for the bounded gaussian [sigma]
TClonesArray * fpBrHitsTmp
Temporary array of hits.
ECbmDataType fHitDataType
Hit data type.
IdealHitProducerDet & operator=(IdealHitProducerDet &&)=delete
Move assignment operator.
PointTypes_t::at< DetID > Point_t
void FillPointIsLegit(int iEvGlob)
Fills map of legit points (inside MC event!)
CbmMCEventList * fpMCEventList
MC event list.
TClonesArray * fpBrHitMatchesTmp
Temporary array of hit matches.
void SetRandomSeed(int seed)
Sets random seed (1 by default)
void SetConfigName(const char *name)
Sets YAML configuration file name.
std::vector< HitParameters > fvStationPars
Parameters, stored for each station.
IdealHitProducerDet(IdealHitProducerDet &&)=delete
Move constructor.
IdealHitProducerDet & operator=(const IdealHitProducerDet &)=delete
Copy assignment operator.
void ParseConfig()
Parses the YAML configuration file.
CbmMCDataObject * fpMCEventHeader
MC event header.
int fHitCounter
Hit counter in a new branch.
CbmTimeSlice * fpTimeSlice
Current time slice.
void PushBackHit(const Hit_t *pHit)
Pushes back a hit into the hits branch.
std::optional< CbmLink > GetMatchedPointLink(int iH)
Gets pointer to matched MC point.
void Exec(Option_t *option)
Execution of the task.
bool fbRunTheRoutine
Management flag, which does run the routine if there was a request.
std::string fsConfigName
Name of configuration file.
HitTypes_t::at< DetID > Hit_t
CbmMCDataArray * fpBrMCTracks
Branch: array of MC tracks.
ca::Random fRandom
Random generator.
IdealHitProducerDet()=default
Constructor.
InitStatus Init()
Initialization of the task.
InitStatus ReInit()
Re-initialization of the task.
CbmTrackingDetectorInterfaceBase * fpDetInterface
Detector interface.
TClonesArray * fpBrHits
Branch: array of hits.
TClonesArray * fpBrHitMatches
Branch: array of hit matches.
~IdealHitProducerDet()
Destructor.
void SmearValue(double &value, double sigma, int opt)
Smears the value by a given standard deviation with a selected function.
CbmMCDataArray * fpBrPoints
Branch: array of MC points.
IdealHitProducerDet(const IdealHitProducerDet &)=delete
Copy constructor.
constexpr double Undef< double >
constexpr DetIdArr_t< const char * > kDetName
Names of detector subsystems.
std::tuple_element_t< static_cast< std::size_t >(DetID), std::tuple< Types... > > at
A structure to keep hit adjustment/creation settings for each station.
double fDu
Error of u-coordinate measurement [cm].
double fPhiU
Angle of the first independent measured coordinate [rad].
double fPhiV
Angle of the second independent measured coordinate [rad].
double fDt
Error of time measurement [ns].
double fDv
Error of v-coordinate measurement [cm].