43 if (fVal)
delete [] fVal;
177 if (!fGeneDir->IsOK() && !fPinDir->IsOK()) {
178 Info(
"Build",
"No data available to build pulser data tree");
205 datasetenv.
Form(
"KVINDRAPulserDataTree.%s", dirvar);
208 Error(
"GetDirectoryName",
"%s is not defined for dataset %s. Check .kvrootrc files.",
233 fArb =
new TTree(
"PulserData",
"Created by KVINDRAPulserDataTree");
234 fArb->SetDirectory(0);
236 fArb->Branch(
"Run", &fRun,
"Run/I");
247 TIter nxtACQ(acq_pars);
260 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
265 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
267 else if (ap_type !=
"T") {
271 fArb->Branch(ap_name.
Data(), &fVal[ap_num++],
Form(
"%s/F", ap_name.
Data()));
273 if (ap_num > fTab_siz - 2) {
275 "Number of branches to create is greater than estimated (%d). Not all parameters can be treated.",
297 if (!
line.BeginsWith(
"#")) {
319 if (fGeneDir->IsOK()) {
321 if (OpenGeneData(run,
f)) ReadFile(
f);
324 if (fPinDir->IsOK()) {
326 if (OpenPinData(run,
f)) ReadFile(
f);
347 fname.
Form(
"/run%d.gene", run);
374 fname.
Form(
"/run%d.genepin", run);
378 fname.
Form(
"/run%d.laserpin", run);
381 fname.
Form(
"/run%d.genelaserpin", run);
396 Error(
"ReadData",
"Must set list of runs first using SetRunList(TList*)");
399 Info(
"ReadData",
"Reading pulser and laser data for all runs");
400 TIter Nxt_r(fRunlist);
406 for (
int i = 0; i < fTab_siz; i++) fVal[i] = -1.0;
407 std::cout <<
"\rInfo in <KVINDRAPulserDataTree::ReadData>: Reading data for run " << run_num << std::flush;
408 UChar_t msg = ReadData(run_num);
409 if (msg & 1) missing1.
Add(run_num);
410 if (msg & 2) missing2.
Add(run_num);
412 std::cout << std::endl;
414 Warning(
"ReadData",
"Missing file 'run[run_num].gene' for runs: %s", missing1.
GetList());
416 Warning(
"ReadData",
"Missing file 'run[run_num].[gene][laser]pin' for runs: %s", missing2.
GetList());
431 fArb->SetBranchStatus(
"*", 0);
432 fArb->SetBranchStatus(
"Run", 1);
448 fArb->SetDirectory(
file);
449 fArb->BuildIndex(
"Run");
477 if (!fArb)
return -1.0;
480 TBranch* br = fArb->GetBranch(param);
483 Error(
"GetMean",
"No branch found with name %s", param);
487 fArb->SetBranchStatus(param, 1);
492 Int_t bytes = fArb->GetEntryWithIndex(run);
495 Error(
"GetMean",
"Unknown run %d", run);
499 fArb->SetBranchStatus(param, 0);
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
GANIL VXI/VME acquisition parameter.
Base class for KaliVeda framework.
virtual void SetNumber(UInt_t num)
const Char_t * GetType() const
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)
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 &)
const KVSeqCollection * GetACQParams() const
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)
virtual Int_t GetEntries() const
virtual const char * GetName() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)