CbmRoot
Loading...
Searching...
No Matches
CbmCutMap Class Reference

Manages a map of cuts associated with their IDs. More...

#include <CbmCutMap.h>

Public Member Functions

 CbmCutMap ()=default
 
 ~CbmCutMap ()=default
 
std::unordered_map< CbmCutId, CbmCut< float > > GetMap () const
 Get the map of cuts.
 
CbmCut< float > * AddCbmCut (CbmCutId id)
 Add a new cut to the map.
 
bool Check (CbmCutId id, double value)
 Check if a value passes the cut with the given ID.
 
bool CheckStsHit (CbmStsHit *, TClonesArray *)
 Check if a CbmStsHit passes the cuts.
 
bool CheckEvent (CbmEvent *evt)
 Check if a CbmEvent passes the cuts.
 
void Print ()
 Print the cuts and failed pass counters.
 

Private Attributes

std::unordered_map< CbmCutId, CbmCut< float > > fCbmCuts
 
std::unordered_map< CbmCutId, unsigned long int > fFailedCounter
 

Friends

std::ostream & operator<< (std::ostream &out, const CbmCutMap &obj)
 Overloaded stream insertion operator for CbmCutMap.
 

Detailed Description

Manages a map of cuts associated with their IDs.

Definition at line 19 of file CbmCutMap.h.

Constructor & Destructor Documentation

◆ CbmCutMap()

CbmCutMap::CbmCutMap ( )
default

Referenced by operator<<.

◆ ~CbmCutMap()

CbmCutMap::~CbmCutMap ( )
default

Member Function Documentation

◆ AddCbmCut()

CbmCut< float > * CbmCutMap::AddCbmCut ( CbmCutId id)

Add a new cut to the map.

Parameters
idThe ID of the cut.
Returns
Pointer to the added CbmCut.

Definition at line 7 of file CbmCutMap.cxx.

References fCbmCuts.

◆ Check()

bool CbmCutMap::Check ( CbmCutId id,
double value )

Check if a value passes the cut with the given ID.

Parameters
idThe ID of the cut to check.
valueThe value to check against the cut.
Returns
True if the value passes the cut, false otherwise.

Definition at line 9 of file CbmCutMap.cxx.

References fCbmCuts, and fFailedCounter.

Referenced by CheckEvent(), and CheckStsHit().

◆ CheckEvent()

bool CbmCutMap::CheckEvent ( CbmEvent * evt)

Check if a CbmEvent passes the cuts.

Parameters
evtPointer to the CbmEvent to check.
Returns
True if the event passes the cuts, false otherwise.

Definition at line 36 of file CbmCutMap.cxx.

References Check(), CbmEvent::GetNofData(), kEventNofGlobalTrack, kEventNofMuchPixelHit, kEventNofMuchStrawHit, kEventNofMvdHit, kEventNofRichHit, kEventNofRichRing, kEventNofStsHit, kEventNofTofHit, kEventNofTrdHit, kGlobalTrack, kMuchPixelHit, kMuchStrawHit, kMvdHit, kRichHit, kRichRing, kStsHit, kTofHit, and kTrdHit.

◆ CheckStsHit()

bool CbmCutMap::CheckStsHit ( CbmStsHit * hit,
TClonesArray * clu_array = nullptr )

Check if a CbmStsHit passes the cuts.

Parameters
hitPointer to the CbmStsHit to check.
arrayPointer to the TClonesArray containing CbmStsCluster (for charge retrieving).
Returns
True if the hit passes the cuts, false otherwise.

Definition at line 20 of file CbmCutMap.cxx.

References Check(), cbm_sts_utils::GetHitCharge(), cbm_sts_utils::GetHitChargeAsy(), CbmHit::GetTime(), CbmPixelHit::GetX(), CbmPixelHit::GetY(), CbmHit::GetZ(), kStsHitCharge, kStsHitQasym, kStsHitTime, kStsHitX, kStsHitY, and kStsHitZ.

◆ GetMap()

std::unordered_map< CbmCutId, CbmCut< float > > CbmCutMap::GetMap ( ) const
inline

Get the map of cuts.

Returns
The map of cuts.

Definition at line 28 of file CbmCutMap.h.

References fCbmCuts.

Referenced by operator<<.

◆ Print()

void CbmCutMap::Print ( )
inline

Print the cuts and failed pass counters.

Definition at line 77 of file CbmCutMap.h.

References fCbmCuts, and fFailedCounter.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const CbmCutMap & obj )
friend

Overloaded stream insertion operator for CbmCutMap.

Parameters
outOutput stream.
objCbmCutMap object to output.
Returns
Reference to the output stream.

Definition at line 66 of file CbmCutMap.h.

References CbmCutMap(), GetMap(), and ToString().

Member Data Documentation

◆ fCbmCuts

std::unordered_map<CbmCutId, CbmCut<float> > CbmCutMap::fCbmCuts
private

Definition at line 85 of file CbmCutMap.h.

Referenced by AddCbmCut(), Check(), GetMap(), and Print().

◆ fFailedCounter

std::unordered_map<CbmCutId, unsigned long int> CbmCutMap::fFailedCounter
private

Definition at line 86 of file CbmCutMap.h.

Referenced by Check(), and Print().


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