20#include "FairRootManager.h"
21#include "FairRunAna.h"
22#include "FairRuntimeDb.h"
25#include "TClonesArray.h"
121 auto SetRange = [](std::array<double, 2>& range,
double min,
double max) {
126 SetRange(
fRHitDx, 0.0000, 5.00);
127 SetRange(
fRHitDy, 0.0000, 5.00);
128 SetRange(
fRHitDu, 0.0000, 5.00);
129 SetRange(
fRHitDv, 0.0000, 5.00);
130 SetRange(
fRHitDt, 0.0000, 0.15);
132 SetRange(
fRResX, -2.00, 2.00);
133 SetRange(
fRResY, -4.00, 4.00);
134 SetRange(
fRResU, -2.00, 2.00);
135 SetRange(
fRResV, -4.00, 4.00);
136 SetRange(
fRResT, -0.50, 0.50);
148 auto PrintPoint = [&](
const CbmTofPoint* point, std::stringstream& m) {
149 m <<
"point: trk=" << point->GetTrackID() <<
", ";
150 auto pointAddress = point->GetDetectorID();
151 int32_t rpcAddress = (pointAddress << 11);
156 m <<
"address=" << pointAddress <<
", rpcAddress= " << rpcAddress;
157 m <<
", (" << iSmType <<
"," << iSm <<
"," << iRpc <<
"), ";
158 m <<
"x=" << point->GetX() <<
", y=" << point->GetY() <<
", z=" << point->GetZ();
163 LOG(info) << fName <<
": ===== Hit Sample";
164 for (
int iHit = 0; iHit <
fpHits->GetEntriesFast(); ++iHit) {
165 const auto* pHit =
dynamic_cast<const Hit_t*
>(
fpHits->At(iHit));
167 LOG(error) << fName <<
"::FillHistogramsPerHit: hit with index " << iHit <<
" not found";
171 int address = pHit->GetAddress();
177 std::stringstream msg;
178 msg << fName <<
": hit: id=" << iHit <<
", NofLinks=" << pHitMatch->
GetNofLinks() <<
", ";
180 msg <<
"RPC=(" << iHitSmType <<
"," << iHitSm <<
"," << iHitRpc <<
")";
181 if (pHitMatch->GetNofLinks() == 0) {
184 const auto& bestLink = pHitMatch->GetMatchedLink();
185 for (
int iLink = 0; iLink < pHitMatch->GetNofLinks(); ++iLink) {
186 const auto& link = pHitMatch->GetLink(iLink);
187 int iPointExt = link.GetIndex();
188 int iEvent = link.GetEntry();
189 int iFile = link.GetFile();
190 msg <<
"\n\tLink " << iLink <<
": " << iPointExt <<
", " << iEvent <<
", " << iFile <<
" (best? ";
191 msg << (bestLink == link) <<
')';
197 PrintPoint(pPoint, msg);
199 LOG(info) << msg.str();
202 LOG(info) << fName <<
": ===== Point Sample";
208 for (
int iPoint = 0; iPoint < nPoints; ++iPoint) {
210 std::stringstream msg;
211 msg <<
"link: " << iPoint <<
", " << iEvent <<
", " << iFile <<
", ";
212 PrintPoint(pPoint, msg);
213 LOG(info) <<
'\t' << msg.str();
226 const auto* pHit =
dynamic_cast<const Hit_t*
>(
fpHits->At(iHit));
228 LOG(error) << fName <<
"::FillHistogramsPerHit: hit with index " << iHit <<
" not found";
232 int address = pHit->GetAddress();
238 double xHit = pHit->GetX();
239 double yHit = pHit->GetY();
240 double zHit = pHit->GetZ();
255 if (kSUCCESS != initStatus) {
260 auto* pRuntimeDb = FairRunAna::Instance()->GetRuntimeDb();
271 for (
int iSmType = 0; iSmType < nSmTypes; ++iSmType) {
286 for (
int iRpc = 0; iRpc < nRpc; ++iRpc) {
287 const char* dir = Form(
"occup_cell/sm_type_%d/sm_%d/rpc%d", iSmType, iSm, iRpc);
288 TString name = Form(
"%s/occup_xy_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
289 TString title = Form(
"Hit Occupancy in xy-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
290 title +=
";x_{hit} [cm];y_{hit} [cm]";
293 name = Form(
"%s/occup_zx_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
294 title = Form(
"Hit Occupancy in zx-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
295 title +=
";z_{hit} [cm];x_{hit} [cm]";
298 name = Form(
"%s/occup_zy_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
299 title = Form(
"Hit Occupancy in zy-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
300 title +=
";z_{hit} [cm];y_{hit} [cm]";
friend fscal max(fscal x, fscal y)
friend fscal min(fscal x, fscal y)
TObject * Get(const CbmLink *lnk)
Int_t Size(Int_t fileNumber, Int_t eventNumber)
int32_t GetFileIdByIndex(uint32_t index)
File number by index @value File number for event at given index in list.
int32_t GetEventIdByIndex(uint32_t index)
Event number by index @value Event number for event at given index in list.
std::size_t GetNofEvents() const
Number of events in the list @value Number of events.
int32_t GetNofLinks() const
T * MakeQaObject(TString sName, TString sTitle, Args... args)
void MakeQaDirectory(TString sName)
bool IsMCUsed() const
Returns flag, whether MC information is used or not in the task.
static int32_t GetSmId(uint32_t address)
static int32_t GetRpcId(uint32_t address)
static int32_t GetSmType(uint32_t address)
Parameters class for the CBM ToF digitizer using beam data distributions.
Int_t GetNbSmTypes() const
Int_t GetNbSm(Int_t iSmType) const
Int_t GetNbRpc(Int_t iSmType) const
Geometric intersection of a MC track with a TOFb detector.
static CbmTofTrackingInterface * Instance()
Gets pointer to the instance of the CbmTofTrackingInterface.
virtual int GetTrackingStationIndex(const CbmHit *hit) const =0
Gets a tracking station of a CbmHit.
int GetHitIndex() const
Gets hit index.