采用 Steping 数据输出
采用 Steping 数据输出
采用Steping 数据输出
// 如何将多个 ROOT 文件 串起来处理,供参考
TChain *tree = new TCahin("t");//“t” 是 ROOT 文件中 TTree 的名字
// 采用通配符示例 1
tree->Add("*.root");
// 采用通配符示例 2
tree->Add("data*.root");
// 逐个文件添加
tree->Add("data0002_t0.root");
tree->Add("data0002_t1.root");
tree->Add("data0003_t0.root");
tree->Add("data0003_t1.root");
// tree->Process();
采用 Steping 数据输出
提示: 实际探测中,只能知道粒子打在哪个像素中,不能得到像素中的具体位置。因此数据处理中,计算角度时候,需要考虑这个因素!!!
(选作)
// 根据以下代码生成衰变位置在硅上的分布
{
TH2I *h2 = new TH2I("h2","",16, 0, 16, 16, 0, 16);
TH1I *h1 = new TH1I("h1","",400, 0, 40);
double gausx, gausy;
double dep;
for (int i = 0; i < 1000000; ++i)
{
gausx = gRandom->Gaus(10, 3);
gausy = gRandom->Gaus(8, 4);
if(gausx >=0 && gausx <= 16 && gausy >=0 && gausy <= 16)
h2->Fill(gausx, gausy);
dep = gRandom->Landau(8,10);
if(dep >= 0 && dep <= 40)
h1->Fill(dep);
}
TCanvas *c1 = new TCanvas("c1");
c1->Divide(2,1);
c1->cd(1);
h2->Draw("colz");
c1->cd(2);
h1->Draw();
TFile *filew = new TFile("dis.root","RECREATE");//"RECREATE" "READ"
if(!filew->IsOpen())
{
std::cout<<"Can't open root file"<<std::endl;
}
h2->Write();
h1->Write();
filew->Close();
}
采用 Steping 数据输出
采用 Steping 数据输出
# 数据库中 beta 衰变分支
BetaMinus 344.279 - 8.2466 1474.64
BetaMinus 755.3961 - 0.91363 1063.523
BetaMinus 930.545 - 0.28388 888.374
BetaMinus 1109.202 - 0.26389 709.717
BetaMinus 1123.186 - 13.734 695.7333
BetaMinus 1282.246 - 0.023191 536.673
BetaMinus 1318.414 - 0.018892 500.505
BetaMinus 1434.02 - 2.431 384.899
BetaMinus 1550.16 - 0.045581 268.759
BetaMinus 1605.609 - 0.10676 213.31
BetaMinus 1643.418 - 1.8323 175.501
BetaMinus 1692.42 - 0.019892 126.499
// wuDetectorConstruction.hh
G4LogicalVolume* logicBB30[3];
G4VPhysicalVolume* physBB30[3];
G4LogicalVolume* logicS13[2];
G4VPhysicalVolume* physS13[2];
// wuDetectorConstruction.cc
G4double BB30X = 64*mm;
G4double BB30Y = 96*mm;
G4double BB30Z = 300.0*um;
G4double S13R1 = 12.5*mm;
G4double S13R2 = 60.5*mm;
G4double S13Z = 300.0*um;
G4Box* solidBB30 =
new G4Box("BB30", //its name
0.5*BB30X, 0.5*BB30Y, 0.5*BB30Z); //its size
logicBB30[0] =
new G4LogicalVolume(solidBB30, //its solid
dssd_mat, //its material
"BB30_0"); //its name
logicBB30[1] =
new G4LogicalVolume(solidBB30, //its solid
dssd_mat, //its material
"BB30_1"); //its name
logicBB30[2] =
new G4LogicalVolume(solidBB30, //its solid
dssd_mat, //its material
"BB30_2"); //its name
G4RotationMatrix* rotbb30_0 = new G4RotationMatrix();
rotbb30_0->rotateY(90.0*deg);
G4RotationMatrix* rotbb30_1 = new G4RotationMatrix();
rotbb30_1->rotateY(90.0*deg);
G4RotationMatrix* rotbb30_2 = new G4RotationMatrix();
rotbb30_2->rotateY(90.0*deg);
rotbb30_2->rotateX(90.0*deg);
physBB30[0] =
new G4PVPlacement(rotbb30_0, //no rotation set 0
G4ThreeVector(6.5*cm,0.0,0.0), //at (0,0,0)
logicBB30[0], //its logical volume
"BB30_0", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
physBB30[1] =
new G4PVPlacement(rotbb30_1, //no rotation set 0
G4ThreeVector(-6.5*cm,0.0,0.0), //at (0,0,0)
logicBB30[1], //its logical volume
"BB30_1", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
physBB30[2] =
new G4PVPlacement(rotbb30_2, //no rotation set 0
G4ThreeVector(0.0,6.5*cm,0.0), //at (0,0,0)
logicBB30[2], //its logical volume
"BB30_2", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
G4Tubs* solidS13 =
new G4Tubs("S13",
S13R1,//内半径
S13R2,//外半径
0.5*S13Z,//Z轴方向的半长度
0*degree,//圆周起始位置弧度值
360*degree);//该实体的圆心角弧度值
logicS13[0] =
new G4LogicalVolume(solidS13, //its solid
dssd_mat, //its material
"S13_0"); //its name
logicS13[1] =
new G4LogicalVolume(solidS13, //its solid
dssd_mat, //its material
"S13_1"); //its name
physS13[0] =
new G4PVPlacement(0, //no rotation set 0
G4ThreeVector(0.0,0.0,-5.0*cm), //at (0,0,0)
logicS13[0], //its logical volume
"S13_0", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
physS13[1] =
new G4PVPlacement(0, //no rotation set 0
G4ThreeVector(0.0,0.0,5.0*cm), //at (0,0,0)
logicS13[1], //its logical volume
"S13_1", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
征集示例需求
!date
!jupyter nbconvert homework.ipynb --to html
!jupyter nbconvert homework.ipynb --to html
2024年 05月 03日 星期五 19:26:22 CST [NbConvertApp] Converting notebook homework.ipynb to html [NbConvertApp] Writing 599885 bytes to homework.html [NbConvertApp] Converting notebook homework.ipynb to html [NbConvertApp] Writing 599885 bytes to homework.html