21#include "FairBaseParSet.h"
22#include "FairDetector.h"
23#include "FairRootManager.h"
24#include "FairRunAna.h"
25#include "FairRuntimeDb.h"
26#include "TClonesArray.h"
43 , fOutFolder(
"TrdHitProducerQA",
"TrdHitProducerQA")
60 for (
int i = 0; i < nStations; i++) {
61 fvhHitPullX.push_back(
new TH1F(Form(
"L%iHitPullX", i),
"", 500, -50, 50));
62 fvhHitPullY.push_back(
new TH1F(Form(
"L%iHitPullY", i),
"", 500, -50, 50));
63 fvhHitPullT.push_back(
new TH1F(Form(
"L%iHitPullT", i),
"", 500, -50, 50));
71 fvhHitResX.push_back(
new TH1F(Form(
"L%iHitResX", i),
"", 500, -50, 50));
72 fvhHitResY.push_back(
new TH1F(Form(
"L%iHitResY", i),
"", 500, -50, 50));
73 fvhHitResT.push_back(
new TH1F(Form(
"L%iHitResT", i),
"", 500, -50, 50));
81 fvhedEcut.push_back(
new TH1F(Form(
"L%iedEcut", i), Form(
"dEdx of e- for layer %i, mom. cut", i), 600, 0., 60.));
82 fvhedEall.push_back(
new TH1F(Form(
"L%iedEall", i), Form(
"dEdx of e- for layer %i", i), 600, 0., 60.));
84 fvhpidEcut.push_back(
new TH1F(Form(
"L%ipidEcut", i), Form(
"dEdx of pi- for layer %i, mom. cut", i), 600, 0., 60.));
85 fvhpidEall.push_back(
new TH1F(Form(
"L%ipidEall", i), Form(
"dEdx of pi- for layer %i", i), 600, 0., 60.));
92 fvdECanvas.push_back(
new CbmQaCanvas(Form(
"cL%iEnergyLoss", i), Form(
"Energy Loss Layer %i", i), 2 * 400, 2 * 400));
97 new CbmQaCanvas(Form(
"cL%iPull", i), Form(
"Pull Distribution Layer %i", i), 3 * 400, 2 * 400));
103 FairRootManager*
rootMgr = FairRootManager::Instance();
105 cout <<
"-E- CbmTrdHitProducerQa::Init : "
106 <<
"ROOT manager is not instantiated !" << endl;
113 cout <<
"-W- CbmTrdHitProducerQa::Init : "
114 <<
"no digi manager found !" << endl;
124 cout <<
"-W- CbmTrdHitProducerQa::Init : "
125 <<
"no TRD point array !" << endl;
132 cout <<
"-W- CbmTrdHitProducerQa::Init : "
133 <<
"no TRD hit array !" << endl;
140 cout <<
"-E- CbmTrdHitProducerQa::Init : No MCTrack array!" << endl;
146 cout << GetName() <<
": no TRD match branch in digi manager." << endl;
162 if (
nullptr == trdHit)
continue;
165 if (
nullptr == trdDigiMatch)
continue;
170 if (
nullptr == trdPoint)
continue;
175 cout << GetName() <<
": Warning, TRD plane out of bounds, skipping hit."
183 const int index = trdPoint->GetTrackID();
187 const float momentum = TMath::Sqrt((trdPoint->GetPx() * trdPoint->GetPx()) + (trdPoint->GetPy() * trdPoint->GetPy())
188 + (trdPoint->GetPz() * trdPoint->GetPz()));
194 if (TMath::Abs(partID) == 11) {
202 if (TMath::Abs(partID) == 211) {
207 const float hitPosX = trdHit->
GetX();
208 const float pointPosX = (trdPoint->GetX() + trdPoint->
GetXOut()) / 2.;
209 const float hitResX = hitPosX - pointPosX;
210 const float hitPullX = hitResX / trdHit->
GetDx();
212 const float hitPosY = trdHit->
GetY();
213 const float pointPosY = (trdPoint->GetY() + trdPoint->
GetYOut()) / 2.;
214 const float hitResY = hitPosY - pointPosY;
215 const float hitPullY = hitResY / trdHit->
GetDy();
217 const double hitPosT = trdHit->
GetTime();
218 const double pointPosT = trdPoint->GetTime();
219 const double hitResT = hitPosT - pointPosT;
220 const double hitPullT = hitResT / trdHit->
GetTimeError();
241 for (
size_t i = 0; i <
fvdECanvas.size(); i++) {
275 FairSink* sink = FairRootManager::Instance()->GetSink();
@ kTrd
Transition Radiation Detector.
static FairRootManager * rootMgr
Definition of the CbmQaCanvas class.
ClassImp(CbmTrdHitProducerQa)
Class for hits in TRD detector.
static Bool_t IsMatchPresent(ECbmModuleId systemId)
Presence of a digi match branch.
InitStatus Init()
Initialisation.
static CbmDigiManager * Instance()
Static instance.
const CbmMatch * GetMatch(ECbmModuleId systemId, UInt_t index) const
Get a match object.
double GetTimeError() const
TObject * Get(const CbmLink *lnk)
Task class creating and managing CbmMCDataArray objects.
CbmMCDataObject * GetObject(const char *name)
CbmMCDataArray * InitBranch(const char *name)
int32_t GetPdgCode() const
int32_t GetNofLinks() const
const CbmLink & GetMatchedLink() const
std::vector< TH1F * > fvhHitPullY
std::vector< CbmQaCanvas * > fvPullCanvas
CbmDigiManager * fDigiMan
subfolder for histograms
std::vector< CbmQaCanvas * > fvdECanvas
std::vector< TH1F * > fvhedEcut
std::vector< TH1F * > fvhpidEall
TFolder * histFolder
output folder with histos and canvases
virtual void Exec(Option_t *option)
CbmMCDataArray * fTrdPoints
std::vector< TH1F * > fvhHitResX
CbmMCDataArray * fMCTrackArray
TClonesArray * fTrdHitCollection
std::vector< TH1F * > fvhpidEcut
virtual ~CbmTrdHitProducerQa()
std::vector< TH1F * > fvhHitResT
std::vector< TH1F * > fvhHitResY
std::vector< TH1F * > fvhHitPullX
std::vector< TH1F * > fvhHitPullT
std::vector< TH1F * > fvhedEall
data class for a reconstructed Energy-4D measurement in the TRD
int32_t GetPlaneId() const
Inherited from CbmBaseHit.