musrfit 1.9.9
PFindRun.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PFindRun.h
4
5 Author: Andreas Suter
6 e-mail: andreas.suter@psi.ch
7
8***************************************************************************/
9
10/***************************************************************************
11 * Copyright (C) 2007-2025 by Andreas Suter *
12 * andreas.suter@psi.ch *
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29
30#ifndef _PFINDRUN_H_
31#define _PFINDRUN_H_
32
33#include "PMusr.h"
34
35//--------------------------------------------------------------------------
68class PFindRun {
69 public:
70 //----------------------------------------------------------------------
80 PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList);
81
82 //----------------------------------------------------------------------
97 PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList,
98 const TString &instrument, const UInt_t year, const UInt_t run, const TString file_format="");
99
100 //----------------------------------------------------------------------
119 Bool_t FoundPathName();
120
121 //----------------------------------------------------------------------
128 TString GetPathName() { return fPathName; }
129
130 //----------------------------------------------------------------------
137 void DumpTemplateList();
138
139 private:
142 TString fInstrument{""};
143 Int_t fYear{-1};
144 Int_t fRun{-1};
145 TString fFileFormat{""};
146 TString fPathName{""};
147
148 //----------------------------------------------------------------------
163 TString CreatePathName(const TString path, const TString runNameTemplate);
164};
165
166#endif // _PFINDRUN_H_
std::vector< PRunNameTemplate > PRunNameTemplateList
Definition PMusr.h:1441
std::vector< TString > PStringVector
Definition PMusr.h:403
Int_t fYear
Run year (-1 if not specified)
Definition PFindRun.h:143
TString fPathName
Resolved full path (empty until found)
Definition PFindRun.h:146
TString fInstrument
Target instrument name (e.g., "GPS", "LEM")
Definition PFindRun.h:142
void DumpTemplateList()
Debug utility - Prints current search configuration to stdout.
Definition PFindRun.cpp:69
const PStringVector fPath
Search paths for data files.
Definition PFindRun.h:140
Int_t fRun
Run number (-1 if not specified)
Definition PFindRun.h:144
TString fFileFormat
Optional file format filter (empty = any)
Definition PFindRun.h:145
Bool_t FoundPathName()
Searches for the run file using configured templates and paths.
Definition PFindRun.cpp:133
const PRunNameTemplateList fRunNameTemplateList
Template patterns per instrument.
Definition PFindRun.h:141
TString GetPathName()
Returns the full path to the found run file.
Definition PFindRun.h:128
TString CreatePathName(const TString path, const TString runNameTemplate)
Generates full file path by substituting template placeholders.
Definition PFindRun.cpp:89
PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList)
Default constructor - Creates instance without search parameters.
Definition PFindRun.cpp:40