MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
RemixSim.hpp
Go to the documentation of this file.
1#ifndef REMIX_SIM_HPP
2#define REMIX_SIM_HPP
3
4#include "Paths.hpp"
5#include <Rtypes.h>
6#include <TString.h>
7#include <TSystem.h>
8#include <TTree.h>
9#include <algorithm>
10#include <fstream>
11#include <iostream>
12#include <string>
13#include <vector>
14
24class RemixSim {
25public:
33 struct SimFileSpec {
34 TString tag;
35 };
36
38 static TString ControlDir();
39
49 static TString TagFromControlFile(const TString &filepath);
50
58 static std::vector<SimFileSpec> BuildFileSpecs();
59
63 static TString TracesName(const SimFileSpec &s);
64
68 static TString SimRootPath(const SimFileSpec &s);
69
76 static Int_t ReactionStripOf(const TString &tag);
77
80 static TString TagWithoutStrip(const TString &tag);
81
91 struct Event {
92 Float_t left[16];
93 Float_t right[16];
94 Float_t strip0;
95 Float_t strip17;
96
97 Event();
98
104 Bool_t Attach(TTree *t);
105
107 Double_t Left(Int_t s) const;
109 Double_t Right(Int_t s) const;
111 Double_t Total(Int_t s) const { return Left(s) + Right(s); }
112 };
113
114private:
115 static Bool_t SimFileSpecTagLess(const SimFileSpec &a, const SimFileSpec &b);
116};
117
118#endif
Locating and naming the simulated data for a dataset's reactions.
Definition RemixSim.hpp:24
static TString TagFromControlFile(const TString &filepath)
Extract the simulation tag from a control file.
Definition RemixSim.cpp:45
static TString TracesName(const SimFileSpec &s)
On-disk basename, traces_<iso>_<tag>, with no directory or extension.
Definition RemixSim.cpp:109
static TString ControlDir()
Absolute path to the control directory, <dataset>/sim_control.
Definition RemixSim.cpp:43
static TString SimRootPath(const SimFileSpec &s)
Absolute path to a simulation's ROOT file.
Definition RemixSim.cpp:113
static Int_t ReactionStripOf(const TString &tag)
Which strip a simulated reaction occurs on.
Definition RemixSim.cpp:117
static TString TagWithoutStrip(const TString &tag)
The tag with any trailing _s<N> reaction-strip token removed.
Definition RemixSim.cpp:130
static std::vector< SimFileSpec > BuildFileSpecs()
Every simulation this dataset defines.
Definition RemixSim.cpp:70
Double_t Left(Int_t s) const
Left end of strip s (1-16), or the whole of strip 0 or 17.
Definition RemixSim.cpp:24
Float_t left[16]
Left end of strips 1-16, index strip - 1.
Definition RemixSim.hpp:92
Float_t strip17
Strip 17, unsegmented.
Definition RemixSim.hpp:95
Double_t Total(Int_t s) const
The strip's deposit, Left(s) + Right(s).
Definition RemixSim.hpp:111
Float_t right[16]
Right end of strips 1-16, index strip - 1.
Definition RemixSim.hpp:93
Bool_t Attach(TTree *t)
Bind to an events_MeV tree and set up the branch addresses.
Definition RemixSim.cpp:10
Float_t strip0
Strip 0, unsegmented.
Definition RemixSim.hpp:94
Double_t Right(Int_t s) const
Right end of strip s (1-16); zero for strips 0 and 17.
Definition RemixSim.cpp:32
One simulated dataset, identified by its tag.
Definition RemixSim.hpp:33
TString tag
Simulation tag, from the control file's output line.
Definition RemixSim.hpp:34