NuFCSample Class Reference

#include <NuFCSample.h>

List of all members.

Public Member Functions

 NuFCSample ()
 Default constructor with zero-entry sample number.
 NuFCSample (Int_t num)
 Only allow initialisation with a direct number.
bool operator== (const NuFCSample &other) const
 Allow us to compare this to another sample.
bool operator!= (const NuFCSample &other) const
 Allow us to negatively compare to another sample.
 operator Sample::Sample_t () const
 Allow the sample to be converted into a direct integer.
TString GetName (void) const
 Retrieve a string name of the sample.

Private Attributes

Int_t fSample
 At the moment, a single ID identifies a sample.

Detailed Description

Class to represent a sample. Represents a particular sub-sample that an event might belong to. Replaces the old integer-based method (nearly transparently) to allow more complicated behaviour such as multi-sample events and immunity to certain systematics.

The intention is for this class to be extremely lightweight.

Should (almost) never need to be used in the front-end of CINT - this is probably a blessing because I don't know how well it would be able to deal with the type conversions.

Definition at line 21 of file NuFCSample.h.


Constructor & Destructor Documentation

NuFCSample::NuFCSample (  )  [inline]

Default constructor with zero-entry sample number.

Definition at line 28 of file NuFCSample.h.

00028 : fSample(0) {}

NuFCSample::NuFCSample ( Int_t  num  )  [inline]

Only allow initialisation with a direct number.

Definition at line 31 of file NuFCSample.h.

00031 : fSample(num) { }


Member Function Documentation

TString NuFCSample::GetName ( void   )  const

Retrieve a string name of the sample.

Definition at line 15 of file NuFCSample.cxx.

References fSample.

Referenced by NuFCEventManager::SampleName().

00016 {
00017   if (fSample == 1) return "kSignalPQ";
00018   if (fSample ==-1) return "kSignalNQ";
00019   if (fSample == 2) return "kWrongSignPQ";
00020   if (fSample ==-2) return "kWrongSignNQ";
00021   if (fSample == 3) return "kNCPQ";
00022   if (fSample ==-3) return "kNCNQ";
00023   if (fSample == 4) return "kTauPQ";
00024   if (fSample ==-4) return "kTauNQ";
00025   if (fSample == 5) return "kAppearedPQ";
00026   if (fSample == 6) return "kAppearedNQ";
00027   
00028   if (fSample == 0) return "UnknownSample";
00029   
00030   // If not one of these, they may be using a completely different scheme. abort.
00031   cout << "Unknown Sample: " << fSample << endl;
00032   assert(0);
00033 }

NuFCSample::operator Sample::Sample_t (  )  const [inline]

Allow the sample to be converted into a direct integer.

Definition at line 43 of file NuFCSample.h.

References fSample.

00043 { return static_cast<Sample::Sample_t>(fSample); }

bool NuFCSample::operator!= ( const NuFCSample other  )  const [inline]

Allow us to negatively compare to another sample.

Definition at line 38 of file NuFCSample.h.

00038                                                  {
00039     return !(*this == other);
00040   };

bool NuFCSample::operator== ( const NuFCSample other  )  const [inline]

Allow us to compare this to another sample.

Definition at line 34 of file NuFCSample.h.

References fSample.

00034                                                  {
00035     return fSample == other.fSample;
00036   }


Member Data Documentation

Int_t NuFCSample::fSample [private]

At the moment, a single ID identifies a sample.

Definition at line 24 of file NuFCSample.h.

Referenced by GetName(), operator Sample::Sample_t(), and operator==().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1