From fb93ff7cc6523bcd29b628a9c1c5b0033260ccc2 Mon Sep 17 00:00:00 2001 From: Flavia Cetorelli Date: Thu, 16 Nov 2023 18:07:59 +0100 Subject: [PATCH] minor fix --- SCEPCal_plots/ntuplizer.py | 3 -- SCEPCal_plots/simplePlotter.py | 14 ++------- .../dataframe/FCCAnalyses/CaloNtupleizer.h | 4 --- analyzers/dataframe/src/CaloNtupleizer.cc | 30 +------------------ 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/SCEPCal_plots/ntuplizer.py b/SCEPCal_plots/ntuplizer.py index f280f9a0e8..3a6f0d2b9e 100644 --- a/SCEPCal_plots/ntuplizer.py +++ b/SCEPCal_plots/ntuplizer.py @@ -10,9 +10,6 @@ _fcc = ROOT.dummyLoader ROOT.gInterpreter.Declare("using namespace FCCAnalyses;") -#to add layer info - not working -#ROOT.CaloNtupleizer.loadGeometry('/afs/cern.ch/work/f/fcetorel/private/work2/SCEPCAL/Detector/SCEPCAL/compact/SCEPCAL.xml', 'SCEPCALreadout') - #/afs/cern.ch/work/f/fcetorel/private/work2/SCEPCAL/SCEPCALsim/SCEPCALsimG4Components/test/data/ parser = argparse.ArgumentParser() diff --git a/SCEPCal_plots/simplePlotter.py b/SCEPCal_plots/simplePlotter.py index 02168a2723..f269aa092d 100755 --- a/SCEPCal_plots/simplePlotter.py +++ b/SCEPCal_plots/simplePlotter.py @@ -26,12 +26,10 @@ args = parser.parse_args() # input file should be flat ntupla from ntuplizer -#outdir = "/eos/user/f/fcetorel/www/SCEPCal_Sim/test_plots/newCommitsChecks/" -#inputfile = "flatNtupla_scepcal_100evs_newPull.root" outdir = args.outFolder inputfile = args.inputFile os.makedirs(outdir, exist_ok=True) -os.system("cp /eos/user/f/fcetorel/www/index.php %s"%outdir) +#os.system("cp /eos/user/f/fcetorel/www/index.php %s"%outdir) @@ -60,9 +58,6 @@ -#float S_F = gRandom->Poisson(eneF*LO)/this_ene; -# float S_R = gRandom->Poisson(eneR*LO)/this_ene; -# float S = S_F+S_R; c = ROOT.TCanvas("c","",800,600) #Get the En from the file @@ -92,10 +87,6 @@ myhistos2D["hTotEne_vs_eta"] = d.Histo2D (("hTotEne_vs_eta", ";#eta;Tot energy [GeV]", 100, -3.2, 3.2 , 1000, 0, pGunEnergy*1.25), "etaMaxHit" , "enetot") myhistos2D["hTotEne_vs_phi"] = d.Histo2D (("hTotEne_vs_phi", ";#Phi;Tot energy [GeV]", 100, -3.2, 3.2 , 1000, 0, pGunEnergy*1.25), "phiMaxHit" , "enetot" ) -myprofs = [] -#Define the profile -#myprofs.append(d.Profile1D(("hEne_vs_eta", "hEne_vs_eta", 100, -10, 10), "", "")) - ### Now drawing ROOT.gStyle.SetOptStat(1) @@ -138,7 +129,7 @@ ROOT.gStyle.SetOptStat(1) myhistos1D["hTotEne"].SetStats(1) -myhistos1D["hTotEne"].GetXaxis().SetRangeUser(pGunEnergy*0.6,pGunEnergy*1.1) +myhistos1D["hTotEne"].GetXaxis().SetRangeUser(pGunEnergy*0.7,pGunEnergy*1.1) myhistos1D["hTotEne"].Draw("") c.SetLogy(1) @@ -153,7 +144,6 @@ myhistos2D["hScatterMultiplicity"].SetStats(0) myhistos2D["hScatterMultiplicity"].GetXaxis().SetRangeUser(10, myhistos1D["hMultiplicityS"].GetMean()+ myhistos1D["hMultiplicityS"].GetRMS()*5) myhistos2D["hScatterMultiplicity"].GetYaxis().SetRangeUser(10, myhistos1D["hMultiplicityS"].GetMean()+ myhistos1D["hMultiplicityS"].GetRMS()*5) -#myhistos2D["hScatterMultiplicity"].GetYaxis().SetRangeUser(0, myhistos1D["hMultiplicityC"].GetMean()+ myhistos1D["hMultiplicityC"].GetRMS()*5) myhistos2D["hScatterMultiplicity"].Draw("COLZ") #c.SetLogz() c.SaveAs("%s/cSCEP_ScatterMultiplicity.png"%outdir) diff --git a/analyzers/dataframe/FCCAnalyses/CaloNtupleizer.h b/analyzers/dataframe/FCCAnalyses/CaloNtupleizer.h index 909b7ac70e..0a41b5d632 100644 --- a/analyzers/dataframe/FCCAnalyses/CaloNtupleizer.h +++ b/analyzers/dataframe/FCCAnalyses/CaloNtupleizer.h @@ -39,17 +39,13 @@ ROOT::VecOps::RVec getSimCaloHit_x (const ROOT::VecOps::RVec getSimCaloHit_y (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_z (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_phi (const ROOT::VecOps::RVec& in); -ROOT::VecOps::RVec getSimCaloHit_phiBin (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_theta (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_eta (const ROOT::VecOps::RVec& in); -ROOT::VecOps::RVec getSimCaloHit_etaBin (const ROOT::VecOps::RVec& in); -ROOT::VecOps::RVec getSimCaloHit_layer (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_depth (const ROOT::VecOps::RVec& in,const int decodingVal); ROOT::VecOps::RVec getSimCaloHit_energy (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getSimCaloHit_positionVector3 (const ROOT::VecOps::RVec& in); - // calo hits (single cells) ROOT::VecOps::RVec getCaloHit_x (const ROOT::VecOps::RVec& in); ROOT::VecOps::RVec getCaloHit_y (const ROOT::VecOps::RVec& in); diff --git a/analyzers/dataframe/src/CaloNtupleizer.cc b/analyzers/dataframe/src/CaloNtupleizer.cc index 14d5ad0769..8996c08e64 100644 --- a/analyzers/dataframe/src/CaloNtupleizer.cc +++ b/analyzers/dataframe/src/CaloNtupleizer.cc @@ -76,15 +76,6 @@ ROOT::VecOps::RVec getSimCaloHit_phi (const ROOT::VecOps::RVec getSimCaloHit_phiBin (const ROOT::VecOps::RVec& in){ -// ROOT::VecOps::RVec result; -// for (auto & p: in){ -// dd4hep::DDSegmentation::CellID cellId = p.cellID; -// result.push_back(m_decoder->getSim(cellId, "phi")); -// } -// return result; -//} - ROOT::VecOps::RVec getSimCaloHit_theta (const ROOT::VecOps::RVec& in){ ROOT::VecOps::RVec result; for (auto & p: in){ @@ -105,15 +96,6 @@ ROOT::VecOps::RVec getSimCaloHit_eta (const ROOT::VecOps::RVec getSimCaloHit_etaBin (const ROOT::VecOps::RVec& in){ -// ROOT::VecOps::RVec result; -// for (auto & p: in){ -// dd4hep::DDSegmentation::CellID cellId = p.cellID; -// result.push_back(m_decoder->get(cellId, "eta")); -// } -// return result; -//} - ROOT::VecOps::RVec getSimCellID (const ROOT::VecOps::RVec& in){ ROOT::VecOps::RVec result; for (auto & p: in){ @@ -122,8 +104,6 @@ ROOT::VecOps::RVec getSimCellID (const ROOT::VecOps::RVec getSimCaloHit_energy (const ROOT::VecOps::RVec& in){ ROOT::VecOps::RVec result; for (auto & p: in){ @@ -140,15 +120,6 @@ ROOT::VecOps::RVec getSimCaloHit_depth (const ROOT::VecOps::RVec getSimCaloHit_layer (const ROOT::VecOps::RVec& in){ - ROOT::VecOps::RVec result; - for (auto & p: in){ - dd4hep::DDSegmentation::CellID cellId = p.cellID; - result.push_back(m_decoder->get(cellId, "layer")); - } - return result; -} - ROOT::VecOps::RVec getSimCaloHit_positionVector3 (const ROOT::VecOps::RVec& in){ ROOT::VecOps::RVec result; for (auto & p: in){ @@ -158,6 +129,7 @@ ROOT::VecOps::RVec getSimCaloHit_positionVector3 (const ROOT::VecOps:: } return result; } + // calo hit ROOT::VecOps::RVec getCaloHit_x (const ROOT::VecOps::RVec& in){ ROOT::VecOps::RVec result;