///////////// code for checking the basic things works in ALICE and also in PANDA of particles by shyam kumar #include "TGraphErrors.h" #include "TF3.h" #include "TRandom.h" #include "TCanvas.h" #include "TLegend.h" #include "TMath.h" void draw_Performance(Int_t nevent = -1) { gROOT->ForceStyle(); //==========Style of the plot============ //gStyle->SetPalette(1); gStyle->SetOptTitle(1); gStyle->SetTitleOffset(.85, "X"); gStyle->SetTitleOffset(.85, "Y"); gStyle->SetTitleSize(.04, "X"); gStyle->SetTitleSize(.04, "Y"); gStyle->SetLabelSize(.04, "X"); gStyle->SetLabelSize(.04, "Y"); gStyle->SetHistLineWidth(2); // gStyle->SetOptFit(1); gStyle->SetOptStat(0); //=======Reading the root file DD4HEP=========== TFile *file = new TFile("lumi3.edm4hep.root"); // Tree with tracks and hits // Create the tree reader and its data containers TTreeReader myReader("events", file); // name of tree and file TTreeReaderArray charge(myReader, "MCParticles.charge"); TTreeReaderArray vx_mc(myReader, "MCParticles.vertex.x"); TTreeReaderArray vy_mc(myReader, "MCParticles.vertex.y"); TTreeReaderArray vz_mc(myReader, "MCParticles.vertex.z"); TTreeReaderArray px_mc(myReader, "MCParticles.momentum.x"); TTreeReaderArray py_mc(myReader, "MCParticles.momentum.y"); TTreeReaderArray pz_mc(myReader, "MCParticles.momentum.z"); TTreeReaderArray status(myReader, "MCParticles.generatorStatus"); TTreeReaderArray pdg(myReader, "MCParticles.PDG"); TTreeReaderArray energy(myReader, "LumiDirectPCALHits.energy"); TTreeReaderArray posX(myReader, "LumiDirectPCALHits.position.x"); TTreeReaderArray posY(myReader, "LumiDirectPCALHits.position.y"); TTreeReaderArray posZ(myReader, "LumiDirectPCALHits.position.z"); auto hist3 = new TH3F("X:Y:Z", "Hit position 3D", 100, -50, 50, 100, -50, 50, 100, -66300, -66000); hist3->GetXaxis()->SetTitle("X (mm)"); hist3->GetYaxis()->SetTitle("Y (mm)"); hist3->GetZaxis()->SetTitle("Z (mm)"); hist3->GetXaxis()->SetLabelSize(0.02); hist3->GetYaxis()->SetLabelSize(0.02); hist3->GetZaxis()->SetLabelSize(0.015); hist3->GetXaxis()->SetTitleOffset(1.45); hist3->GetYaxis()->SetTitleOffset(1.45); hist3->GetZaxis()->SetTitleOffset(1.45); hist3->GetXaxis()->CenterTitle(); hist3->GetYaxis()->CenterTitle(); hist3->GetZaxis()->CenterTitle(); ////////////////////////////////////////////////////////////////////// int count = 0; while (myReader.Next()) { if (nevent > 0 && count > nevent) continue; // MC Particle for (int iParticle = 0; iParticle < charge.GetSize(); ++iParticle) { if (status[iParticle] == 1) { hist3->Fill(posX[iParticle], posY[iParticle], posZ[iParticle], energy[iParticle]); } } count++; } // c1->cd(1); // hist1->Draw(); //c2->cd(2); //hist2->Draw(); // c1->cd(1); hist3->Draw("LEGO2Z"); // c1->SaveAs("eicrecon_distr.png"); // c1->SaveAs("eicrecon_distr.pdf"); }