22 for(
auto const& det: detectors) {
26 TText *vol =
new TText(.1, .95, sVol.c_str());
29 TCanvas *c1 =
new TCanvas(
"c1",
"mat_X0",1200,1200);
30 c1->SetRightMargin(0.14);
31 c1->SetTopMargin(0.14);
32 c1->SetLeftMargin(0.14);
33 c1->SetBottomMargin(0.14);
36 c1->Print( (name+
"X0.pdf").c_str());
38 TH2F *Unit_Map = (TH2F*) Map[2]->Clone();
39 Unit_Map->Divide(Map[2]);
40 TCanvas *
c2 =
new TCanvas(
"c2",
"mat_X0/eta", 1200, 1200);
41 c2->SetRightMargin(0.14);
42 c2->SetTopMargin(0.14);
43 c2->SetLeftMargin(0.14);
44 c2->SetBottomMargin(0.14);
45 TH1D *Proj_eta = Map[0]->ProjectionX();
46 Proj_eta->Divide(Unit_Map->ProjectionX());
47 Proj_eta->GetYaxis()->SetTitle(
"X0");
48 Proj_eta->SetMarkerStyle(7);
49 Proj_eta->Draw(
"HIST PC");
50 c2->Print( (name+
"X0_eta.pdf").c_str());
51 TCanvas *c3 =
new TCanvas(
"c3",
"mat_X0/phi", 1200, 1200);
52 c3->SetRightMargin(0.14);
53 c3->SetTopMargin(0.14);
54 c3->SetLeftMargin(0.14);
55 c3->SetBottomMargin(0.14);
56 TH1D *Proj_phi = Map[0]->ProjectionY();
57 Proj_phi->Divide(Unit_Map->ProjectionY());
58 Proj_phi->GetYaxis()->SetTitle(
"X0");
59 Proj_phi->SetMarkerStyle(7);
60 Proj_phi->Draw(
"HIST PC");
61 c3->Print( (name+
"X0_phi.pdf").c_str());
79 Map_X0 =
new TH2F(
"Map_X0_detector",
"Map_X0_detector",
80 100,-4,4,50,-3.2,3.2);
81 Map_L0 =
new TH2F(
"Map_L0_detector",
"Map_L0_detector",
82 100,-4,4,50,-3.2,3.2);
83 Map_scale =
new TH2F(
"Map_Scale_detector",
"Map_Scale_detector",
84 100,-4,4,50,-3.2,3.2);
85 Map_X0->GetXaxis()->SetTitle(
"Eta");
86 Map_X0->GetYaxis()->SetTitle(
"Phi");
87 Map_X0->GetZaxis()->SetTitle(
"X0");
88 Map_L0->GetXaxis()->SetTitle(
"Eta");
89 Map_L0->GetYaxis()->SetTitle(
"Phi");
90 Map_L0->GetZaxis()->SetTitle(
"L0");
91 std::vector<TH2F*> v_hist;
92 v_hist.push_back(Map_X0);
93 v_hist.push_back(Map_L0);
94 v_hist.push_back(Map_scale);
95 detector_hist = v_hist;
106 TFile *
tfile =
new TFile(input_file.c_str());
107 TTree *
tree = (TTree*)tfile->Get(
"material-tracks");
112 std::vector<float> *mat_X0 = 0;
113 std::vector<float> *mat_L0 = 0;
114 std::vector<float> *mat_step_length = 0;
116 std::vector<uint64_t> *sur_id = 0;
117 std::vector<int32_t> *sur_type = 0;
119 std::vector<uint64_t> *vol_id = 0;
121 tree->SetBranchAddress(
"v_phi",&v_phi);
122 tree->SetBranchAddress(
"v_eta",&v_eta);
123 tree->SetBranchAddress(
"t_X0",&t_X0);
124 tree->SetBranchAddress(
"mat_X0",&mat_X0);
125 tree->SetBranchAddress(
"mat_L0",&mat_L0);
126 tree->SetBranchAddress(
"mat_step_length",&mat_step_length);
128 tree->SetBranchAddress(
"sur_id",&sur_id);
129 tree->SetBranchAddress(
"sur_type",&sur_type);
131 tree->SetBranchAddress(
"vol_id",&vol_id);
133 int nentries = tree->GetEntries();
134 if(nentries > nbprocess && nbprocess != -1) nentries = nbprocess;
136 for (Long64_t
i=0;
i<nentries;
i++) {
137 if(
i%10000==0) std::cout <<
"processed " <<
i <<
" events out of " << nentries << std::endl;
144 for(
int j=0;
j<mat_X0->size();
j++ ){
148 if(sur_id->at(
j) != 0){
151 else if(vol_id->at(
j) != 0){
156 if(std::find(detectors.begin(), detectors.end(), ID.
volume()) != detectors.end()) {
157 matX0 += mat_step_length->at(
j) / mat_X0->at(
j);
158 matL0 += mat_step_length->at(
j) / mat_L0->at(
j);
162 if (matX0 != 0 && matL0 != 0){
163 detector_hist[0]->Fill(v_eta, v_phi, matX0);
164 detector_hist[1]->Fill(v_eta, v_phi, matL0);
165 detector_hist[2]->Fill(v_eta, v_phi);
168 detector_hist[0]->Divide(detector_hist[2]);
169 detector_hist[1]->Divide(detector_hist[2]);
178 std::vector<int>
detectors = vector<int>(),
int nbprocess = -1,
180 gStyle->SetOptStat(0);
181 gStyle->SetOptTitle(0);
183 std::vector<TH2F*> detector_hist;