musrfit 1.9.9
PRunListCollection.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PRunListCollection.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 _PRUNLISTCOLLECTION_H_
31#define _PRUNLISTCOLLECTION_H_
32
33#include <vector>
34
35#include "PMusr.h"
36#include "PMsrHandler.h"
37#include "PRunDataHandler.h"
38#include "PRunSingleHisto.h"
39#include "PRunSingleHistoRRF.h"
40#include "PRunAsymmetry.h"
41#include "PRunAsymmetryRRF.h"
42#include "PRunAsymmetryBNMR.h"
43#include "PRunMuMinus.h"
44#include "PRunNonMusr.h"
45
141{
142 public:
153 PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data, Bool_t theoAsdata=false);
154
161 virtual ~PRunListCollection();
162
171
191 virtual Bool_t Add(Int_t runNo, EPMusrHandleTag tag);
192
204 virtual void SetFitRange(const PDoublePairVector fitRange);
205
216 virtual void SetFitRange(const TString fitRange);
217
218 //--- Chi-square calculation methods (for global fits) ---
219
229 virtual Double_t GetSingleHistoChisq(const std::vector<Double_t>& par) const;
230
234 virtual Double_t GetSingleHistoRRFChisq(const std::vector<Double_t>& par) const;
235
239 virtual Double_t GetAsymmetryChisq(const std::vector<Double_t>& par) const;
240
244 virtual Double_t GetAsymmetryRRFChisq(const std::vector<Double_t>& par) const;
245
249 virtual Double_t GetAsymmetryBNMRChisq(const std::vector<Double_t>& par) const;
250
254 virtual Double_t GetMuMinusChisq(const std::vector<Double_t>& par) const;
255
259 virtual Double_t GetNonMusrChisq(const std::vector<Double_t>& par) const;
260
261 //--- Single run chi-square methods ---
262
273 virtual Double_t GetSingleRunChisqExpected(const std::vector<Double_t>& par, const UInt_t idx) const;
274
285 virtual Double_t GetSingleRunChisq(const std::vector<Double_t>& par, const UInt_t idx) const;
286
288
289
307 virtual Double_t GetSingleHistoMaximumLikelihood(const std::vector<Double_t>& par) const;
308
319 virtual Double_t GetSingleHistoRRFMaximumLikelihood(const std::vector<Double_t>& par) const;
320
331 virtual Double_t GetAsymmetryMaximumLikelihood(const std::vector<Double_t>& par) const;
332
342 virtual Double_t GetAsymmetryRRFMaximumLikelihood(const std::vector<Double_t>& par) const;
343
353 virtual Double_t GetAsymmetryBNMRMaximumLikelihood(const std::vector<Double_t>& par) const;
354
364 virtual Double_t GetMuMinusMaximumLikelihood(const std::vector<Double_t>& par) const;
365
375 virtual Double_t GetNonMusrMaximumLikelihood(const std::vector<Double_t>& par) const;
377
379
380
394 virtual Double_t GetSingleRunMaximumLikelihoodExpected(const std::vector<Double_t>& par, const UInt_t idx) const;
395
407 virtual Double_t GetSingleRunMaximumLikelihood(const std::vector<Double_t>& par, const UInt_t idx) const;
409
411
412
428 virtual UInt_t GetNoOfBinsFitted(const UInt_t idx) const;
429
445 virtual UInt_t GetTotalNoOfBinsFitted() const;
447
449
450
454 virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); }
455
460 virtual UInt_t GetNoOfSingleHistoRRF() const { return fRunSingleHistoRRFList.size(); }
461
466 virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); }
467
472 virtual UInt_t GetNoOfAsymmetryRRF() const { return fRunAsymmetryRRFList.size(); }
473
478 virtual UInt_t GetNoOfAsymmetryBNMR() const { return fRunAsymmetryBNMRList.size(); }
479
484 virtual UInt_t GetNoOfMuMinus() const { return fRunMuMinusList.size(); }
485
490 virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); }
492
494
495
509 virtual PRunData* GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex);
510
523 virtual PRunData* GetSingleHistoRRF(UInt_t index, EDataSwitch tag=kIndex);
524
537 virtual PRunData* GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex);
538
551 virtual PRunData* GetAsymmetryRRF(UInt_t index, EDataSwitch tag=kIndex);
552
565 virtual PRunData* GetAsymmetryBNMR(UInt_t index, EDataSwitch tag=kIndex);
566
579 virtual PRunData* GetMuMinus(UInt_t index, EDataSwitch tag=kIndex);
580
593 virtual PRunData* GetNonMusr(UInt_t index, EDataSwitch tag=kIndex);
595
597
598
610 virtual const PDoublePairVector *GetTemp(const TString &runName) const;
611
623 virtual Double_t GetField(const TString &runName) const;
624
636 virtual Double_t GetEnergy(const TString &runName) const;
637
649 virtual const Char_t* GetSetup(const TString &runName) const;
650
664 virtual const Char_t* GetXAxisTitle(const TString &runName, const UInt_t idx) const;
665
680 virtual const Char_t* GetYAxisTitle(const TString &runName, const UInt_t idx) const;
682
683 private:
695
706
717
727 std::vector<PRunSingleHisto*> fRunSingleHistoList;
728
737 std::vector<PRunSingleHistoRRF*> fRunSingleHistoRRFList;
738
747 std::vector<PRunAsymmetry*> fRunAsymmetryList;
748
757 std::vector<PRunAsymmetryRRF*> fRunAsymmetryRRFList;
758
767 std::vector<PRunAsymmetryBNMR*> fRunAsymmetryBNMRList;
768
777 std::vector<PRunMuMinus*> fRunMuMinusList;
778
787 std::vector<PRunNonMusr*> fRunNonMusrList;
788};
789
790#endif // _PRUNLISTCOLLECTION_H_
EPMusrHandleTag
Definition PMusr.h:413
std::vector< PDoublePair > PDoublePairVector
Definition PMusr.h:397
MSR file parser and manager for the musrfit framework.
Raw data file reader and format converter for μSR data.
virtual Double_t GetSingleRunMaximumLikelihood(const std::vector< Double_t > &par, const UInt_t idx) const
Calculates maximum likelihood for a single run.
virtual Double_t GetField(const TString &runName) const
Retrieves magnetic field value for a specific run.
virtual void SetFitRange(const PDoublePairVector fitRange)
Sets fit range for all runs (time-based or bin-based).
virtual PRunData * GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for a single histogram run.
virtual Double_t GetAsymmetryBNMRMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all β-NMR asymmetry runs.
virtual UInt_t GetNoOfMuMinus() const
Returns the number of μ⁻ runs in the collection.
std::vector< PRunNonMusr * > fRunNonMusrList
Collection of non-μSR run objects.
virtual UInt_t GetNoOfSingleHisto() const
Returns the number of single histogram runs in the collection.
virtual UInt_t GetNoOfAsymmetryRRF() const
Returns the number of asymmetry RRF runs in the collection.
virtual Double_t GetAsymmetryBNMRChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all β-NMR asymmetry runs.
virtual Double_t GetMuMinusMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all μ⁻ runs.
virtual PRunData * GetSingleHistoRRF(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for a single histogram RRF run.
virtual const Char_t * GetSetup(const TString &runName) const
Retrieves experimental setup identifier for a specific run.
virtual PRunData * GetNonMusr(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for a non-μSR run.
virtual const PDoublePairVector * GetTemp(const TString &runName) const
Retrieves temperature information for a specific run.
std::vector< PRunAsymmetry * > fRunAsymmetryList
Collection of asymmetry run objects.
virtual Double_t GetAsymmetryRRFMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all asymmetry RRF runs.
EDataSwitch
Enumeration for data access mode.
virtual UInt_t GetNoOfBinsFitted(const UInt_t idx) const
Returns the number of bins fitted for a specific run.
virtual ~PRunListCollection()
Virtual destructor that cleans up all run objects.
virtual const Char_t * GetXAxisTitle(const TString &runName, const UInt_t idx) const
Retrieves x-axis label for plotting.
std::vector< PRunAsymmetryRRF * > fRunAsymmetryRRFList
Collection of asymmetry RRF run objects.
std::vector< PRunMuMinus * > fRunMuMinusList
Collection of μ⁻ (negative muon) run objects.
virtual Double_t GetNonMusrChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all non-μSR runs.
virtual Double_t GetSingleHistoMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all single histogram runs.
virtual Double_t GetEnergy(const TString &runName) const
Retrieves beam energy for a specific run.
virtual Double_t GetSingleHistoChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all single histogram runs.
PRunDataHandler * fData
Pointer to raw data handler (not owned).
virtual Double_t GetSingleRunChisqExpected(const std::vector< Double_t > &par, const UInt_t idx) const
Calculates expected χ² for a single run by index.
virtual PRunData * GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for an asymmetry run.
std::vector< PRunSingleHistoRRF * > fRunSingleHistoRRFList
Collection of single histogram RRF run objects.
virtual UInt_t GetNoOfNonMusr() const
Returns the number of non-μSR runs in the collection.
virtual Double_t GetSingleRunChisq(const std::vector< Double_t > &par, const UInt_t idx) const
Calculates χ² for a single run by index.
virtual UInt_t GetNoOfAsymmetry() const
Returns the number of asymmetry runs in the collection.
virtual UInt_t GetNoOfAsymmetryBNMR() const
Returns the number of β-NMR asymmetry runs in the collection.
virtual Double_t GetAsymmetryRRFChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all asymmetry RRF runs.
virtual Double_t GetSingleHistoRRFMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all single histogram RRF runs.
virtual Double_t GetSingleHistoRRFChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all single histogram RRF runs.
std::vector< PRunAsymmetryBNMR * > fRunAsymmetryBNMRList
Collection of β-NMR asymmetry run objects.
PMsrHandler * fMsrInfo
Pointer to MSR file handler (not owned).
virtual const Char_t * GetYAxisTitle(const TString &runName, const UInt_t idx) const
Retrieves y-axis label for plotting.
virtual UInt_t GetNoOfSingleHistoRRF() const
Returns the number of single histogram RRF runs in the collection.
virtual Double_t GetAsymmetryChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all asymmetry runs.
virtual UInt_t GetTotalNoOfBinsFitted() const
Returns total number of bins fitted across all runs.
Bool_t fTheoAsData
Theory calculation mode flag.
virtual Double_t GetSingleRunMaximumLikelihoodExpected(const std::vector< Double_t > &par, const UInt_t idx) const
Calculates expected maximum likelihood for a single run (theoretical expectation).
virtual PRunData * GetMuMinus(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for a μ⁻ run.
virtual Double_t GetMuMinusChisq(const std::vector< Double_t > &par) const
Calculates total χ² for all mu-minus runs.
PRunListCollection(PMsrHandler *msrInfo, PRunDataHandler *data, Bool_t theoAsdata=false)
Constructor that initializes the collection.
virtual Double_t GetNonMusrMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all non-μSR runs.
std::vector< PRunSingleHisto * > fRunSingleHistoList
Collection of single histogram run objects.
virtual Double_t GetAsymmetryMaximumLikelihood(const std::vector< Double_t > &par) const
Calculates total maximum likelihood for all asymmetry runs.
virtual PRunData * GetAsymmetryRRF(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for an asymmetry RRF run.
virtual PRunData * GetAsymmetryBNMR(UInt_t index, EDataSwitch tag=kIndex)
Retrieves processed data for a β-NMR asymmetry run.
virtual Bool_t Add(Int_t runNo, EPMusrHandleTag tag)
Adds a run to the appropriate list based on fit type.