RestFrames
v1.0.1
RestFrames HEP Event Analysis Software Library
|
Go to the documentation of this file.
35 namespace RestFrames {
43 const std::string& stitle) :
46 m_Type = kCombinatoricGroup;
51 CombinatoricGroup::~CombinatoricGroup() {}
54 return CombinatoricGroup::m_Empty;
59 m_NElementsForFrame.clear();
60 m_NExclusiveElementsForFrame.clear();
75 m_NElementsForFrame[&frame] = 0;
76 m_NExclusiveElementsForFrame[&frame] =
true;
82 m_NElementsForFrame.erase(&frame);
83 m_NExclusiveElementsForFrame.erase(&frame);
88 int N,
bool exclusive_N){
97 m_NElementsForFrame[&frame] = std::max(0, N);
98 m_NExclusiveElementsForFrame[&frame] = exclusive_N;
102 bool& exclusive_N)
const {
105 N = m_NElementsForFrame[&frame];
106 exclusive_N = m_NExclusiveElementsForFrame[&frame];
116 std::string name =
GetName()+
"_parent";
122 CombinatoricState& CombinatoricGroup::GetParentState()
const {
124 return static_cast<CombinatoricState&
>(*m_GroupStatePtr);
129 CombinatoricState& CombinatoricGroup::GetChildState(
int i)
const {
130 if(!Group::GetChildState(i))
133 return static_cast<CombinatoricState&
>(Group::GetChildState(i));
137 bool CombinatoricGroup::ClearEvent(){
142 bool CombinatoricGroup::AnalyzeEvent(){
144 UnSoundMind(RF_FUNCTION);
145 return SetSpirit(
false);
151 return SetSpirit(
true);
158 TLorentzVector P = V;
159 if(P.M() < 0.) P.SetVectM(V.Vect(),0.);
164 m_Elements.Add(state);
181 int N = GetNChildStates();
182 for(
int i = N-1; i >= 0; i--)
183 if(GetChildState(i).ContainsElement(key))
189 TLorentzVector P(0.,0.,0.,0.);
190 int N = GetNChildStates();
191 for(
int i = N-1; i >= 0; i--)
192 if(GetChildState(i).ContainsElement(key))
194 return TLorentzVector(0.,0.,0.,0.);
199 return static_cast<CombinatoricState&
>(Group::GetChildState(frame)).GetNElements();
203 if(m_Elements.GetN() < m_InitStates.GetN())
204 return m_InitStates[m_Elements.GetN()];
206 sprintf(strn,
"%d",m_Elements.GetN()+1);
207 std::string name =
GetName()+
"_"+std::string(strn);
210 m_InitStates.Add(*statePtr);
214 CombinatoricGroup CombinatoricGroup::m_Empty;
virtual void Clear()
Clears CombinatoricGroup of all connections to other objects.
virtual void Clear()
Clears Group of all connections to other objects.
virtual void GetNElementsForFrame(const RestFrame &frame, int &N, bool &exclusive_N) const
Tells number of elements required for this frame.
static CombinatoricState & Empty()
Returns empty CombinatoricState.
bool IsRecoFrame() const
Is this an ReconstructionFrame ? (yes/no)
abstract base class for all Frame objects
abstract base class for all Group objects
bool IsEmpty() const
Checks whether this is default (empty) instance of class.
virtual void SetFourVector(const TLorentzVector &V)
Sets four-vector of this frame.
int GetNElementsInFrame(const RestFrame &frame) const
Returns number of elements in a frame.
CombinatoricGroup()
Empty constructor.
virtual TLorentzVector GetFourVector() const
Returns four vector of this frame.
virtual void RemoveFrame(RestFrame &frame)
Removes a frame (RestFrame) from this group.
virtual void AddJigsaw(Jigsaw &jigsaw)
Adds a jigsaw (Jigsaw) to current group.
RFKey AddLabFrameFourVector(const TLorentzVector &V, const RFCharge &charge=RFCharge())
Adds four-vector (TLorentzVector) in the lab frame.
RestFrame const & GetFrame(const RFKey &key) const
Returns frame (RestFrame) that contains key
RFKey GetKey() const
gets object identification key
int GetNFrames() const
Returns the number of frames (RestFrame) contained in this group.
void AddElements(const VisibleStateList &states)
Adds elements to this state.
void ClearElements()
Clears all elements associated with this state.
virtual void AddFrame(RestFrame &frame)
Adds a frame (RestFrame) to this group.
std::string GetName() const
Returns object name.
virtual void RemoveFrame(RestFrame &frame)
Removes a frame (RestFrame) from this combinatoric group.
virtual void AddJigsaw(Jigsaw &jigsaw)
Adds a jigsaw (Jigsaw) to this combinatoric group.
ConstRestFrameList const & GetListFrames() const
Returns list of frames (RestFrame) contained in this state.
static CombinatoricGroup & Empty()
Returns empty CombinatoricGroup.
TLorentzVector GetLabFrameFourVector(const RFKey &key) const
Returns lab frame's four-vector (TLorentzVector) of frame that contains key
bool IsVisibleFrame() const
Is this a VisibleFrame ? (yes/no)
virtual void SetCharge(const RFCharge &charge)
Sets charge of this state.
bool ContainsFrame(const RestFrame &frame) const
Is frame (RestFrame) contained in this group? (true/false)
abstract base class for all Jigsaw objects
bool IsCombinatoricJigsaw() const
Is combinatoric jigsaw? (true/false)
static RestFrame & Empty()
Returns empty RestFrame.
VisibleState const & GetElement(const RFKey &key) const
Returns element with key in this state.
void AddDependent(RFBase *dep)
pointer to RFBase object owned by this one
virtual void SetNElementsForFrame(const RestFrame &frame, int N, bool exclusive_N=false)
Assigns to frame a required min/max number of elements.
virtual void AddFrame(RestFrame &frame)
Adds a frame (RestFrame) to this combinatoric group.