PAASS
Software suite to Acquire and Analyze Data from Pixie16
DetectorLibrary Class Reference

A class to define a library of detectors known to the analysis. More...

#include <DetectorLibrary.hpp>

Inheritance diagram for DetectorLibrary:
Collaboration diagram for DetectorLibrary:

Public Types

typedef std::string mapkey_t
 typedef for a mapkey More...
 

Public Member Functions

virtual const_reference at (DetectorLibrary::size_type mod, DetectorLibrary::size_type ch) const
 
virtual const_reference at (DetectorLibrary::size_type idx) const
 
virtual reference at (DetectorLibrary::size_type mod, DetectorLibrary::size_type ch)
 
virtual reference at (DetectorLibrary::size_type idx)
 
virtual void push_back (const Identifier &x)
 
virtual ~DetectorLibrary ()
 
const std::set< int > & GetLocations (const Identifier &id) const
 
const std::set< int > & GetLocations (const std::string &type, const std::string &subtype) const
 
int GetNextLocation (const Identifier &id) const
 
int GetNextLocation (const std::string &type, const std::string &subtype) const
 
size_type GetIndex (int mod, int chan) const
 
int ModuleFromIndex (int index) const
 
int ChannelFromIndex (int index) const
 
unsigned int GetPhysicalModules () const
 
unsigned int GetModules () const
 
bool HasValue (int mod, int chan) const
 
bool HasValue (int index) const
 
void Set (int index, const Identifier &value)
 
void Set (int mod, int ch, const Identifier &value)
 
void PrintMap (void) const
 
void PrintUsedDetectors (RawEvent &rawev) const
 
const std::set< std::string > & GetKnownDetectors (void)
 
const std::set< std::string > & GetUsedDetectors (void) const
 

Static Public Member Functions

static DetectorLibraryget ()
 

Private Member Functions

 DetectorLibrary ()
 Default Constructor. More...
 
 DetectorLibrary (const DetectorLibrary &)
 Define the constructor with itself. More...
 
DetectorLibraryoperator= (DetectorLibrary const &)
 Define copy constructor. More...
 
void LoadXml ()
 
mapkey_t MakeKey (const std::string &type, const std::string &subtype) const
 

Private Attributes

std::map< mapkey_t, std::set< int > > locations
 collection of all used locations for a given type and subtype More...
 
unsigned int numModules
 number of modules More...
 
unsigned int numPhysicalModules
 number of physical modules More...
 
std::set< std::string > usedTypes
 used types More...
 
std::set< std::string > usedSubtypes
 used subtypes More...
 
std::set< std::string > knownDetectors
 known detectors in the analysis More...
 

Static Private Attributes

static DetectorLibraryinstance = NULL
 the static instance of the class More...
 
static std::set< int > emptyLocations
 dummy locations to return when map key does not exist More...
 

Detailed Description

A class to define a library of detectors known to the analysis.

Definition at line 20 of file DetectorLibrary.hpp.

Member Typedef Documentation

§ mapkey_t

typedef std::string DetectorLibrary::mapkey_t

typedef for a mapkey

Definition at line 124 of file DetectorLibrary.hpp.

Constructor & Destructor Documentation

§ ~DetectorLibrary()

DetectorLibrary::~DetectorLibrary ( )
virtual

Default destructor

Definition at line 293 of file DetectorLibrary.cpp.

§ DetectorLibrary() [1/2]

DetectorLibrary::DetectorLibrary ( )
private

Default Constructor.

Definition at line 32 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ DetectorLibrary() [2/2]

DetectorLibrary::DetectorLibrary ( const DetectorLibrary )
private

Define the constructor with itself.

Member Function Documentation

§ at() [1/4]

DetectorLibrary::const_reference DetectorLibrary::at ( DetectorLibrary::size_type  mod,
DetectorLibrary::size_type  ch 
) const
virtual

Defines the at operator for access via module and channel number (const)

Parameters
[in]mod: the module
[in]ch: the channel
Returns
a reference to the DetectorLibrary

Definition at line 150 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ at() [2/4]

DetectorLibrary::const_reference DetectorLibrary::at ( DetectorLibrary::size_type  idx) const
virtual

defines the at operator for using an id (const)

Parameters
[in]idx: the id to look for
Returns
a reference to the DetectorLibrary

Definition at line 146 of file DetectorLibrary.cpp.

§ at() [3/4]

DetectorLibrary::reference DetectorLibrary::at ( DetectorLibrary::size_type  mod,
DetectorLibrary::size_type  ch 
)
virtual

Defines the at operator for access via module and channel number

Parameters
[in]mod: the module
[in]ch: the channel
Returns
a reference to the DetectorLibrary

Definition at line 159 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ at() [4/4]

DetectorLibrary::reference DetectorLibrary::at ( DetectorLibrary::size_type  idx)
virtual

defines the at operator for using an id (const)

Parameters
[in]idx: the id to look for
Returns
a reference to the DetectorLibrary

Definition at line 155 of file DetectorLibrary.cpp.

§ ChannelFromIndex()

int DetectorLibrary::ChannelFromIndex ( int  index) const

Calculate channel number from the index

Parameters
[in]index: the index to convert
Returns
the channel calculated from the index

Definition at line 284 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ get()

DetectorLibrary * DetectorLibrary::get ( )
static
Returns
the only instance of the class

Definition at line 26 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ GetIndex()

DetectorLibrary::size_type DetectorLibrary::GetIndex ( int  mod,
int  chan 
) const

Get the index for a given module and channel

Parameters
[in]mod: the module number
[in]chan: the channel number
Returns
the index for a given module, channel

Definition at line 202 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ GetKnownDetectors()

const std::set<std::string>& DetectorLibrary::GetKnownDetectors ( void  )

Retrieves a vector containing all detector types for which an analysis routine has been defined making it possible to declare this detector type in the map.txt file. The currently known detector types are in detectorString

Returns
Get the detectors known to the analysis
Here is the caller graph for this function:

§ GetLocations() [1/2]

const set< int > & DetectorLibrary::GetLocations ( const Identifier id) const

Get the set of locations for the provided Identifier

Parameters
[in]id: The identifier to get the locations for
Returns
the set of locations for a given type, subtype

Definition at line 172 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ GetLocations() [2/2]

const set< int > & DetectorLibrary::GetLocations ( const std::string &  type,
const std::string &  subtype 
) const

Get the set of locations for the given type and subtype

Parameters
[in]type: the type to look for
[in]subtype: the subtype to look for
Returns
the set of locations for a given type, subtype

Definition at line 176 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ GetModules()

unsigned int DetectorLibrary::GetModules ( ) const
inline
Returns
the number of modules

Definition at line 90 of file DetectorLibrary.hpp.

Here is the call graph for this function:

§ GetNextLocation() [1/2]

int DetectorLibrary::GetNextLocation ( const Identifier id) const

Get the next undefined location of a given Identifier

Parameters
[in]id: The Identifier you want the the next location for
Returns
the id for the locaton

Definition at line 187 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ GetNextLocation() [2/2]

int DetectorLibrary::GetNextLocation ( const std::string &  type,
const std::string &  subtype 
) const

Get the next undefined location of a given type and subtype

Parameters
[in]type: the detector type
[in]subtype: the detector subtype
Returns
the id for the locaton

Definition at line 191 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ GetPhysicalModules()

unsigned int DetectorLibrary::GetPhysicalModules ( ) const
inline
Returns
the number of physical modules

Definition at line 88 of file DetectorLibrary.hpp.

Here is the caller graph for this function:

§ GetUsedDetectors()

const set< string > & DetectorLibrary::GetUsedDetectors ( void  ) const
Returns
the used detectors

Definition at line 276 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ HasValue() [1/2]

bool DetectorLibrary::HasValue ( int  mod,
int  chan 
) const

Check that the detector is in the list and kill if it's not

Parameters
[in]mod: the module number to check
[in]chan: the channel number to check
Returns
true if it has a value at the given mod,chan

Definition at line 206 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ HasValue() [2/2]

bool DetectorLibrary::HasValue ( int  index) const

Check if the Library has a value at a given index

Parameters
[in]index: the index to check for
Returns
true if it has a value at the given mod,chan

Definition at line 210 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ LoadXml()

void DetectorLibrary::LoadXml ( )
private

Load the XML configuration file

These attributes have reserved meaning, all other attributes of [Channel] are treated as tags

Create basic place for TreeCorrelator

Definition at line 46 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ MakeKey()

DetectorLibrary::mapkey_t DetectorLibrary::MakeKey ( const std::string &  type,
const std::string &  subtype 
) const
private

Make a unique map key for the given type,subtype

Parameters
[in]type: the type to make a key out of
[in]subtype: the subtype to make a key out of
Returns
the constructed map key

Definition at line 288 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ ModuleFromIndex()

int DetectorLibrary::ModuleFromIndex ( int  index) const

Calculate the module number from the index

Parameters
[in]index: the index to convert to module number
Returns
the module number

Definition at line 280 of file DetectorLibrary.cpp.

Here is the caller graph for this function:

§ operator=()

DetectorLibrary& DetectorLibrary::operator= ( DetectorLibrary const &  )
private

Define copy constructor.

§ PrintMap()

void DetectorLibrary::PrintMap ( void  ) const

Print out the map

Definition at line 241 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ PrintUsedDetectors()

void DetectorLibrary::PrintUsedDetectors ( RawEvent rawev) const

Print out the used detectors

Parameters
[in]rawev: the raw event to print from

Definition at line 253 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ push_back()

void DetectorLibrary::push_back ( const Identifier x)
virtual

Add an additional Identifier to the library

Parameters
[in]x: the Identifier to push back

Definition at line 165 of file DetectorLibrary.cpp.

Here is the call graph for this function:

§ Set() [1/2]

void DetectorLibrary::Set ( int  index,
const Identifier value 
)

Check that the detector is in the list and kill if it's not

Parameters
[in]index: the index to look for
[in]value: the value to check for

Definition at line 214 of file DetectorLibrary.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ Set() [2/2]

void DetectorLibrary::Set ( int  mod,
int  ch,
const Identifier value 
)

Check that the detector is in the list and kill if it's not

Parameters
[in]mod: the module number to check
[in]ch: the channel number to check
[in]value: the value to check for

Definition at line 237 of file DetectorLibrary.cpp.

Here is the call graph for this function:

Field Documentation

§ emptyLocations

set< int > DetectorLibrary::emptyLocations
staticprivate

dummy locations to return when map key does not exist

Definition at line 142 of file DetectorLibrary.hpp.

§ instance

DetectorLibrary * DetectorLibrary::instance = NULL
staticprivate

the static instance of the class

Definition at line 130 of file DetectorLibrary.hpp.

§ knownDetectors

std::set<std::string> DetectorLibrary::knownDetectors
private

known detectors in the analysis

Definition at line 149 of file DetectorLibrary.hpp.

§ locations

std::map< mapkey_t, std::set<int> > DetectorLibrary::locations
private

collection of all used locations for a given type and subtype

Definition at line 141 of file DetectorLibrary.hpp.

§ numModules

unsigned int DetectorLibrary::numModules
private

number of modules

Definition at line 144 of file DetectorLibrary.hpp.

§ numPhysicalModules

unsigned int DetectorLibrary::numPhysicalModules
private

number of physical modules

Definition at line 145 of file DetectorLibrary.hpp.

§ usedSubtypes

std::set<std::string> DetectorLibrary::usedSubtypes
private

used subtypes

Definition at line 148 of file DetectorLibrary.hpp.

§ usedTypes

std::set<std::string> DetectorLibrary::usedTypes
private

used types

Definition at line 147 of file DetectorLibrary.hpp.


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