15 #include <FairRootManager.h>
17 #include <FairTrackParam.h>
21 #include <TClonesArray.h>
23 #include <TGenericClassInfo.h>
26 #include <TVirtualPad.h>
34 : FairTask(
"CbmRichEventDisplay")
37 , fRichPoints(nullptr)
38 , fRichMatches(nullptr)
39 , fRichProjections(nullptr)
47 , fDrawProjections(true) {
55 FairRootManager* ioman = FairRootManager::Instance();
56 if (
nullptr == ioman) {
57 Fatal(
"CbmRichEventDisplay::Init",
"RootManager not instantiated!");
60 fRichHits = (TClonesArray*) ioman->GetObject(
"RichHit");
62 Fatal(
"CbmRichEventDisplay::Init",
"No RichHit array!");
65 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
67 Fatal(
"CbmRichEventDisplay::Init",
"No RichRing array!");
70 fRichPoints = (TClonesArray*) ioman->GetObject(
"RichPoint");
72 Fatal(
"CbmRichEventDisplay::Init",
"No RichPoint array!");
75 fRichMatches = (TClonesArray*) ioman->GetObject(
"RichRingMatch");
77 Fatal(
"CbmRichEventDisplay::Init",
"No RichRingMatch array!");
82 Fatal(
"CbmRichEventDisplay::Init",
"No RichProjection array!");
85 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
87 Fatal(
"CbmRichEventDisplay::Init",
"No MCTrack array!");
103 ss <<
"rich_event_display_event_" <<
fEventNum;
104 TCanvas* c =
fHM->
CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
107 TH2D* padU =
new TH2D(
"padU",
";x [cm];y [cm]", 1, -120., 120., 1, 120., 210);
109 padU->GetYaxis()->SetTitleOffset(0.75);
110 gPad->SetLeftMargin(0.1);
111 gPad->SetRightMargin(0.05);
116 new TH2D(
"padD",
";x [cm];y [cm]", 1, -120., 120., 1, -210., -120.);
118 padD->GetYaxis()->SetTitleOffset(0.75);
119 gPad->SetLeftMargin(0.1);
120 gPad->SetRightMargin(0.05);
128 for (
int iP = 0; iP < nofProjections; iP++) {
130 if (
nullptr == pr)
continue;
131 if ((plane ==
"up" && pr->GetY() >= 0.)
132 || (plane ==
"down" && pr->GetY() < 0.)) {
133 TMarker*
m =
new TMarker(pr->GetX(), pr->GetY(), 3.);
134 m->SetMarkerSize(0.7);
135 m->SetMarkerColor(kGreen + 3);
143 int nofHits =
fRichHits->GetEntriesFast();
144 for (
int iH = 0; iH < nofHits; iH++) {
146 if (
nullptr == hit)
continue;
147 if ((plane ==
"up" && hit->
GetY() >= 0.)
148 || (plane ==
"down" && hit->
GetY() < 0.)) {
150 TEllipse* hitDr =
new TEllipse(hit->
GetX(), hit->
GetY(), 0.6);
151 hitDr->SetFillColor(kRed);
152 hitDr->SetLineColor(kRed);
161 for (
int iR = 0; iR < nofRings; iR++) {
163 if (
nullptr == ring)
continue;
164 if ((plane ==
"up" && ring->
GetCenterY() >= 0.)
165 || (plane ==
"down" && ring->
GetCenterY() < 0.)) {
174 for (
int iP = 0; iP < nofPoints; iP++) {
176 if (
nullptr == point)
continue;
177 if ((plane ==
"up" && point->GetY() >= 0.)
178 || (plane ==
"down" && point->GetY() < 0.)) {
179 TEllipse* pointDr =
new TEllipse(point->GetX(), point->GetY(), 0.4);
189 circle->SetFillStyle(0);
190 circle->SetLineWidth(2);
191 circle->SetLineColor(kBlue);
194 center->SetMarkerColor(kBlue);
195 center->SetMarkerSize(0.4);