Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavia Cetorelli committed Nov 16, 2023
1 parent 31894b0 commit fb93ff7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 48 deletions.
3 changes: 0 additions & 3 deletions SCEPCal_plots/ntuplizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 2 additions & 12 deletions SCEPCal_plots/simplePlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)



Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions analyzers/dataframe/FCCAnalyses/CaloNtupleizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@ ROOT::VecOps::RVec<float> getSimCaloHit_x (const ROOT::VecOps::RVec<edm4hep::Sim
ROOT::VecOps::RVec<float> getSimCaloHit_y (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<float> getSimCaloHit_z (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<float> getSimCaloHit_phi (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<int> getSimCaloHit_phiBin (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<float> getSimCaloHit_theta (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<float> getSimCaloHit_eta (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<int> getSimCaloHit_etaBin (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<int> getSimCaloHit_layer (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<int> getSimCaloHit_depth (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in,const int decodingVal);
ROOT::VecOps::RVec<float> getSimCaloHit_energy (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);
ROOT::VecOps::RVec<TVector3> getSimCaloHit_positionVector3 (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in);



// calo hits (single cells)
ROOT::VecOps::RVec<float> getCaloHit_x (const ROOT::VecOps::RVec<edm4hep::CalorimeterHitData>& in);
ROOT::VecOps::RVec<float> getCaloHit_y (const ROOT::VecOps::RVec<edm4hep::CalorimeterHitData>& in);
Expand Down
30 changes: 1 addition & 29 deletions analyzers/dataframe/src/CaloNtupleizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ ROOT::VecOps::RVec<float> getSimCaloHit_phi (const ROOT::VecOps::RVec<edm4hep::S
return result;
}

//ROOT::VecOps::RVec<int> getSimCaloHit_phiBin (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
// ROOT::VecOps::RVec<int> result;
// for (auto & p: in){
// dd4hep::DDSegmentation::CellID cellId = p.cellID;
// result.push_back(m_decoder->getSim(cellId, "phi"));
// }
// return result;
//}

ROOT::VecOps::RVec<float> getSimCaloHit_theta (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
ROOT::VecOps::RVec<float> result;
for (auto & p: in){
Expand All @@ -105,15 +96,6 @@ ROOT::VecOps::RVec<float> getSimCaloHit_eta (const ROOT::VecOps::RVec<edm4hep::S
return result;
}

//ROOT::VecOps::RVec<int> getSimCaloHit_etaBin (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
// ROOT::VecOps::RVec<int> result;
// for (auto & p: in){
// dd4hep::DDSegmentation::CellID cellId = p.cellID;
// result.push_back(m_decoder->get(cellId, "eta"));
// }
// return result;
//}

ROOT::VecOps::RVec<float> getSimCellID (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
ROOT::VecOps::RVec<int> result;
for (auto & p: in){
Expand All @@ -122,8 +104,6 @@ ROOT::VecOps::RVec<float> getSimCellID (const ROOT::VecOps::RVec<edm4hep::SimCal
return result;
}



ROOT::VecOps::RVec<float> getSimCaloHit_energy (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
ROOT::VecOps::RVec<float> result;
for (auto & p: in){
Expand All @@ -140,15 +120,6 @@ ROOT::VecOps::RVec<int> getSimCaloHit_depth (const ROOT::VecOps::RVec<edm4hep::S
return result;
}

ROOT::VecOps::RVec<int> getSimCaloHit_layer (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
ROOT::VecOps::RVec<int> result;
for (auto & p: in){
dd4hep::DDSegmentation::CellID cellId = p.cellID;
result.push_back(m_decoder->get(cellId, "layer"));
}
return result;
}

ROOT::VecOps::RVec<TVector3> getSimCaloHit_positionVector3 (const ROOT::VecOps::RVec<edm4hep::SimCalorimeterHitData>& in){
ROOT::VecOps::RVec<TVector3> result;
for (auto & p: in){
Expand All @@ -158,6 +129,7 @@ ROOT::VecOps::RVec<TVector3> getSimCaloHit_positionVector3 (const ROOT::VecOps::
}
return result;
}

// calo hit
ROOT::VecOps::RVec<float> getCaloHit_x (const ROOT::VecOps::RVec<edm4hep::CalorimeterHitData>& in){
ROOT::VecOps::RVec<float> result;
Expand Down

0 comments on commit fb93ff7

Please sign in to comment.