22#include <fairlogger/Logger.h>
23#include <FairRootManager.h>
43 mIsInitialized(kFALSE),
71 FairRootManager* mgr = FairRootManager::Instance();
73 LOG(error) <<
"Could not instantiate FairRootManager. Exiting ...";
77 mHits = mgr->InitObjectAs<
const std::vector<o2::itsmft::Hit>*>(
"ITSHit");
79 LOG(error) <<
"ITS points not registered in the FairRootManager. Exiting ...";
97 mLineSegment =
new TH1D(
"lineSegment",
"Length of the line segment within the chip", 500, 0.0, 0.01);
98 mLocalX0 =
new TH1D(
"localX0",
"X position in local (chip) coordinates at the start of a hit", 5000, -2 * maxLengthX,
100 mLocalX1 =
new TH1D(
"localX1",
"X position in local (chip) coordinates at the end of a hit", 500, -0.005, 0.005);
101 mLocalY0 =
new TH1D(
"localY0",
"Y position in local (chip) coordinates at the start of a hit", 5000, -2 * maxLengthY,
103 mLocalY1 =
new TH1D(
"localY1",
"Y position in local (chip) coordinates at the end of a hit", 500, -0.005, 0.005);
104 mLocalZ0 =
new TH1D(
"localZ0",
"Z position in local (chip) coordinates at the start of a hit", 5000, 2 * maxLengthZ,
106 mLocalZ1 =
new TH1D(
"localZ1",
"Z position in local (chip) coordinates at the end of a hit", 500, -0.005, 0.005);
107 mHitCounter =
new TH1F(
"hitcounter",
"Simple hit counter", 1, 0.5, 1.5);
109 mIsInitialized = kTRUE;
115 if (!mIsInitialized) {
124 mHitCounter->Fill(1., mHits->size());
131 for (
auto& hit : *mHits) {
132 auto loc = mGeometry->
getMatrixL2G(hit.GetDetectorID()) ^ (hit.GetPos());
133 auto locS = mGeometry->
getMatrixL2G(hit.GetDetectorID()) ^ (hit.GetPosStart());
134 auto glo = mGeometry->
getMatrixL2G(hit.GetDetectorID())(loc);
135 auto gloS = mGeometry->
getMatrixL2G(hit.GetDetectorID())(locS);
136 mLocalX0->Fill(locS.X());
137 mLocalY0->Fill(locS.Y());
138 mLocalZ0->Fill(locS.Z());
139 loc.SetXYZ(loc.X() - locS.X(), loc.Y() - locS.Y(), loc.Z() - locS.Z());
140 mLocalX1->Fill(loc.X());
141 mLocalY1->Fill(loc.Y());
142 mLocalZ1->Fill(loc.Z());
148 if (!mIsInitialized) {
152 TFile* outfile = TFile::Open(
"hitanalysis.root",
"RECREATE");
154 mLineSegment->Write();
161 mHitCounter->Write();
General auxilliary methods.
Definition of the ITSMFT Hit class.
Definition of the GeometryTGeo class.
Definition of the SegmentationAlpide class.
const Mat3D & getMatrixL2G(int sensID) const
static GeometryTGeo * Instance()
void Build(int loadTrans=0) override
Exract ITS parameters from TGeo.
void fillMatrixCache(int mask) override
void FinishTask() override
void Exec(Option_t *option) override
InitStatus Init() override
static constexpr float SensorLayerThickness
static constexpr float SensorSizeCols
static constexpr float SensorSizeRows
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"