19#include "EventAnalysisOrbit.hh"
20#include "RBDSException.hh"
21#include "SamplerAnalysis.hh"
41 bool perEntryAnalysis,
42 bool processSamplersIn,
44 double printModuloFraction,
45 bool emittanceOnTheFlyIn,
46 long int eventStartIn,
48 EventAnalysis(eventIn, chainIn, perEntryAnalysis, processSamplersIn,
49 debugIn, printModuloFraction, emittanceOnTheFlyIn,
50 eventStartIn, eventEndIn)
67 std::string errString =
"Orbit index: " + std::to_string(index) +
68 " greater than number of events: " + std::to_string(
entries) +
" in file minus one";
74 std::cout <<
"Getting orbit " << index << std::endl;
75 chain->GetEntry(index);
76 std::cout <<
"Loaded" << std::endl;
81 std::cout <<
"\rSampler #" << std::setw(6) << counter <<
" of " << nSamplers;
85 ss.push_back(s->s->S);
86 x.push_back(s->s->x[0]);
87 xp.push_back(s->s->xp[0]);
88 y.push_back(s->s->y[0]);
89 yp.push_back(s->s->yp[0]);
94 std::cout << std::endl;
100 TTree* orbitTree =
new TTree(
"Orbit",
"Orbit");
107 std::string delementName;
109 orbitTree->Branch(
"s", &dss,
"s/D");
110 orbitTree->Branch(
"x", &dx,
"x/D");
111 orbitTree->Branch(
"xp", &dxp,
"xp/D");
112 orbitTree->Branch(
"y", &dy,
"y/D");
113 orbitTree->Branch(
"yp", &dyp,
"yp/D");
114 orbitTree->Branch(
"elementName", &delementName);
116 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.