Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct ChipSpecifics {
struct ITOFChipSpecifics : ChipSpecifics {
ITOFChipSpecifics()
{
NCols = 258;
NCols = 129;
NRows = 271;
PitchCol = 250.00e-4;
PitchRow = 100.00e-4;
Expand All @@ -53,11 +53,12 @@ struct ITOFChipSpecifics : ChipSpecifics {
struct OTOFChipSpecifics : ChipSpecifics {
OTOFChipSpecifics()
{
NCols = 517;
NCols = 125;
NRows = 243;
PitchCol = 250.00e-4;
PitchRow = 100.00e-4;
PassiveEdgeSide = 106.48e-4;
PassiveEdgeTop = 50.e-4;
PassiveEdgeSide = 115.8e-4;
SensorLayerThicknessEff = 50.e-4;
SensorLayerThickness = 50.e-4;
}
Expand Down
31 changes: 11 additions & 20 deletions Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
auto* gman = o2::iotof::GeometryTGeo::Instance();
gman->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G));

// IOTOF response plane y = half sensor thickness
float depthMax = iotofPars.sensorThickness; // fallback (no CCDB)
const float yPlaneIOTOF = depthMax / 2.;

// Hits
TFile* hitFile = TFile::Open(hitfile.data());
TTree* hitTree = (TTree*)hitFile->Get("o2sim");
Expand Down Expand Up @@ -162,7 +158,6 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
Int_t subDetID = gman->getIOTOFLayer(iDetID);

Float_t x = 0.f, y = 0.f, z = 0.f;
Float_t x_flat = 0.f, z_flat = 0.f;

// Float_t t = (*digArr)[iDigit].getTime();

Expand Down Expand Up @@ -207,13 +202,9 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
locHS.SetCoordinates(xyzLocS.X(), xyzLocS.Y(), xyzLocS.Z());
o2::math_utils::Vector3D<float> locHE; /// Hit, end pos
locHE.SetCoordinates(xyzLocE.X(), xyzLocE.Y(), xyzLocE.Z());
o2::math_utils::Vector3D<float> locHF;

// IOTOF: Interpolate to response plane
float x0 = locHS.X(), y0 = locHS.Y(), z0 = locHS.Z();
float dltx = locHE.X() - x0, dlty = locHE.Y() - y0, dltz = locHE.Z() - z0;
float r = (std::abs(dlty) > 1e-9f) ? (yPlaneIOTOF - y0) / dlty : 0.5f;
locH.SetCoordinates(x0 + r * dltx, yPlaneIOTOF, z0 + r * dltz);
// IOTOF: Interpolate to mid point
locH.SetCoordinates(0.5 * (locHS.X() + locHE.X()), 0.5 * (locHS.Y() + locHE.Y()), 0.5 * (locHS.Z() + locHE.Z()));

int row = 0, col = 0;
float xlc = 0., zlc = 0.;
Expand All @@ -226,7 +217,7 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
row, col, /// row and col retrieved from the hit: hit global position -> hit local position -> detector position (row, col)
locH.X(), locH.Z(), /// x and z of the hit in the local reference frame: hit global position -> hit local position
xlc, zlc, /// x and z of the hit in the local frame: hit global position -> hit local position -> detector position (row, col) -> local position
locHS.X() - locD.X(), locHS.Z() - locD.Z()); /// difference in x and z between the hit and the digit in the local frame
locH.X() - locD.X(), locH.Z() - locD.Z()); /// difference in x and z between the hit and the digit in the local frame
nt2->Fill(chipID, gloD.Z(), locHS.X() - locHE.X(), locHS.Z() - locHE.Z()); /// differences between local hit start and hit end positions

} // end loop on digits array
Expand All @@ -237,35 +228,35 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
auto canvXY = new TCanvas("canvXY", "", 1600, 800);
canvXY->Divide(2, 1);
canvXY->cd(1);
nt->Draw("y:x>>h_y_vs_x_IOTOF(1000, -100, 100, 1000, -100, 100)", "id >= 0 && id < 14352", "colz");
nt->Draw("y:x>>h_y_vs_x_IOTOF(1000, -100, 100, 1000, -100, 100)", "id >= 0 && id < 53568", "colz");
canvXY->cd(2);
nt->Draw("y:z>>h_y_vs_z_IOTOF(1000, -400, 400, 1000, -100, 100)", "id >= 0 && id < 14352", "colz");
nt->Draw("y:z>>h_y_vs_z_IOTOF(1000, -400, 400, 1000, -100, 100)", "id >= 0 && id < 53568", "colz");
canvXY->SaveAs("tf3digits_y_vs_x_vs_z.pdf");

// z distributions
auto canvZ = new TCanvas("canvZ", "", 800, 800);
canvZ->cd();
nt->Draw("z>>h_z_IOTOF(500, -70, 70)", "id >= 0 && id < 14352 ");
nt->Draw("z>>h_z_IOTOF(500, -70, 70)", "id >= 0 && id < 53568 ");
canvZ->SaveAs("tf3digits_z.pdf");

// dz distributions (difference between local position of digits and hits in x and z)
auto canvdZ = new TCanvas("canvdZ", "", 800, 800);
canvdZ->cd();
nt->Draw("dz>>h_dz_ML(500, -0.05, 0.05)", "id >= 0 && id < 14352 ");
nt->Draw("dz>>h_dz_ML(500, -0.05, 0.05)", "id >= 0 && id < 53568 ");
canvdZ->SaveAs("tf3digits_dz.pdf");
canvdZ->SaveAs("tf3digits_dz.root");

// distributions of differences between local positions of digits and hits in x and z
auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 800);
canvdXdZ->Divide(2, 1);
canvdXdZ->cd(1);
nt->Draw("dx:dz>>h_dx_vs_dz_ITOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 0 && id < 960", "colz");
nt->Draw("dx:dz>>h_dx_vs_dz_ITOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 0 && id < 1920", "colz");
addTLines(0.01);
auto h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ITOF");
Info("ITOF", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4);
Info("ITOF", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4);
canvdXdZ->cd(2);
nt->Draw("dx:dz>>h_dx_vs_dz_OTOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 960 && id < 14352", "colz");
nt->Draw("dx:dz>>h_dx_vs_dz_OTOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 1920 && id < 53568", "colz");
addTLines(0.01);
h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OTOF");
Info("OTOF", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4);
Expand All @@ -278,13 +269,13 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
canvdXdZHit->Divide(2, 1);
canvdXdZHit->cd(1);
LOG(info) << "dxH, dzH";
nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ITOF(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 0 && id < 960", "colz");
nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ITOF(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 0 && id < 1920", "colz");
addTLines(0.01);
h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ITOF");
Info("ITOF", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4);
Info("ITOF", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4);
canvdXdZHit->cd(2);
nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OTOF(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 960 && id < 14352", "colz");
nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OTOF(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 1920 && id < 53568", "colz");
addTLines(0.01);
h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OTOF");
Info("OTOF", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4);
Expand Down
10 changes: 5 additions & 5 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Layer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)
setStaveStyle(staveVol);

// Now we create the volume for a single module (sensor + chip)
const int modulesPerStaveX = 1; // we assume that each stave is divided in 2 modules along the x direction
const int modulesPerStaveX = 1; // we assume that each stave is divided in 1 modules along the x direction
const double moduleSizeX = staveSizeX / modulesPerStaveX; // cm
const double moduleSizeY = staveSizeY; // cm
const double moduleSizeZ = staveSizeZ / mModulesPerStave; // cm
Expand All @@ -188,7 +188,7 @@ void ITOFLayer::createLayer(TGeoVolume* motherVolume)

// Now we create the volume of the chip, which is the same for all modules
const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
const int chipsPerModuleZ = 4; // we assume that each module is divided in 2 chips along the z direction
const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
const double chipSizeY = moduleSizeY; // cm
const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
Expand Down Expand Up @@ -324,13 +324,13 @@ void OTOFLayer::createLayer(TGeoVolume* motherVolume)
setStaveStyle(staveVol);

// Now we create the volume for a single module (sensor + chip)
// oTOF V2 is a 2xN matrix of modules per stave with overlap along z.
// oTOF V2 is a 2xN matrix.
const int modulesPerStaveX = 2;
if (mModulesPerStave % modulesPerStaveX != 0) {
LOG(fatal) << "Invalid oTOF module layout: total modules per stave " << mModulesPerStave
<< " is not divisible by modulesPerStaveX=" << modulesPerStaveX;
}
const int modulesPerStaveZ = mModulesPerStave / modulesPerStaveX;
const int modulesPerStaveZ = 2 * mModulesPerStave / modulesPerStaveX;
const double moduleSizeX = staveSizeX / modulesPerStaveX;
const double moduleSizeY = staveSizeY;
const double moduleSizeZ = staveSizeZ / modulesPerStaveZ;
Expand All @@ -340,7 +340,7 @@ void OTOFLayer::createLayer(TGeoVolume* motherVolume)

// Now we create the volume of the chip, which is the same for all modules
const int chipsPerModuleX = 2; // we assume that each module is divided in 2 chips along the x direction
const int chipsPerModuleZ = 2; // we assume that each module is divided in 2 chips along the z direction
const int chipsPerModuleZ = 4; // we assume that each module is divided in 2 chips along the z direction
const double chipSizeX = moduleSizeX / chipsPerModuleX; // cm
const double chipSizeY = moduleSizeY; // cm
const double chipSizeZ = moduleSizeZ / chipsPerModuleZ; // cm
Expand Down
Loading