FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
RhoMomentumParticleSelector Class Reference

#include <RhoMomentumParticleSelector.h>

Inheritance diagram for RhoMomentumParticleSelector:
RhoParticleSelectorBase

Public Member Functions

 RhoMomentumParticleSelector (const char *name="RhoMomentumParticleSelector", Double_t cv=0, Double_t w=DBL_MAX, const char *type=0)
 
virtual ~RhoMomentumParticleSelector ()
 
virtual Bool_t Accept (RhoCandidate *b)
 
virtual Bool_t Accept (PndPidCandidate *b)
 
virtual void SetCriterion (const char *crit)
 
void SetCriterion (criterion crit)
 
void Select (RhoCandList &l)
 
void Select (RhoCandList &in, RhoCandList &out)
 

Protected Member Functions

TParticlePDG * CPConjugate (TParticlePDG *aPart)
 
void SetTypeAndMass (RhoCandidate *b)
 

Protected Attributes

TParticlePDG * fTypePlus
 
TParticlePDG * fTypeMinus
 Particle type to accept. More...
 
criterion fCriterion
 Particle type to accept. More...
 

Private Attributes

Double_t fCentralValue
 
Double_t fWindow
 

Detailed Description

Definition at line 28 of file RhoMomentumParticleSelector.h.

Constructor & Destructor Documentation

RhoMomentumParticleSelector::RhoMomentumParticleSelector ( const char *  name = "RhoMomentumParticleSelector",
Double_t  cv = 0,
Double_t  w = DBL_MAX,
const char *  type = 0 
)

Definition at line 31 of file RhoMomentumParticleSelector.cxx.

31  :
32  RhoParticleSelectorBase ( name,type ), fCentralValue ( cv ), fWindow ( 0.5*w )
33 {}
RhoParticleSelectorBase(const char *name="VAbsPidSelector", const char *type=0)
TString name
virtual RhoMomentumParticleSelector::~RhoMomentumParticleSelector ( )
inlinevirtual

Definition at line 35 of file RhoMomentumParticleSelector.h.

35 {}

Member Function Documentation

Bool_t RhoMomentumParticleSelector::Accept ( RhoCandidate b)
virtual

Implements RhoParticleSelectorBase.

Definition at line 35 of file RhoMomentumParticleSelector.cxx.

References fabs(), fCentralValue, fWindow, RhoCandidate::P(), and RhoParticleSelectorBase::SetTypeAndMass().

36 {
37  if ( b == 0 ) { return kFALSE; }
38  SetTypeAndMass ( b );
39  return ( fabs ( b->P()-fCentralValue ) <fWindow );
40 }
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void SetTypeAndMass(RhoCandidate *b)
Double_t P() const
Bool_t RhoMomentumParticleSelector::Accept ( PndPidCandidate b)
virtual

Implements RhoParticleSelectorBase.

Definition at line 42 of file RhoMomentumParticleSelector.cxx.

References fabs(), fCentralValue, fWindow, and PndPidCandidate::GetMomentum().

43 {
44  if ( b == 0 ) { return kFALSE; }
45  return ( fabs ( b->GetMomentum().Mag()-fCentralValue ) <fWindow );
46 }
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TVector3 GetMomentum() const
TParticlePDG * RhoParticleSelectorBase::CPConjugate ( TParticlePDG *  aPart)
protectedinherited

Definition at line 129 of file RhoParticleSelectorBase.cxx.

References name, and TString.

Referenced by RhoParticleSelectorBase::RhoParticleSelectorBase(), and PndAnaPidSelector::SetSelection().

130 {
131  // TDatabasePDG *pdt = TDatabasePDG::Instance();
132  TDatabasePDG* pdt = TDatabasePDG::Instance();
133  Int_t theCode = thePart->PdgCode();
134  TString name = thePart->GetName();
135 
136  // Is it a charged particle ?
137  if ( name.Index ( "-" ) >0 || name.Index ( "+" ) >0 || abs ( theCode ) ==2212 ) { theCode = -theCode; }
138 
139  return pdt->GetParticle ( theCode );
140 }
TString name
void RhoParticleSelectorBase::Select ( RhoCandList l)
inherited

Definition at line 94 of file RhoParticleSelectorBase.cxx.

References RhoCandList::Select().

95 {
96  l.Select(this);
97  // RhoCandList tmp ( l );
98  // Select ( tmp,l );
99 }
void Select(RhoParticleSelectorBase *pidmgr)
void RhoParticleSelectorBase::Select ( RhoCandList in,
RhoCandList out 
)
inherited

Definition at line 101 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::Accept(), c, RhoCandList::Cleanup(), RhoCandList::GetLength(), i, n, and RhoCandList::Put().

102 {
103  out.Cleanup();
104  Int_t n = in.GetLength();
105  for ( Int_t i=0; i<n; i++ ) {
106  RhoCandidate* c = in[i];
107 
108  if ( Accept ( c ) ) {
109  //printf("selector \"%s\" accepted i=%i\n",fName.Data(),i);
110  out.Put ( c );
111  } //else printf("selector \"%s\" rejected i=%i\n",fName.Data(),i);
112  }
113 }
void Cleanup()
Definition: RhoCandList.cxx:62
Int_t i
Definition: run_full.C:25
Int_t GetLength() const
Definition: RhoCandList.h:46
int n
virtual Bool_t Accept(RhoCandidate *)=0
void Put(const RhoCandidate *, Int_t i=-1)
Definition: RhoCandList.cxx:77
void RhoParticleSelectorBase::SetCriterion ( const char *  crit)
virtualinherited

Reimplemented in RhoGoodTrackSelector, RhoGoodPhotonSelector, and PndGoodTrackSelector.

Definition at line 61 of file RhoParticleSelectorBase.cxx.

References all, best, loose, tight, TString, variable, veryLoose, and veryTight.

Referenced by ClassImp(), PndSimpleAnalysis::Exec(), PndSimpleAnalysis::FillGenericLists(), PndPidListMaker::FillList(), PndAnalysisTaskExample::Init(), PndAnalysisTask::Init(), PndHypFullIdealAna::Init(), PndHypSimpleAna::Init(), PndHypFullAna::Init(), RhoGoodPhotonSelector::SetCriterion(), and PndAnaPidSelector::SetSelection().

62 {
63  TString crit ( c );
64  crit.ToLower();
65 
66  if ( crit=="best" ) {
67  SetCriterion ( best );
68  } else if ( crit=="veryloose" ) {
70  } else if ( crit=="loose" ) {
71  SetCriterion ( loose );
72  } else if ( crit=="tight" ) {
73  SetCriterion ( tight );
74  } else if ( crit=="verytight" ) {
76  } else if ( crit=="variable" ) {
78  } else if ( crit=="all" ) {
79  SetCriterion ( all );
80  } else {
81  cerr << GetName() << ": Unknown criterion " << crit.Data() << endl;
82  return;
83  }
84 
85 // fParms.Set("criteria",crit,"Selector criterion",this);
86  //cout << this->ClassName() << "::SetCriterion " << c << " for " << GetName() << endl;
87 }
virtual void SetCriterion(const char *crit)
void RhoParticleSelectorBase::SetCriterion ( criterion  crit)
inherited

Definition at line 89 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::fCriterion.

90 {
91  fCriterion = crit;
92 }
criterion fCriterion
Particle type to accept.
void RhoParticleSelectorBase::SetTypeAndMass ( RhoCandidate b)
protectedinherited

Definition at line 143 of file RhoParticleSelectorBase.cxx.

References RhoParticleSelectorBase::fTypeMinus, RhoParticleSelectorBase::fTypePlus, RhoCandidate::GetCharge(), RhoCandidate::SetMass(), and RhoCandidate::SetType().

Referenced by PndAnaPidSelector::Accept(), RhoGoodPhotonSelector::Accept(), RhoEnergyParticleSelector::Accept(), RhoSimpleMuonSelector::Accept(), RhoSimpleKaonSelector::Accept(), RhoSimpleElectronSelector::Accept(), RhoPlusParticleSelector::Accept(), RhoNeutralParticleSelector::Accept(), Accept(), RhoMinusParticleSelector::Accept(), RhoMassParticleSelector::Accept(), RhoSimpleProtonSelector::Accept(), and RhoSimplePionSelector::Accept().

144 {
145  if ( b == 0 ) { return; }
146  // Set the particle type
147  if ( b->GetCharge() >0.1 ) {
148  if ( fTypePlus == 0 ) { return; }
149  b->SetType ( fTypePlus );
150  b->SetMass ( fTypePlus->Mass() );
151  } else {
152  if ( fTypeMinus == 0 ) { return; }
153  b->SetType ( fTypeMinus );
154  b->SetMass ( fTypeMinus->Mass() );
155  }
156 }
Double_t GetCharge() const
Definition: RhoCandidate.h:183
TParticlePDG * fTypeMinus
Particle type to accept.
void SetType(const TParticlePDG *pdt)
void SetMass(Double_t mass)

Member Data Documentation

Double_t RhoMomentumParticleSelector::fCentralValue
private

Definition at line 42 of file RhoMomentumParticleSelector.h.

Referenced by Accept().

criterion RhoParticleSelectorBase::fCriterion
protectedinherited
TParticlePDG* RhoParticleSelectorBase::fTypeMinus
protectedinherited
TParticlePDG* RhoParticleSelectorBase::fTypePlus
protectedinherited
Double_t RhoMomentumParticleSelector::fWindow
private

Definition at line 42 of file RhoMomentumParticleSelector.h.

Referenced by Accept().


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