Skip to content
Snippets Groups Projects
Commit d0e4cb0c authored by Adrian A. Weber's avatar Adrian A. Weber Committed by Pierre-Alain Loizeau
Browse files

add updated rich analysis + macros

parent 35ed85cd
No related branches found
No related tags found
1 merge request!877Changes from mCBM 2022 prod to RICH unpack, reco and monitor
Showing
with 4924 additions and 797 deletions
FairRunInfo_reco*
reco_mcbm_*.root
/result_r*/
tof*.root
/* Copyright (C) 2022 UGiessen, Giessen
SPDX-License-Identifier: GPL-3.0-only
Authors: Florian Uhlig, Adrian Weber [committer]*/
#include <TFile.h>
#include <TGeoMatrix.h>
#include <map>
#include <string>
std::pair<std::string, TGeoHMatrix> AlignNode(std::string path, double shiftX, double shiftY, double shiftZ,
double rotX, double rotY, double rotZ)
{
TGeoHMatrix result;
result.SetDx(shiftX);
result.SetDy(shiftY);
result.SetDz(shiftZ);
result.RotateX(rotX);
result.RotateY(rotY);
result.RotateZ(rotZ);
std::cout << "Alignment matrix for node " << path << " is: " << std::endl;
result.Print();
std::cout << std::endl;
return std::pair<std::string, TGeoHMatrix>(path, result);
}
int create_alignment_2022_03_22_iron()
{
// Define the basic structure which needs to be filled with information
// This structure is stored in the output file and later passed to the
// FairRoot framework to do the (miss)alignment
std::map<std::string, TGeoHMatrix> matrices;
// ---------------- STS ----------------------------//
// Align full STS
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0", 0.275, -0.89, -.5, 0., 0., 0.));
// Align individual STS Units
// Station 1
// Unit 0
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station01_1/Ladder09_1", 0.0, 0.045, 0., 0., 0., 0.));
// Unit 1
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station01_1/Ladder09_2", -0.04, 0.06, 0., 0., 0., 0.));
// Station 2
// Unit 2
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station02_2/Ladder10_2", 0.0, -0.11, 0., 0., 0., 0.));
// ---------------- TOF ----------------------------//
// Align full Tof
// matrices.insert(AlignNode("/cave_1/tof_v21f_mcbm_0/tof_v21f_mcbmStand_1", 0.0, 0.0, 0.0, 0., 0.0, 0.));
// --------------- RICH ----------------------------//
// Align full Rich
matrices.insert(AlignNode("/cave_1/rich_v21b_mcbm_0/box_1", -10.0, 0.0, 0.0, 0., 0.0, 0.));
// save matrices to disk
TFile* misalignmentMatrixRootfile = new TFile("AlignmentMatrices_mcbm_beam_2022_03_22_iron.root", "RECREATE");
if (misalignmentMatrixRootfile->IsOpen()) {
gDirectory->WriteObject(&matrices, "MisalignMatrices");
misalignmentMatrixRootfile->Write();
misalignmentMatrixRootfile->Close();
}
return 0;
}
/* Copyright (C) 2022 UGiessen, Giessen
SPDX-License-Identifier: GPL-3.0-only
Authors: Florian Uhlig, Adrian Weber [committer]*/
#include <TFile.h>
#include <TGeoMatrix.h>
#include <map>
#include <string>
std::pair<std::string, TGeoHMatrix> AlignNode(std::string path, double shiftX, double shiftY, double shiftZ,
double rotX, double rotY, double rotZ)
{
TGeoHMatrix result;
result.SetDx(shiftX);
result.SetDy(shiftY);
result.SetDz(shiftZ);
result.RotateX(rotX);
result.RotateY(rotY);
result.RotateZ(rotZ);
std::cout << "Alignment matrix for node " << path << " is: " << std::endl;
result.Print();
std::cout << std::endl;
return std::pair<std::string, TGeoHMatrix>(path, result);
}
int create_alignment_2022_05_23_nickel()
{
// Define the basic structure which needs to be filled with information
// This structure is stored in the output file and later passed to the
// FairRoot framework to do the (miss)alignment
std::map<std::string, TGeoHMatrix> matrices;
// ---------------- STS ----------------------------//
// Align full STS
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0", 0.275, -0.89, -.5, 0., 0., 0.));
// Align individual STS Units
// Station 1
// Unit 0
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station01_1/Ladder09_1", 0.0, 0.045, 0., 0., 0., 0.));
// Unit 1
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station01_1/Ladder09_2", -0.04, 0.06, 0., 0., 0., 0.));
// Station 2
// Unit 2
// matrices.insert(AlignNode("/cave_1/sts_v22c_mcbm_0/Station02_2/Ladder10_2", 0.0, -0.11, 0., 0., 0., 0.));
// ---------------- TOF ----------------------------//
// Align full Tof
// matrices.insert(AlignNode("/cave_1/tof_v21f_mcbm_0/tof_v21f_mcbmStand_1", 0.0, 0.0, 0.0, 0., 0.0, 0.));
matrices.insert(AlignNode("/cave_1/tof_v21h_mcbm_0/tof_v21h_mcbmStand_1/module_0_0", 0.0, 0.0, 0.0, 0., 0.0, 0.));
matrices.insert(AlignNode("/cave_1/tof_v21h_mcbm_0/tof_v21h_mcbmStand_1/module_0_1", 0.0, 0.0, 0.0, 0., 0.0, 0.));
matrices.insert(AlignNode("/cave_1/tof_v21h_mcbm_0/tof_v21h_mcbmStand_1/module_0_2", 0.0, -10.0, 0.0, 0., 0.0, 0.));
matrices.insert(AlignNode("/cave_1/tof_v21h_mcbm_0/tof_v21h_mcbmStand_1/module_0_3", 0.0, 0.0, 0.0, 0., 0.0, 0.));
matrices.insert(AlignNode("/cave_1/tof_v21h_mcbm_0/tof_v21h_mcbmStand_1/module_0_4", 0.0, 0.0, 0.0, 0., 0.0, 0.));
// --------------- RICH ----------------------------//
// Align full Rich
matrices.insert(AlignNode("/cave_1/rich_v21c_mcbm_0/box_1", 0.0, 0.0, 0.0, 0., 0.0, 0.));
// save matrices to disk
TFile* misalignmentMatrixRootfile = new TFile("AlignmentMatrices_mcbm_beam_2022_05_23_nickel.root", "RECREATE");
if (misalignmentMatrixRootfile->IsOpen()) {
gDirectory->WriteObject(&matrices, "MisalignMatrices");
misalignmentMatrixRootfile->Write();
misalignmentMatrixRootfile->Close();
}
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -110,6 +110,17 @@ public:
*/
void SetTriggerRichHits(Int_t val = 0) { fTriggerRichHits = val; }
/**
* Set a flag to draw only Single Event Displays with minimum one ring.
*/
void SetSEDisplayRingOnly(bool val = true) { bSeDisplayRingOnly = val; }
/**
* Activate generation of Time related histograms
*/
void ActivateTimeHistograms(bool val = true) { fDoTimePlots = val; }
/**
* Set an ToT cut of the RICH Hits.
*/
......@@ -174,6 +185,7 @@ private:
Int_t fTracksinRichWithRichHits[4] = {0, 0, 0, 0};
uint64_t fTSMinTime = 0;
string fOutputDir; // output dir for results
......@@ -183,12 +195,18 @@ private:
bool fDoWriteHistToFile = true;
bool fDoDrawCanvas = true;
bool bSeDisplayRingOnly = false;
bool fDigiHitsInitialized = false;
bool fDoTimePlots = false;
bool RestrictToFullAcc(CbmTofTracklet* track);
bool RestrictToFullAcc(TVector3& pos);
bool RestrictToFullAcc(Double_t x, Double_t y);
TVector3 extrapolate(CbmTofHit* tofHit, Double_t Z);
Double_t fCbmEventStartTime = 0.;
CbmEvent* fEventPnt = nullptr;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment