22#include <FairRootManager.h>
23#include <FairTrackParam.h>
26#include <TClonesArray.h>
35 FairRootManager* ioman = FairRootManager::Instance();
36 if (!ioman) LOG(fatal) <<
"CbmRichEventDisplay::Init: RootManager not instantiated!";
42 fCbmEvents =
static_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
43 if (!
fCbmEvents) LOG(fatal) <<
"CbmRichEventDisplay::Init: No CbmEvent array!";
45 fRichPoints =
static_cast<TClonesArray*
>(ioman->GetObject(
"RichPoint"));
48 fRichHits =
static_cast<TClonesArray*
>(ioman->GetObject(
"RichHit"));
49 if (!
fRichHits &&
fDrawHits) LOG(fatal) <<
"CbmRichEventDisplay::Init: No RichHit array!";
51 fRichRings =
static_cast<TClonesArray*
>(ioman->GetObject(
"RichRing"));
54 fRichProjections =
static_cast<TClonesArray*
>(ioman->GetObject(
"RichProjection"));
65 for (Int_t i = 0; i <
fCbmEvents->GetEntriesFast(); i++) {
75 ss <<
"rich_event_display_event_" <<
fEventNum;
76 TCanvas* c =
fHM->
CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
79 TH2D* padU =
new TH2D(
"padU",
";x [cm];y [cm]", 1, -120., 120., 1, 120., 210);
81 padU->GetYaxis()->SetTitleOffset(0.75);
82 gPad->SetLeftMargin(0.1);
83 gPad->SetRightMargin(0.05);
87 TH2D* padD =
new TH2D(
"padD",
";x [cm];y [cm]", 1, -120., 120., 1, -210., -120.);
89 padD->GetYaxis()->SetTitleOffset(0.75);
90 gPad->SetLeftMargin(0.1);
91 gPad->SetRightMargin(0.05);
100 for (
int iP = 0; iP < nofProjections; iP++) {
105 if ((plane ==
"up" && pr->GetY() >= 0.) || (plane ==
"down" && pr->GetY() < 0.)) {
106 TMarker* m =
new TMarker(pr->GetX(), pr->GetY(), 3.);
107 m->SetMarkerSize(0.7);
108 m->SetMarkerColor(kGreen + 3);
117 for (
int iH = 0; iH < nofHits; iH++) {
120 if ((plane ==
"up" && hit->
GetY() >= 0.) || (plane ==
"down" && hit->
GetY() < 0.)) {
121 TEllipse* hitDr =
new TEllipse(hit->
GetX(), hit->
GetY(), 0.6);
122 hitDr->SetFillColor(kRed);
123 hitDr->SetLineColor(kRed);
132 for (
int iR = 0; iR < nofRings; iR++) {
135 if ((plane ==
"up" && ring->
GetCenterY() >= 0.) || (plane ==
"down" && ring->
GetCenterY() < 0.)) {
144 Double_t evStart =
event->GetStartTime();
145 Double_t evStop =
event->GetEndTime();
147 for (
int iP = 0; iP < nofPoints; iP++) {
149 if (!point)
continue;
150 Double_t pointTime = point->GetTime();
151 if (pointTime > evStart && pointTime < evStop)
continue;
152 if ((plane ==
"up" && point->GetY() >= 0.) || (plane ==
"down" && point->GetY() < 0.)) {
153 TVector3 posPoint(point->GetX(), point->GetY(), point->GetZ());
156 TEllipse* pointDr =
new TEllipse(detPoint.X(), detPoint.Y(), 0.2);
166 circle->SetFillStyle(0);
167 circle->SetLineWidth(2);
168 circle->SetLineColor(kBlue);
171 center->SetMarkerColor(kBlue);
172 center->SetMarkerSize(0.4);
ClassImp(CbmConverterManager)
@ kRich
Ring-Imaging Cherenkov Detector.
void SetDefaultDrawStyle()
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Helper functions for drawing 1D and 2D histograms and graphs.
Event display for the RICH detector.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
InitStatus Init()
Initialisation.
static CbmDigiManager * Instance()
Static instance.
Class characterising one event by a collection of links (indices) to data objects,...
uint32_t GetIndex(ECbmDataType type, uint32_t iData)
TCanvas * CreateCanvas(const std::string &name, const std::string &title, Int_t width, Int_t height)
Create and draw TCanvas and store pointer to it.
void SaveCanvasToImage(const std::string &outputDir, const std::string &options="png,eps")
Save all stored canvases to images.
Event display for the RICH detector.
std::string fOutputFormat
void DrawOnePmtPlane(const std::string &plane, CbmEvent *event)
void DrawEllipse(CbmRichRing *ring)
TClonesArray * fRichRings
void DrawOneEvent(CbmEvent *event)
CbmDigiManager * fDigiManager
TClonesArray * fRichPoints
TClonesArray * fRichProjections
TClonesArray * fCbmEvents
void RotatePoint(TVector3 *inPos, TVector3 *outPos, Bool_t noTilting=false)
static CbmRichGeoManager & GetInstance()