Class to define the identity of a source. A source, conceptually speaking, is the combination of a channel and a generator. This then defines where each pulse at every stage of the reconstruction chain has come from. Implemented by containing both a channelID and a generatorID. More...
#include <IdSource.h>
Public Member Functions | |
source () | |
source (const std::string &s) | |
Construct a source ID from a single string. | |
source (const IDs::channel &ch, const IDs::generator &gen) | |
Construct using a given channel and generator ID. | |
source (const std::string &det, const std::string &type, const std::string &gen, const std::string &cfg=IDs::kDefaultConfig) | |
source (Detector_t det, SlowFast_t type, const Generator_t &t, const Config_t &c=IDs::kDefaultConfig) | |
virtual | ~source () |
void | Reset () |
bool | operator== (const source &rhs) const |
Returns true if this source matches another. | |
bool | operator== (const generator &rhs) const |
bool | operator== (const channel &rhs) const |
Returns true if the channel part of this source matches another channel. | |
bool | matches (const source &rhs) const |
Returns true if this source matches another. | |
bool | matches (const generator &rhs) const |
Returns true if the generator part of this source matches another generator. | |
bool | matches (const channel &rhs) const |
Returns true if the channel part of this source matches another channel. | |
bool | operator> (const source &rhs) const |
Not intuitively meaningful but maybe useful for sorting. | |
bool | operator< (const source &rhs) const |
Not intuitively meaningful but maybe useful for sorting. | |
generator & | Generator () |
Get a reference to the generator ID in this source. | |
channel & | Channel () |
Get a reference to the channel ID in this source. | |
const generator & | Generator () const |
Get a const reference to the generator ID in this source. | |
const channel & | Channel () const |
Get a const reference to the channel ID in this source. | |
std::string | str (bool cpp_valid=false) const |
Returns the source as a string. | |
IDs::source & | operator= (const std::string &rhs) |
bool | isWildCardChannel () const |
Check if the Channel is a wildcard. | |
bool | isWildCardGenerator () const |
Check if the Generator is a wildcard. | |
bool | isWildCard () const |
bool | isFast () const |
Check if the Channel is fast. | |
bool | isSlow () const |
Check if the Channel is slow. | |
void | Debug () const |
Print the individual components of the source. | |
Private Member Functions | |
ClassDef (source, 1) | |
Private Attributes | |
channel | fChannel |
generator | fGenerator |
Class to define the identity of a source. A source, conceptually speaking, is the combination of a channel and a generator. This then defines where each pulse at every stage of the reconstruction chain has come from. Implemented by containing both a channelID and a generatorID.
Definition at line 20 of file IdSource.h.
IDs::source::source | ( | ) | [inline] |
Default constructor which just invokes default constructors for the Channel and generator.
Definition at line 24 of file IdSource.h.
Referenced by MakeDetectorPulses::ProcessEntry().
00025 : fChannel(),fGenerator() {};
IDs::source::source | ( | const std::string & | s | ) | [inline] |
Construct a source ID from a single string.
Equivalent to calling the defualt constructor following by operator=(std::string)
Definition at line 30 of file IdSource.h.
References operator=().
00031 : fChannel(),fGenerator() { 00032 operator=(s); 00033 };
IDs::source::source | ( | const IDs::channel & | ch, | |
const IDs::generator & | gen | |||
) | [inline] |
Construct using a given channel and generator ID.
Definition at line 36 of file IdSource.h.
00037 : fChannel(ch),fGenerator(gen){};
IDs::source::source | ( | const std::string & | det, | |
const std::string & | type, | |||
const std::string & | gen, | |||
const std::string & | cfg = IDs::kDefaultConfig | |||
) | [inline] |
Construct using strings for each argument of the contained generator and channel IDs.
det | The name of the detector used in this source | |
type | The type of timing filter (Slow / Fast) used in this source | |
gen | The type of generator used to analyse the channel | |
cfg | The generator's configuration |
Definition at line 46 of file IdSource.h.
00048 : fChannel(det,type), fGenerator(gen,cfg) {};
IDs::source::source | ( | Detector_t | det, | |
SlowFast_t | type, | |||
const Generator_t & | t, | |||
const Config_t & | c = IDs::kDefaultConfig | |||
) | [inline] |
Construct using enums for each argument of the contained generator and channel IDs.
det | The name of the detector used in this source | |
type | The type of timing filter (Slow / Fast) used in this source | |
gen | The type of generator used to analyse the channel | |
cfg | The generator's configuration |
Definition at line 57 of file IdSource.h.
00058 : fChannel(det,type),fGenerator(t,c){};
virtual IDs::source::~source | ( | ) | [inline, virtual] |
Definition at line 60 of file IdSource.h.
const channel& IDs::source::Channel | ( | ) | const [inline] |
channel& IDs::source::Channel | ( | ) | [inline] |
Get a reference to the channel ID in this source.
Definition at line 90 of file IdSource.h.
References fChannel.
Referenced by ExportPulse::AddToExportList(), PulseViewer::BeforeFirstEntry(), PlotTDP_TDiff::BeforeFirstEntry(), Debug(), TVAnalysedPulseGenerator::GetChannel(), PlotAmpVsMuScTDiff::GetHistogram(), isFast(), isSlow(), isWildCardChannel(), MakeDetectorPulses::MakeGenerator(), operator<(), operator=(), operator==(), operator>(), PulseViewer::PulseViewer(), TVDetectorPulseGenerator::SetChannel(), TVAnalysedPulseGenerator::SetChannel(), and SetupNavigator::SetCoarseTimeOffset().
00090 {return fChannel;};
IDs::source::ClassDef | ( | source | , | |
1 | ||||
) | [private] |
void IDs::source::Debug | ( | ) | const |
Print the individual components of the source.
Definition at line 31 of file IdSource.cpp.
References Channel(), IDs::generator::Debug(), IDs::channel::Debug(), and Generator().
const generator& IDs::source::Generator | ( | ) | const [inline] |
Get a const reference to the generator ID in this source.
Definition at line 93 of file IdSource.h.
References fGenerator.
00093 {return fGenerator;};
generator& IDs::source::Generator | ( | ) | [inline] |
Get a reference to the generator ID in this source.
Definition at line 87 of file IdSource.h.
References fGenerator.
Referenced by Debug(), SetupNavigator::GetCoarseTimeOffset(), TVDetectorPulseGenerator::GetGeneratorID(), MakeDetectorPulses::GetPassThruGeneratorID(), TAPGeneratorFactory::GetTAPType(), isWildCardGenerator(), MakeDetectorPulses::MakeGenerator(), operator<(), operator=(), operator==(), operator>(), SetupNavigator::SetCoarseTimeOffset(), TDetectorPulse::TDetectorPulse(), TVAnalysedPulseGenerator::TVAnalysedPulseGenerator(), and TVDetectorPulseGenerator::TVDetectorPulseGenerator().
00087 {return fGenerator;};
bool IDs::source::isFast | ( | ) | const [inline] |
Check if the Channel is fast.
Definition at line 116 of file IdSource.h.
References Channel(), and IDs::channel::isFast().
Referenced by MaxTimeDiffDPGenerator::ProcessPulses().
00116 {return Channel().isFast();};
bool IDs::source::isSlow | ( | ) | const [inline] |
Check if the Channel is slow.
Definition at line 119 of file IdSource.h.
References Channel(), and IDs::channel::isSlow().
Referenced by MaxTimeDiffDPGenerator::ProcessPulses().
00119 {return Channel().isSlow();};
bool IDs::source::isWildCard | ( | ) | const [inline] |
Check if this source ID is a wildcard (either Generator or Channel is a wildcard). User must interrogate further to find out which.
Definition at line 112 of file IdSource.h.
References isWildCardChannel(), and isWildCardGenerator().
00113 {return isWildCardChannel() || isWildCardGenerator();}
bool IDs::source::isWildCardChannel | ( | ) | const [inline] |
Check if the Channel is a wildcard.
Definition at line 104 of file IdSource.h.
References Channel(), and IDs::channel::isWildCard().
Referenced by FixedWindowMEGenerator::Init(), and isWildCard().
00104 {return Channel().isWildCard();}
bool IDs::source::isWildCardGenerator | ( | ) | const [inline] |
Check if the Generator is a wildcard.
Definition at line 107 of file IdSource.h.
References Generator(), and IDs::generator::isWildCard().
Referenced by isWildCard().
00107 {return Generator().isWildCard();}
bool IDs::source::matches | ( | const channel & | rhs | ) | const [inline] |
Returns true if the channel part of this source matches another channel.
Definition at line 79 of file IdSource.h.
References fChannel, and IDs::channel::matches().
00079 {return fChannel.matches(rhs);};
bool IDs::source::matches | ( | const generator & | rhs | ) | const [inline] |
Returns true if the generator part of this source matches another generator.
Definition at line 77 of file IdSource.h.
References fGenerator, and IDs::generator::matches().
00077 {return fGenerator.matches(rhs);};
bool IDs::source::matches | ( | const source & | rhs | ) | const [inline] |
Returns true if this source matches another.
Definition at line 135 of file IdSource.h.
References fChannel, fGenerator, IDs::channel::matches(), and IDs::generator::matches().
Referenced by SetupNavigator::GetCoarseTimeOffset().
00135 { 00136 return fGenerator.matches(rhs.fGenerator) && fChannel.matches(rhs.fChannel); 00137 }
bool IDs::source::operator< | ( | const source & | rhs | ) | const [inline] |
Not intuitively meaningful but maybe useful for sorting.
Definition at line 144 of file IdSource.h.
References Channel(), fChannel, fGenerator, and Generator().
00145 { 00146 return fChannel<rhs.Channel() || (fChannel==rhs.Channel() && fGenerator < rhs.Generator()); 00147 }
IDs::source & IDs::source::operator= | ( | const std::string & | rhs | ) |
Definition at line 18 of file IdSource.cpp.
References Channel(), IDs::field_separator, and Generator().
Referenced by source().
00018 { 00019 // Find the first delimiter 00020 size_t delim=rhs.find(IDs::field_separator.c_str()); 00021 if(delim==std::string::npos){ 00022 std::cout<<"Warning: Strange looking string given to IDs::source: "<<rhs<<std::endl; 00023 Channel()=rhs; 00024 } else{ 00025 Channel()=rhs.substr(0,delim); 00026 Generator()=rhs.substr(delim+1); 00027 } 00028 return *this; 00029 }
bool IDs::source::operator== | ( | const channel & | rhs | ) | const [inline] |
bool IDs::source::operator== | ( | const generator & | rhs | ) | const [inline] |
Returns true if the generator part of this source matches another generator
Definition at line 69 of file IdSource.h.
References fGenerator.
00069 {return fGenerator==rhs;};
bool IDs::source::operator== | ( | const source & | rhs | ) | const [inline] |
Returns true if this source matches another.
Definition at line 131 of file IdSource.h.
References Channel(), fChannel, fGenerator, and Generator().
00132 { 00133 return rhs.Generator()==fGenerator && rhs.Channel()==fChannel; 00134 }
bool IDs::source::operator> | ( | const source & | rhs | ) | const [inline] |
Not intuitively meaningful but maybe useful for sorting.
Definition at line 139 of file IdSource.h.
References Channel(), fChannel, fGenerator, and Generator().
00140 { 00141 return fChannel>rhs.Channel() || (fChannel==rhs.Channel() && fGenerator > rhs.Generator()); 00142 }
void IDs::source::Reset | ( | ) | [inline] |
Definition at line 62 of file IdSource.h.
References fChannel, fGenerator, IDs::generator::Reset(), and IDs::channel::Reset().
00062 {fChannel.Reset(); fGenerator.Reset();}
std::string IDs::source::str | ( | bool | cpp_valid = false |
) | const |
Returns the source as a string.
Definition at line 7 of file IdSource.cpp.
References fChannel, fGenerator, IDs::field_separator, IDs::generator::str(), IDs::channel::str(), and modules::parser::ToCppValid().
Referenced by PlotTDP_TDiff::BeforeFirstEntry(), PlotTAP_Integral::BeforeFirstEntry(), PlotIntegralRatios::BeforeFirstEntry(), SetupNavigator::GetCoarseTimeOffset(), PlotAmpVsMuScTDiff::GetHistogram(), MaxTimeDiffDPGenerator::ProcessPulses(), and IntegralRatioAPGenerator::ProcessPulses().
00007 { 00008 std::string tmp= fChannel.str() + IDs::field_separator +fGenerator.str(); 00009 if(cpp_safe) modules::parser::ToCppValid(tmp); 00010 return tmp; 00011 }
channel IDs::source::fChannel [private] |
Definition at line 125 of file IdSource.h.
Referenced by Channel(), matches(), operator<(), operator==(), operator>(), Reset(), and str().
generator IDs::source::fGenerator [private] |
Definition at line 126 of file IdSource.h.
Referenced by Generator(), matches(), operator<(), operator==(), operator>(), Reset(), and str().