CbmRoot
|
RICH geometry checking and testing. More...
#include <CbmRichGeoTest.h>
Public Member Functions | |
CbmRichGeoTest () | |
Standard constructor. | |
virtual | ~CbmRichGeoTest () |
Standard destructor. | |
virtual InitStatus | Init () |
Inherited from FairTask. | |
virtual void | Exec (Option_t *option) |
Inherited from FairTask. | |
virtual void | Finish () |
Inherited from FairTask. | |
void | SetOutputDir (const std::string &dir) |
Set output directory where you want to write results (figures and json). | |
void | DrawFromFile (const std::string &fileName, const std::string &outputDir) |
Draw histogram from file. | |
void | SetDrawPmts (bool draw) |
void | SetDrawEventDisplay (bool draw) |
Private Member Functions | |
void | InitHistograms () |
Initialize histograms. | |
void | ProcessMc () |
Fill MC histogram for detector acceptance calculation. | |
CbmRichRingLight | CreateRingLightWithPoints (int fileId, int mcEventId, int mcTrackId) |
void | RingParameters () |
Loop over all rings in array and fill ring parameters histograms. | |
void | FitAndFillHistEllipse (int histIndex, CbmRichRingLight *ring, double momentum) |
Fit ring using ellipse fitter and fill histograms. | |
void | FitAndFillHistCircle (int histIndex, CbmRichRingLight *ring, double momentum) |
Fit ring using circle fitter and fill histograms. | |
void | FillMcVsHitFitEllipse (CbmRichRingLight *ring, CbmRichRingLight *ringMc) |
Calculate difference between ellipse parameters for two fitting using hits and MC points for fit and fill corresponding histograms. | |
void | FillMcVsHitFitCircle (CbmRichRingLight *ring, CbmRichRingLight *ringMc) |
Calculate difference between circle parameters for two fittings using hits and MC points for fit and fill corresponding histograms. | |
void | ProcessHits () |
Calculate residuals between hits and MC points and fill histograms. | |
TH1D * | CreateAccVsMinNofHitsHist () |
Create histogram: RICH detector acceptance vs. minimum required number of hits in ring. | |
void | DrawHist () |
Draw histograms. | |
void | DrawRing (CbmRichRingLight *ringHit, CbmRichRingLight *ringPoint) |
Draw ring in separate TCanvas. | |
void | DrawH2MeanRms (TH2 *hist, const std::string &canvasName) |
void | DrawPmts () |
DrawPmts. | |
void | DrawPmtPoint (const std::string &coordOpt, const std::vector< int > &ids, bool isDrawPixel) |
std::string | CalcEfficiency (TH1 *histRec, TH1 *histAcc) |
Calculate efficiency. | |
CbmRichGeoTest (const CbmRichGeoTest &) | |
Copy constructor. | |
CbmRichGeoTest & | operator= (const CbmRichGeoTest &) |
Assignment operator. | |
Private Attributes | |
std::string | fOutputDir = "" |
TClonesArray * | fRichHits = nullptr |
TClonesArray * | fRichRings = nullptr |
CbmMCDataArray * | fRichRefPlanePoints = nullptr |
CbmDigiManager * | fDigiMan = nullptr |
CbmMCDataArray * | fRichPoints = nullptr |
CbmMCDataArray * | fMcTracks = nullptr |
TClonesArray * | fRichRingMatches = nullptr |
CbmMCEventList * | fEventList = nullptr |
CbmRichRingFitterCOP * | fCopFit = nullptr |
CbmRichRingFitterEllipseTau * | fTauFit = nullptr |
CbmHistManager * | fHM = nullptr |
int | fEventNum = 0 |
int | fMinNofHits = 7 |
double | fMinAaxis = 3. |
double | fMaxAaxis = 7. |
double | fMinBaxis = 3. |
double | fMaxBaxis = 7. |
double | fMinRadius = 3. |
double | fMaxRadius = 7. |
int | fNofDrawnRings = 0 |
bool | fDrawPmts = true |
bool | fDrawEventDisplay = true |
CbmRichGeoTest::CbmRichGeoTest | ( | ) |
Standard constructor.
Definition at line 70 of file CbmRichGeoTest.cxx.
|
virtual |
Standard destructor.
Definition at line 72 of file CbmRichGeoTest.cxx.
|
private |
Copy constructor.
|
private |
Calculate efficiency.
[in] | histRec | |
[in] | histAcc |
Definition at line 1142 of file CbmRichGeoTest.cxx.
References Cbm::NumberToString().
Referenced by DrawHist().
|
private |
Create histogram: RICH detector acceptance vs. minimum required number of hits in ring.
Definition at line 623 of file CbmRichGeoTest.cxx.
References fHM, and CbmHistManager::H1().
Referenced by DrawHist().
|
private |
Definition at line 325 of file CbmRichGeoTest.cxx.
References CbmRichRingLight::AddHit(), fMcTracks, fRichPoints, CbmMCDataArray::Get(), CbmRichGeoManager::GetInstance(), CbmMCTrack::GetMotherId(), CbmRichGeoManager::RotatePoint(), and CbmMCDataArray::Size().
Referenced by RingParameters().
void CbmRichGeoTest::DrawFromFile | ( | const std::string & | fileName, |
const std::string & | outputDir ) |
Draw histogram from file.
Save old global file and folder pointer to avoid messing with FairRoot
Restore old global file and folder pointer to avoid messing with FairRoot
Definition at line 1153 of file CbmRichGeoTest.cxx.
References DrawHist(), fHM, fOutputDir, CbmHistManager::ReadFromFile(), and CbmHistManager::SaveCanvasToImage().
|
private |
Definition at line 637 of file CbmRichGeoTest.cxx.
References CbmHistManager::CreateCanvas(), DrawH1(), DrawH2WithProfile(), fHM, and kLinear.
Referenced by DrawHist().
|
private |
Draw histograms.
Definition at line 652 of file CbmRichGeoTest.cxx.
References CalcEfficiency(), CreateAccVsMinNofHitsHist(), CbmHistManager::CreateCanvas(), Cbm::DivideH1(), Cbm::DivideH2(), DrawH1(), DrawH1andFitGauss(), DrawH2(), DrawH2MeanRms(), DrawH2WithProfile(), DrawH3Profile(), CbmRichDraw::DrawPmtH2(), fHM, CbmHistManager::H1(), CbmHistManager::H1Clone(), CbmHistManager::H1Vector(), CbmHistManager::H2(), CbmHistManager::H2Clone(), CbmHistManager::H3(), kLinear, kLog, CbmHistManager::NormalizeToIntegral(), and SetDefaultDrawStyle().
Referenced by DrawFromFile(), and Finish().
|
private |
Definition at line 1071 of file CbmRichGeoTest.cxx.
References CbmRichPmtData::fHeight, CbmRichPixelData::fX, CbmRichPmtData::fX, CbmRichPixelData::fY, CbmRichPmtData::fY, CbmRichPixelData::fZ, CbmRichPmtData::fZ, CbmRichDigiMapManager::GetInstance(), CbmRichGeoManager::GetInstance(), CbmRichDigiMapManager::GetPixelDataByAddress(), CbmRichDigiMapManager::GetPmtDataById(), and CbmRichGeoManager::RotatePoint().
Referenced by DrawPmts().
|
private |
DrawPmts.
Definition at line 1005 of file CbmRichGeoTest.cxx.
References CbmHistManager::Create3(), CbmHistManager::CreateCanvas(), DrawPmtPoint(), fHM, CbmRichPixelData::fX, CbmRichPixelData::fY, CbmRichPixelData::fZ, CbmRichDigiMapManager::GetInstance(), CbmRichGeoManager::GetInstance(), CbmRichDigiMapManager::GetPixelAddresses(), CbmRichDigiMapManager::GetPixelDataByAddress(), CbmRichDigiMapManager::GetPmtIds(), CbmHistManager::H3(), and CbmRichGeoManager::RotatePoint().
Referenced by Finish().
|
private |
Draw ring in separate TCanvas.
[in] | ring | Ring with RICH hits. |
[in] | ringPoint | Ring with MC RICH points. |
Definition at line 566 of file CbmRichGeoTest.cxx.
References CbmHistManager::CreateCanvas(), fHM, fNofDrawnRings, CbmRichHitLight::fX, CbmRichHitLight::fY, CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmRichRingLight::GetHit(), CbmRichRingLight::GetNofHits(), and CbmRichRingLight::GetRadius().
Referenced by RingParameters().
|
virtual |
Inherited from FairTask.
Definition at line 101 of file CbmRichGeoTest.cxx.
References fEventNum, ProcessHits(), ProcessMc(), and RingParameters().
|
private |
Calculate difference between circle parameters for two fittings using hits and MC points for fit and fill corresponding histograms.
[in] | ring | Ring fitted using hits. |
[in] | ringMc | Ring fitted using MC points |
Definition at line 516 of file CbmRichGeoTest.cxx.
References fHM, CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmRichRingLight::GetNofHits(), CbmRichRingLight::GetRadius(), and CbmHistManager::H2().
Referenced by RingParameters().
|
private |
Calculate difference between ellipse parameters for two fitting using hits and MC points for fit and fill corresponding histograms.
[in] | ring | Ring fitted using hits. |
[in] | ringMc | Ring fitted using MC points |
Definition at line 508 of file CbmRichGeoTest.cxx.
References fHM, CbmRichRingLight::GetAaxis(), CbmRichRingLight::GetBaxis(), CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmRichRingLight::GetNofHits(), and CbmHistManager::H2().
Referenced by RingParameters().
|
virtual |
Inherited from FairTask.
Definition at line 1122 of file CbmRichGeoTest.cxx.
References CbmHistManager::Clear(), DrawHist(), DrawPmts(), fDrawPmts, fHM, fOutputDir, CbmHistManager::SaveCanvasToImage(), and CbmHistManager::WriteToFile().
|
private |
Fit ring using circle fitter and fill histograms.
[in] | histIndex | Fitting type index, 0 - hit fitting, 1 - MC points fitting. |
[in] | ring | Pointer to CbmRichRingLight to be fitted and filled in histograms. |
[in] | momentum | MC momentum of particle produced ring. |
Definition at line 479 of file CbmRichGeoTest.cxx.
References CbmRichRingFitterCOP::DoFit(), fCopFit, fHM, CbmRichHitLight::fX, CbmRichHitLight::fY, CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmRichRingLight::GetChi2(), CbmRichRingLight::GetHit(), CbmRichRingLight::GetNofHits(), CbmRichRingLight::GetRadius(), CbmHistManager::H1(), CbmHistManager::H2(), and sqrt().
Referenced by RingParameters().
|
private |
Fit ring using ellipse fitter and fill histograms.
[in] | histIndex | Fitting type index, 0 - hit fitting, 1 - MC points fitting. |
[in] | ring | Pointer to CbmRichRing to be fitted and filled in histograms. |
[in] | momentum | MC momentum of particle produced ring. |
Definition at line 447 of file CbmRichGeoTest.cxx.
References CbmRichRingFitterEllipseTau::DoFit(), fHM, fMaxBaxis, fMinAaxis, fMinBaxis, fTauFit, CbmRichRingLight::GetAaxis(), CbmRichRingLight::GetBaxis(), CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmRichRingLight::GetChi2(), CbmRichRingLight::GetNofHits(), CbmHistManager::H1(), and CbmHistManager::H2().
Referenced by RingParameters().
|
virtual |
Inherited from FairTask.
Definition at line 74 of file CbmRichGeoTest.cxx.
References fCopFit, fDigiMan, fEventList, fMcTracks, fRichHits, fRichPoints, fRichRefPlanePoints, fRichRingMatches, fRichRings, fTauFit, Cbm::GetOrFatal(), CbmDigiManager::Init(), InitHistograms(), Cbm::InitOrFatalMc(), CbmDigiManager::Instance(), CbmDigiManager::IsMatchPresent(), CbmDigiManager::IsPresent(), and kRich.
|
private |
Initialize histograms.
Definition at line 111 of file CbmRichGeoTest.cxx.
References CbmHistManager::Create1(), CbmHistManager::Create2(), CbmHistManager::Create3(), and fHM.
Referenced by Init().
|
private |
Assignment operator.
|
private |
Calculate residuals between hits and MC points and fill histograms.
Definition at line 523 of file CbmRichGeoTest.cxx.
References fDigiMan, fHM, fRichHits, fRichPoints, CbmDigiManager::Get(), CbmMCDataArray::Get(), CbmRichGeoManager::GetInstance(), CbmRichPmt::getLambda(), CbmMatch::GetLinks(), CbmDigiManager::GetMatch(), CbmHit::GetRefId(), CbmPixelHit::GetX(), CbmPixelHit::GetY(), CbmHit::GetZ(), CbmHistManager::H1(), CbmHistManager::H2(), kRich, and CbmRichGeoManager::RotatePoint().
Referenced by Exec().
|
private |
Fill MC histogram for detector acceptance calculation.
Definition at line 254 of file CbmRichGeoTest.cxx.
References fEventList, fHM, fMcTracks, fRichPoints, fRichRefPlanePoints, CbmMCDataArray::Get(), CbmMCEventList::GetEventIdByIndex(), CbmMCEventList::GetFileIdByIndex(), CbmMCTrack::GetGeantProcessId(), CbmRichGeoManager::GetInstance(), CbmRichPmt::getLambda(), CbmMCTrack::GetMotherId(), CbmMCEventList::GetNofEvents(), CbmMCTrack::GetP(), CbmMCTrack::GetPdgCode(), CbmMCTrack::GetPt(), CbmMCTrack::GetRapidity(), CbmMCTrack::GetStartVertex(), CbmHistManager::H1(), CbmHistManager::H2(), CbmRichGeoManager::RotatePoint(), CbmMCDataArray::Size(), and v.
Referenced by Exec().
|
private |
Loop over all rings in array and fill ring parameters histograms.
Definition at line 349 of file CbmRichGeoTest.cxx.
References CbmRichConverter::CopyHitsToRingLight(), CreateRingLightWithPoints(), DrawRing(), fDrawEventDisplay, fHM, FillMcVsHitFitCircle(), FillMcVsHitFitEllipse(), FitAndFillHistCircle(), FitAndFillHistEllipse(), fMaxAaxis, fMaxBaxis, fMaxRadius, fMcTracks, fMinAaxis, fMinBaxis, fMinNofHits, fMinRadius, fNofDrawnRings, fRichRingMatches, fRichRings, CbmRichHitLight::fX, CbmRichHitLight::fY, CbmMCDataArray::Get(), CbmRichRingLight::GetAaxis(), CbmRichRingLight::GetBaxis(), CbmRichRingLight::GetCenterX(), CbmRichRingLight::GetCenterY(), CbmLink::GetEntry(), CbmMCTrack::GetGeantProcessId(), CbmRichRingLight::GetHit(), CbmLink::GetIndex(), CbmMatch::GetMatchedLink(), CbmMCTrack::GetMotherId(), CbmRichRing::GetNofHits(), CbmRichRingLight::GetNofHits(), CbmMatch::GetNofLinks(), CbmMCTrack::GetP(), CbmMCTrack::GetPdgCode(), CbmMCTrack::GetPt(), CbmRichRingLight::GetRadius(), CbmMCTrack::GetRapidity(), CbmHistManager::H1(), CbmHistManager::H2(), CbmHistManager::H3(), and sqrt().
Referenced by Exec().
|
inline |
Definition at line 86 of file CbmRichGeoTest.h.
References fDrawEventDisplay.
|
inline |
Definition at line 85 of file CbmRichGeoTest.h.
References fDrawPmts.
|
inline |
Set output directory where you want to write results (figures and json).
[in] | dir | Path to the output directory. |
Definition at line 78 of file CbmRichGeoTest.h.
References fOutputDir.
|
private |
Definition at line 203 of file CbmRichGeoTest.h.
Referenced by FitAndFillHistCircle(), and Init().
|
private |
Definition at line 196 of file CbmRichGeoTest.h.
Referenced by Init(), and ProcessHits().
|
private |
Definition at line 221 of file CbmRichGeoTest.h.
Referenced by RingParameters(), and SetDrawEventDisplay().
|
private |
Definition at line 220 of file CbmRichGeoTest.h.
Referenced by Finish(), and SetDrawPmts().
|
private |
Definition at line 200 of file CbmRichGeoTest.h.
Referenced by Init(), and ProcessMc().
|
private |
Definition at line 208 of file CbmRichGeoTest.h.
Referenced by Exec().
|
private |
Definition at line 206 of file CbmRichGeoTest.h.
Referenced by CreateAccVsMinNofHitsHist(), DrawFromFile(), DrawH2MeanRms(), DrawHist(), DrawPmts(), DrawRing(), FillMcVsHitFitCircle(), FillMcVsHitFitEllipse(), Finish(), FitAndFillHistCircle(), FitAndFillHistEllipse(), InitHistograms(), ProcessHits(), ProcessMc(), and RingParameters().
|
private |
Definition at line 213 of file CbmRichGeoTest.h.
Referenced by RingParameters().
|
private |
Definition at line 215 of file CbmRichGeoTest.h.
Referenced by FitAndFillHistEllipse(), and RingParameters().
|
private |
Definition at line 217 of file CbmRichGeoTest.h.
Referenced by RingParameters().
|
private |
Definition at line 198 of file CbmRichGeoTest.h.
Referenced by CreateRingLightWithPoints(), Init(), ProcessMc(), and RingParameters().
|
private |
Definition at line 212 of file CbmRichGeoTest.h.
Referenced by FitAndFillHistEllipse(), and RingParameters().
|
private |
Definition at line 214 of file CbmRichGeoTest.h.
Referenced by FitAndFillHistEllipse(), and RingParameters().
|
private |
Definition at line 209 of file CbmRichGeoTest.h.
Referenced by RingParameters().
|
private |
Definition at line 216 of file CbmRichGeoTest.h.
Referenced by RingParameters().
|
private |
Definition at line 219 of file CbmRichGeoTest.h.
Referenced by DrawRing(), and RingParameters().
|
private |
Definition at line 191 of file CbmRichGeoTest.h.
Referenced by DrawFromFile(), Finish(), and SetOutputDir().
|
private |
Definition at line 193 of file CbmRichGeoTest.h.
Referenced by Init(), and ProcessHits().
|
private |
Definition at line 197 of file CbmRichGeoTest.h.
Referenced by CreateRingLightWithPoints(), Init(), ProcessHits(), and ProcessMc().
|
private |
Definition at line 195 of file CbmRichGeoTest.h.
Referenced by Init(), and ProcessMc().
|
private |
Definition at line 199 of file CbmRichGeoTest.h.
Referenced by Init(), and RingParameters().
|
private |
Definition at line 194 of file CbmRichGeoTest.h.
Referenced by Init(), and RingParameters().
|
private |
Definition at line 204 of file CbmRichGeoTest.h.
Referenced by FitAndFillHistEllipse(), and Init().