18#include "FairRootManager.h"
19#include "FairRunAna.h"
20#include "FairRuntimeDb.h"
23#include "TClonesArray.h"
119 auto SetRange = [](std::array<double, 2>& range,
double min,
double max) {
124 SetRange(
fRHitDx, 0.0000, 5.00);
125 SetRange(
fRHitDy, 0.0000, 5.00);
126 SetRange(
fRHitDu, 0.0000, 5.00);
127 SetRange(
fRHitDv, 0.0000, 5.00);
128 SetRange(
fRHitDt, 0.0000, 0.15);
130 SetRange(
fRResX, -2.00, 2.00);
131 SetRange(
fRResY, -4.00, 4.00);
132 SetRange(
fRResU, -2.00, 2.00);
133 SetRange(
fRResV, -4.00, 4.00);
134 SetRange(
fRResT, -0.50, 0.50);
146 auto PrintPoint = [&](
const CbmTofPoint* point, std::stringstream& m) {
147 m <<
"point: trk=" << point->GetTrackID() <<
", ";
148 auto pointAddress = point->GetDetectorID();
149 int32_t rpcAddress = (pointAddress << 11);
153 m <<
"iSt=" <<
fpDetInterface->GetTrackingStationId(pointAddress) <<
", ";
154 m <<
"address=" << pointAddress <<
", rpcAddress= " << rpcAddress;
155 m <<
", (" << iSmType <<
"," << iSm <<
"," << iRpc <<
"), ";
156 m <<
"x=" << point->GetX() <<
", y=" << point->GetY() <<
", z=" << point->GetZ();
161 LOG(info) << fName <<
": ===== Hit Sample";
162 for (
int iHit = 0; iHit <
fpHits->GetEntriesFast(); ++iHit) {
163 const auto* pHit =
dynamic_cast<const Hit_t*
>(
fpHits->At(iHit));
165 LOG(error) << fName <<
"::FillHistogramsPerHit: hit with index " << iHit <<
" not found";
169 int address = pHit->GetAddress();
175 std::stringstream msg;
176 msg << fName <<
": hit: id=" << iHit <<
", NofLinks=" << pHitMatch->
GetNofLinks() <<
", ";
177 msg <<
"iSt=" <<
fpDetInterface->GetTrackingStationId(address) <<
", ";
178 msg <<
"RPC=(" << iHitSmType <<
"," << iHitSm <<
"," << iHitRpc <<
")";
179 if (pHitMatch->GetNofLinks() == 0) {
182 const auto& bestLink = pHitMatch->GetMatchedLink();
183 for (
int iLink = 0; iLink < pHitMatch->GetNofLinks(); ++iLink) {
184 const auto& link = pHitMatch->GetLink(iLink);
185 int iPointExt = link.GetIndex();
186 int iEvent = link.GetEntry();
187 int iFile = link.GetFile();
188 msg <<
"\n\tLink " << iLink <<
": " << iPointExt <<
", " << iEvent <<
", " << iFile <<
" (best? ";
189 msg << (bestLink == link) <<
')';
195 PrintPoint(pPoint, msg);
197 LOG(info) << msg.str();
200 LOG(info) << fName <<
": ===== Point Sample";
205 int nPoints =
fpMCPoints->Size(iFile, iEvent);
206 for (
int iPoint = 0; iPoint < nPoints; ++iPoint) {
208 std::stringstream msg;
209 msg <<
"link: " << iPoint <<
", " << iEvent <<
", " << iFile <<
", ";
210 PrintPoint(pPoint, msg);
211 LOG(info) <<
'\t' << msg.str();
224 const auto* pHit =
dynamic_cast<const Hit_t*
>(
fpHits->At(iHit));
226 LOG(error) << fName <<
"::FillHistogramsPerHit: hit with index " << iHit <<
" not found";
230 int address = pHit->GetAddress();
236 double xHit = pHit->GetX();
237 double yHit = pHit->GetY();
238 double zHit = pHit->GetZ();
251 if (kSUCCESS != initStatus) {
258 const auto& trkStationIdMap{
fpDetInterface->GetTrkStationIdMap()};
259 int nSmTypes = trkStationIdMap.GetNofSmTypes();
264 for (
int iSmType = 0; iSmType < nSmTypes; ++iSmType) {
269 int nSm = trkStationIdMap.GetNofSm(iSmType);
270 int nRpc = trkStationIdMap.GetNofRpc(iSmType);
274 for (
int iSm = 0; iSm < nSm; ++iSm) {
279 for (
int iRpc = 0; iRpc < nRpc; ++iRpc) {
280 const char* dir = Form(
"occup_cell/sm_type_%d/sm_%d/rpc%d", iSmType, iSm, iRpc);
281 TString name = Form(
"%s/occup_xy_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
282 TString title = Form(
"Hit Occupancy in xy-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
283 title +=
";x_{hit} [cm];y_{hit} [cm]";
286 name = Form(
"%s/occup_zx_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
287 title = Form(
"Hit Occupancy in zx-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
288 title +=
";z_{hit} [cm];x_{hit} [cm]";
291 name = Form(
"%s/occup_zy_smt%d_sm%d_rpc%d", dir, iSmType, iSm, iRpc);
292 title = Form(
"Hit Occupancy in zy-Plane for iSmType = %d, iSm = %d, iRpc = %d", iSmType, iSm, iRpc);
293 title +=
";z_{hit} [cm];y_{hit} [cm]";
friend fscal max(fscal x, fscal y)
friend fscal min(fscal x, fscal y)
int32_t GetNofLinks() const
T * MakeQaObject(TString sName, TString sTitle, Args... args)
void MakeQaDirectory(TString sName)
static int32_t GetSmId(uint32_t address)
static int32_t GetRpcId(uint32_t address)
static int32_t GetSmType(uint32_t address)
Geometric intersection of a MC track with a TOFb detector.
int GetHitIndex() const
Gets hit index.