11#include "BmnGemStripStation.h"
12#include "BmnGemStripStationSet_RunSpring2017.h"
13#include "BmnHistManager.h"
17#include "BmnSiliconStationSet.h"
18#include "CbmMCTrack.h"
19#include "FairMCEventHeader.h"
20#include "FairMCPoint.h"
21#include "FairRootManager.h"
33#include <boost/assign/list_of.hpp>
37using boost::assign::list_of;
38using std::binary_search;
86 TString gPathSiConfig = gPathConfig +
"/silicon/XMLConfigs/";
87 TString confSi =
"SiliconRunSpring2018.xml";
89 TString gPathGemConfig = gPathConfig +
"/gem/XMLConfigs/";
90 TString confGem =
"GemRunSpring2018.xml";
102 fHM->H1(
"hen_EventNo_ClusteringQa")->Fill(0.5);
148 fHM->H1(
"Impact parameter")->Fill(evHead->GetB());
150 fHM->H1(
"Multiplicity")->Fill(evHead->GetNPrim());
151 fHM->H2(
"Impact_Mult")->Fill(evHead->GetB(), evHead->GetNPrim());
156 FairRootManager* ioman = FairRootManager::Instance();
157 assert(ioman != NULL);
191 string histName =
"_hno_NofObjects_" + detName +
"Points_Station";
192 if (NULL == points || !
fHM->Exists(histName))
203 const string& detName,
219 const string& detName,
239 const string& detName,
260 TString pntXhitXname =
Form(
"PntX_vs_HitX_%dst_gem", iSt);
261 TString pntYhitYname =
Form(
"PntY_vs_HitY_%dst_gem", iSt);
262 TString occupname =
Form(
"Occupancy_%dst_gem", iSt);
280 const Float_t resX = pnt->GetX() - hit->GetX();
281 const Float_t resY = pnt->GetY() - hit->GetY();
282 fHM->H1(resXname.
Data())->Fill(resX);
283 fHM->H1(resYname.
Data())->Fill(resY);
284 fHM->H2(pntXhitXname.
Data())->Fill(pnt->GetX(), hit->GetX());
285 fHM->H2(pntYhitYname.
Data())->Fill(pnt->GetY(), hit->GetY());
287 fHM->H1(pullXname)->Fill(resX / hit->GetDx());
288 fHM->H1(pullYname)->Fill(resY / hit->GetDy());
290 fHM->H2(occupname.
Data())->Fill(pnt->GetX(), pnt->GetY());
296 TString occupname =
Form(
"Occupancy_%dst_sil", iSt);
299 TString pntXhitXname =
Form(
"PntX_vs_HitX_%dst_sil", iSt);
300 TString pntYhitYname =
Form(
"PntY_vs_HitY_%dst_sil", iSt);
311 const Float_t resX = pnt->GetX() - hit->GetX();
312 const Float_t resY = pnt->GetY() - hit->GetY();
314 fHM->H1(resXname.
Data())->Fill(resX);
315 fHM->H1(resYname.
Data())->Fill(resY);
316 fHM->H2(pntXhitXname.
Data())->Fill(pnt->GetX(), hit->GetX());
317 fHM->H2(pntYhitYname.
Data())->Fill(pnt->GetY(), hit->GetY());
319 fHM->H1(pullXname)->Fill(resX / hit->GetDx());
320 fHM->H1(pullYname)->Fill(resY / hit->GetDy());
322 fHM->H2(occupname.
Data())->Fill(pnt->GetX(), pnt->GetY());
384 const string& detName,
387 if (NULL == points || NULL == hits || NULL == hitMatches)
389 string nameResidualX =
"_hrp_" + detName +
"_ResidualX_H2";
390 string nameResidualY =
"_hrp_" + detName +
"_ResidualY_H2";
391 string namePullX =
"_hrp_" + detName +
"_PullX_H2";
392 string namePullY =
"_hrp_" + detName +
"_PullY_H2";
393 if (!
fHM->Exists(nameResidualX) || !
fHM->Exists(nameResidualY) || !
fHM->Exists(namePullX)
394 || !
fHM->Exists(namePullY))
403 Float_t residualX = point->GetX() - hit->GetX();
404 Float_t residualY = point->GetY() - hit->GetY();
406 fHM->H2(nameResidualX)->Fill(stationId, residualX);
407 fHM->H2(nameResidualY)->Fill(stationId, residualY);
408 fHM->H2(namePullX)->Fill(stationId, residualX / hit->GetDx());
409 fHM->H2(namePullY)->Fill(stationId, residualY / hit->GetDy());
416 const string& detName,
419 if (NULL == points || NULL == hits || NULL == hitMatches)
421 string accName =
"_hhe_" + detName +
"_All_Acc_Station";
422 if (NULL == points || !
fHM->Exists(accName))
429 string recName =
"_hhe_" + detName +
"_All_Rec_Station";
430 string cloneName =
"_hhe_" + detName +
"_All_Clone_Station";
431 set<Int_t> mcPointSet;
433 for (
Int_t iHit = 0; iHit < nofHits; iHit++) {
436 if (mcPointSet.find(
match->GetMatchedLink().GetIndex()) == mcPointSet.end()) {
438 mcPointSet.insert(
match->GetMatchedLink().GetIndex());
450 Int_t nStationsDCH1 = 3;
452 for (
Int_t iSt = 0; iSt < nStationsGEM; ++iSt) {
453 TString occupname =
Form(
"Occupancy_%dst_gem", iSt);
456 TString pntXhitXname =
Form(
"PntX_vs_HitX_%dst_gem", iSt);
457 TString pntYhitYname =
Form(
"PntY_vs_HitY_%dst_gem", iSt);
461 CreateH1(resXname.
Data(),
"ResX, cm",
"Counter", 200, -5, 5);
462 CreateH1(resYname.
Data(),
"ResY, cm",
"Counter", 200, -5, 5);
463 CreateH2(pntXhitXname.
Data(),
"X_{MC}, cm",
"X_{reco}, cm",
"", 400, -70, 70, 400, -70, 70);
464 CreateH2(pntYhitYname.
Data(),
"Y_{MC}, cm",
"Y_{reco}, cm",
"", 400, -70, 70, 400, -70, 70);
466 CreateH2(occupname.
Data(),
"X_{MC}, cm",
"Y_{MC}, cm",
"Occupancy, #frac{part}{event * cm^{2}}", 50, -100, 100,
469 CreateH1(pullXname.
Data(),
"PullX",
"Counter", 200, -10, 10);
470 CreateH1(pullYname.
Data(),
"PullY",
"Counter", 200, -10, 10);
473 for (
Int_t iSt = 0; iSt < nStationsSil; ++iSt) {
474 TString occupname =
Form(
"Occupancy_%dst_sil", iSt);
477 TString pntXhitXname =
Form(
"PntX_vs_HitX_%dst_sil", iSt);
478 TString pntYhitYname =
Form(
"PntY_vs_HitY_%dst_sil", iSt);
482 CreateH1(resXname.
Data(),
"ResX, cm",
"Counter", 200, -1, 1);
483 CreateH1(resYname.
Data(),
"ResY, cm",
"Counter", 200, -1, 1);
484 CreateH2(pntXhitXname.
Data(),
"X_{MC}, cm",
"X_{reco}, cm",
"", 400, -20, 20, 400, -20, 20);
485 CreateH2(pntYhitYname.
Data(),
"Y_{MC}, cm",
"Y_{reco}, cm",
"", 400, -20, 20, 400, -20, 20);
487 CreateH2(occupname.
Data(),
"X_{MC}, cm",
"Y_{MC}, cm",
"Occupancy, #frac{part}{event * cm^{2}}", 50, -20, 20,
490 CreateH1(pullXname.
Data(),
"PullX",
"Counter", 200, -10, 10);
491 CreateH1(pullYname.
Data(),
"PullY",
"Counter", 200, -10, 10);
494 for (
Int_t iSt = 0; iSt < nStationsDCH1; ++iSt) {
496 TString occupname =
Form(
"Occupancy_%dst_dch1", iSt);
498 CreateH2(occupname.
Data(),
"X_{MC}, cm",
"Y_{MC}, cm",
"Occupancy, #frac{part}{event * cm^{2}}", 50, -20, 20,
503 CreateH1(
"hen_EventNo_ClusteringQa",
"",
"", 1, 0, 1.);
504 CreateH1(
"Impact parameter",
"b, fm",
"Counter", 50, 0.0, 0.0);
505 CreateH1(
"Multiplicity",
"N_{prim}",
"Counter", 60, 0.0, 0.0);
506 CreateH2(
"Impact_Mult",
"b, fm",
"N_{prim}",
"", 400, 0.0, 0.0, 400, 0.0, 0.0);
510 const string& xTitle,
511 const string& yTitle,
516 TH1F* h =
new TH1F(name.c_str(),
string(name +
";" + xTitle +
";" + yTitle).c_str(), nofBins, minBin, maxBin);
521 const string& xTitle,
522 const string& yTitle,
523 const string& zTitle,
531 TH2F* h =
new TH2F(name.c_str(), (name +
";" + xTitle +
";" + yTitle +
";" + zTitle).c_str(), nofBinsX, minBinX,
532 maxBinX, nofBinsY, minBinY, maxBinY);
Simulation report for clustering QA.
FairTask for clustering performance calculation.
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Simulation report for clustering QA.
BmnGemStripStationSet * fGemDetector
void ReadDataBranches()
Read data branches.
TClonesArray * fDch1Points
void ProcessClusters(const TClonesArray *clusters, const TClonesArray *clusterMatches, const string &detName, DetectorId detId)
TClonesArray * fGemHitMatches
TClonesArray * fGemPoints
void FillEventCounterHistograms()
TClonesArray * fSilHitMatches
void CreateH2(const string &name, const string &xTitle, const string &yTitle, const string &zTitle, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
void FillResidualAndPullHistograms(const TClonesArray *points, const TClonesArray *hits, const TClonesArray *hitMatches, const string &detName, DetectorId detId)
BmnSiliconStationSet * fSilDetector
void ProcessDigis(const TClonesArray *digis, const TClonesArray *digiMatches, const string &detName, DetectorId detId)
void ProcessHits(const TClonesArray *hits, const TClonesArray *hitMatches, const string &detName, DetectorId detId)
BmnClusteringQa()
Constructor.
virtual ~BmnClusteringQa()
Destructor.
virtual void Exec(Option_t *opt)
Derived from FairTask.
void ProcessPoints(const TClonesArray *points, const string &detName, DetectorId detId)
TClonesArray * fDch1HitMatches
virtual void Finish()
Derived from FairTask.
void FillHitEfficiencyHistograms(const TClonesArray *points, const TClonesArray *hits, const TClonesArray *hitMatches, const string &detName, DetectorId detId)
TClonesArray * fGemDigits
Int_t GetStationId(Int_t address, DetectorId detId)
TClonesArray * fSilPoints
void CreateH1(const string &name, const string &xTitle, const string &yTitle, Int_t nofBins, Double_t minBin, Double_t maxBin)
virtual InitStatus Init()
Derived from FairTask.
TClonesArray * fGemDigitMatches
Short_t GetStation() const
const BmnLink & GetMatchedLink() const
Base class for simulation reports.
void Create(BmnHistManager *histManager, const string &outputDir)
Main function which creates report data.
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
const char * Data() const