Skip to content
Snippets Groups Projects

Part5 analysis docs

Merged Wouter Deconinck requested to merge wdconinc-master-patch-73409 into master
1 file
+ 31
2
Compare changes
  • Side-by-side
  • Inline
@@ -250,6 +250,35 @@ TNetXNGFile** root://sci-xrootd.jlab.org//osgpool/eic/ATHENA/RECO/SING
@@ -250,6 +250,35 @@ TNetXNGFile** root://sci-xrootd.jlab.org//osgpool/eic/ATHENA/RECO/SING
KEY: TTree events;1 Events tree
KEY: TTree events;1 Events tree
KEY: TTree metadata;1 Metadata tree
KEY: TTree metadata;1 Metadata tree
events->Draw("ReconstructedParticlesInitFromTruth.p.px")
events->Draw("ReconstructedParticlesInitFromTruth.p.px")
events->Draw("EcalBarrelClusters.energy")
events->Draw("EcalBarrelClusters.polar.phi:EcalBarrelClusters.polar.theta", "EcalBarrelClusters.edep", "colz")
events->Draw("EcalBarrelClusters.polar.theta:EcalBarrelClusters.polar.phi")
```
 
 
## Analysis of full simulation reconstruction output with RDataFrame commands
 
 
```console
 
auto momenta_from_reconstruction(const std::vector<eic::ReconstructedParticleData>& parts) {
 
std::vector<ROOT::Math::PxPyPzEVector> momenta{parts.size()};
 
std::transform(parts.begin(), parts.end(), momenta.begin(), [](const auto& part) {
 
return ROOT::Math::PxPyPzEVector{part.p.x, part.p.y, part.p.z, part.energy};
 
});
 
return momenta;
 
}
 
 
auto Q2(const std::vector<ROOT::Math::PxPyPzEVector>& mom) {
 
std::vector<double> Q2Vec(mom.size() );
 
ROOT::Math::PxPyPzEVector beamMom = {0, 0, 18, 18};
 
std::transform(mom.begin(), mom.end(), Q2Vec.begin(), [beamMom](const auto& part) {
 
return -(part - beamMom).M2();
 
});
 
return Q2Vec;
 
}
 
 
ROOT::RDataFrame d("events", "s3https://dtn01.sdcc.bnl.gov:9000/eictest/ATHENA/RECO/SINGLE/e-/1GeV/45to135deg/e-_1GeV_45to135deg.0001.root");
 
 
auto d0 = d.Define("p", momenta_from_reconstruction, {"ReconstructedParticles"}).Define("Q2", Q2, {"p"});
 
 
auto h_Q2_sim = d0.Histo1D({"h_Q2_sim", "; GeV; counts", 100, -5, 25}, "Q2");
 
auto& h1_Q2_sim = *h_Q2_sim;
 
h1_Q2_sim.DrawClone("hist");
 
```
```
Loading