#include <SimG4CMS/Forward/interface/TotemNumberMerger.h>
Public Member Functions | |
unsigned long | Merge (unsigned long value1, unsigned long value2) const |
unsigned long | Merge (unsigned long value1, unsigned long value2, unsigned long value3) const |
unsigned long | Merge (unsigned long value1, unsigned long value2, unsigned long value3, unsigned long value4) const |
void | Split (unsigned long source, unsigned long &value1, unsigned long &value2, unsigned long &value3) const |
void | Split (unsigned long source, unsigned long &value1, unsigned long &value2, unsigned long &value3, unsigned long &value4) const |
void | Split (unsigned long source, unsigned long &value1, unsigned long &value2) const |
TotemNumberMerger () | |
~TotemNumberMerger () |
Description: Takes two integers and merges them together in only an integer! It's also possible the opposite operation.
Usage: Used in TotemOrganizations to get unique ID of sensitive detector element
Definition at line 29 of file TotemNumberMerger.h.
TotemNumberMerger::TotemNumberMerger | ( | ) |
Definition at line 23 of file TotemNumberMerger.cc.
References LogDebug.
{ #ifdef SCRIVI LogDebug("ForwardSim") << "Creating TotemNumberMerger"; #endif }
TotemNumberMerger::~TotemNumberMerger | ( | ) |
Definition at line 29 of file TotemNumberMerger.cc.
References LogDebug.
{ #ifdef SCRIVI LogDebug("ForwardSim") << "Destruction of TotemNumberMerger"; #endif }
unsigned long TotemNumberMerger::Merge | ( | unsigned long | value1, |
unsigned long | value2 | ||
) | const |
Definition at line 39 of file TotemNumberMerger.cc.
References trackerHits::c, LogDebug, query::result, and Split().
Referenced by TotemT1Organization::_FromDataToUnitID(), and Merge().
{ unsigned long c(value1+value2); unsigned long result(((c*(c+1))>>1)+value1); #ifdef SCRIVI LogDebug("ForwardSim") << "Merge(value1=" << value1 << ", value2=" << value2 << ")=" << result; unsigned long invValue1, invValue2; Split(result, invValue1, invValue2); assert(invValue1==value1); assert(invValue2==value2); #endif return result; }
unsigned long TotemNumberMerger::Merge | ( | unsigned long | value1, |
unsigned long | value2, | ||
unsigned long | value3 | ||
) | const |
Definition at line 59 of file TotemNumberMerger.cc.
References Merge().
unsigned long TotemNumberMerger::Merge | ( | unsigned long | value1, |
unsigned long | value2, | ||
unsigned long | value3, | ||
unsigned long | value4 | ||
) | const |
void TotemNumberMerger::Split | ( | unsigned long | source, |
unsigned long & | value1, | ||
unsigned long & | value2 | ||
) | const |
Definition at line 72 of file TotemNumberMerger.cc.
References trackerHits::c, LogDebug, and mathSSE::sqrt().
Referenced by TotemT1Organization::_FromUnitIDToData(), Merge(), and Split().
void TotemNumberMerger::Split | ( | unsigned long | source, |
unsigned long & | value1, | ||
unsigned long & | value2, | ||
unsigned long & | value3 | ||
) | const |
void TotemNumberMerger::Split | ( | unsigned long | source, |
unsigned long & | value1, | ||
unsigned long & | value2, | ||
unsigned long & | value3, | ||
unsigned long & | value4 | ||
) | const |