19#include "EventAnalysisOrbit.hh"
20#include "RBDSException.hh"
21#include "SamplerAnalysis.hh"
41 bool perEntryAnalysis,
42 bool processSamplersIn,
45 double printModuloFraction,
46 bool emittanceOnTheFlyIn,
47 long int eventStartIn,
49 EventAnalysis(eventIn, chainIn, perEntryAnalysis, processSamplersIn,
50 debugIn, printOutIn, printModuloFraction, emittanceOnTheFlyIn,
51 eventStartIn, eventEndIn)
68 std::string errString =
"Orbit index: " + std::to_string(index) +
69 " greater than number of events: " + std::to_string(
entries) +
" in file minus one";
75 std::cout <<
"Getting orbit " << index << std::endl;
76 chain->GetEntry(index);
77 std::cout <<
"Loaded" << std::endl;
82 std::cout <<
"\rSampler #" << std::setw(6) << counter <<
" of " << nSamplers;
86 ss.push_back(s->s->S);
87 x.push_back(s->s->x[0]);
88 xp.push_back(s->s->xp[0]);
89 y.push_back(s->s->y[0]);
90 yp.push_back(s->s->yp[0]);
95 std::cout << std::endl;
101 TTree* orbitTree =
new TTree(
"Orbit",
"Orbit");
108 std::string delementName;
110 orbitTree->Branch(
"s", &dss,
"s/D");
111 orbitTree->Branch(
"x", &dx,
"x/D");
112 orbitTree->Branch(
"xp", &dxp,
"xp/D");
113 orbitTree->Branch(
"y", &dy,
"y/D");
114 orbitTree->Branch(
"yp", &dyp,
"yp/D");
115 orbitTree->Branch(
"elementName", &delementName);
117 for (
int i = 0; i < (int)
ss.size(); ++i)
long int entries
Number of entries in the chain.
Simple analysis to pull out first hit in each sampler.
std::vector< std::string > elementName
Temporary storage for orbit.
std::vector< double > y
Temporary storage for orbit.
std::vector< double > ss
Temporary storage for orbit.
std::vector< double > xp
Temporary storage for orbit.
void Clear()
Empty the member vectors of their data.
void ExtractOrbit(int index)
Extract an orbit from the data.
std::vector< double > x
Temporary storage for orbit.
std::vector< double > yp
Temporary storage for orbit.
void WriteOrbit(TFile *f)
Write orbit to a ROOT file.
std::vector< SamplerAnalysis * > samplerAnalyses
Holder for sampler analysis objects.
General exception with possible name of object and message.