10 #include "KVINDRAPulserDataTree.h"
11 #include "KVDataSet.h"
12 #include "KVINDRADBRun.h"
13 #include <KVEBYEDAT_ACQParam.h>
14 #include "KVMultiDetArray.h"
44 if (fVal)
delete [] fVal;
178 if (!fGeneDir->IsOK() && !fPinDir->IsOK()) {
179 Info(
"Build",
"No data available to build pulser data tree");
206 datasetenv.
Form(
"KVINDRAPulserDataTree.%s", dirvar);
209 Error(
"GetDirectoryName",
"%s is not defined for dataset %s. Check .kvrootrc files.",
234 fArb =
new TTree(
"PulserData",
"Created by KVINDRAPulserDataTree");
235 fArb->SetDirectory(0);
237 fArb->Branch(
"Run", &fRun,
"Run/I");
248 TIter nxtACQ(acq_pars);
261 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
266 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
268 else if (ap_type !=
"T") {
272 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
274 if (ap_num > fTab_siz - 2) {
276 "Number of branches to create is greater than estimated (%d). Not all parameters can be treated.",
298 if (!
line.BeginsWith(
"#")) {
320 if (fGeneDir->IsOK()) {
322 if (OpenGeneData(run,
f)) ReadFile(
f);
325 if (fPinDir->IsOK()) {
327 if (OpenPinData(run,
f)) ReadFile(
f);
348 fname.
Form(
"/run%d.gene", run);
375 fname.
Form(
"/run%d.genepin", run);
379 fname.
Form(
"/run%d.laserpin", run);
382 fname.
Form(
"/run%d.genelaserpin", run);
397 Error(
"ReadData",
"Must set list of runs first using SetRunList(TList*)");
400 Info(
"ReadData",
"Reading pulser and laser data for all runs");
401 TIter Nxt_r(fRunlist);
407 for (
int i = 0; i < fTab_siz; i++) fVal[i] = -1.0;
408 std::cout <<
"\rInfo in <KVINDRAPulserDataTree::ReadData>: Reading data for run " << run_num << std::flush;
409 UChar_t msg = ReadData(run_num);
410 if (msg & 1) missing1.
Add(run_num);
411 if (msg & 2) missing2.
Add(run_num);
413 std::cout << std::endl;
415 Warning(
"ReadData",
"Missing file 'run[run_num].gene' for runs: %s", missing1.
GetList());
417 Warning(
"ReadData",
"Missing file 'run[run_num].[gene][laser]pin' for runs: %s", missing2.
GetList());
432 fArb->SetBranchStatus(
"*", 0);
433 fArb->SetBranchStatus(
"Run", 1);
449 fArb->SetDirectory(
file);
450 fArb->BuildIndex(
"Run");
478 if (!fArb)
return -1.0;
481 TBranch* br = fArb->GetBranch(param);
484 Error(
"GetMean",
"No branch found with name %s", param);
488 fArb->SetBranchStatus(param, 1);
496 Error(
"GetMean",
"Unknown run %d", run);
500 fArb->SetBranchStatus(param, 0);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
virtual const Char_t * GetType() const
virtual void SetNumber(UInt_t num)
virtual Int_t GetNumber() const
const Char_t * GetDataSetDir() const
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Bool_t OpenDataSetFile(const Char_t *filename, std::ifstream &file)
GANIL VXI/VME 16 bit (maximum) EBYEDAT acquisition parameter.
Database entry for each run of an INDRA experiment.
Handles TTree with mean pulser data for every run.
void ReadFile(std::ifstream &)
Read data in one file.
Bool_t OpenGeneData(Int_t, std::ifstream &)
virtual ~KVINDRAPulserDataTree()
Destructor.
Float_t GetMean(const Char_t *, Int_t)
TString GetDirectoryName(const Char_t *)
void ReadData()
Read data for every run in dataset.
void ReadTree(TFile *)
Read pulser data tree from file.
Bool_t OpenPinData(Int_t, std::ifstream &)
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
Strings used to represent a set of ranges of values.
const Char_t * GetList() const
void Add(Int_t)
Add value 'n' to the list.
KaliVeda extensions to ROOT collection classes.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Handles directories stored in .tgz archive files.
virtual void SetAddress(void *add)
const char * GetName() const override
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)