FairRoot/PandaRoot
RhoVertexSelectorBase.cxx
Go to the documentation of this file.
1 // //
3 // RhoVertexSelectorBase //
4 // //
5 // Abstract Selector classes for vertexing //
6 // //
7 // Author: Marcel Kunze, RUB, July 99 //
8 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
9 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
10 // //
12 
14 #include "RhoBase/RhoCandidate.h"
15 #include "RhoBase/RhoCandList.h"
16 
18 
19 #include <iostream>
20 using namespace std;
21 
23  TNamed ( name,name ),
24  fDoca ( 1.0 ), fVtxip ( 3.14159265358979323846 ), fRmin ( 0.0 ), fRmax ( 1.E8 ), fPrimaryVertex ( 0.,0.,0. )
25 {
26 }
27 
29 {
30 }
31 
33 {
34  TLorentzVector vl;
35  Double_t charge;
36  Bool_t nearby = kTRUE;
37  //fEntries = 0;
38  //end of unlock
39  Int_t endpos1 = l1.GetLength();
40  Int_t endpos2 = l2.GetLength();
41  out.Cleanup();
42 
43  if ( &l1==&l2 ) {
44  //combination of a list with itself
45  for ( Int_t comb_i=0; comb_i<endpos1; ++comb_i ) {
46  for ( Int_t comb_k=comb_i+1; comb_k<endpos2; ++comb_k ) {
47  if ( !l1[comb_i]->Overlaps ( l2[comb_k] ) ) {
48  vl=l1[comb_i]->P4() +l2[comb_k]->P4();
49  charge=l1[comb_i]->Charge() +l2[comb_k]->Charge();
50  nearby = Accept ( l1[comb_i],l2[comb_k] );
51  if ( nearby ) {
52  //fill list with new candidate
53  RhoCandidate c ( vl,charge );
54  c.SetMarker ( l1[comb_i]->GetMarker ( 0 ) |l2[comb_k]->GetMarker ( 0 ),0 );
55  c.SetMarker ( l1[comb_i]->GetMarker ( 1 ) |l2[comb_k]->GetMarker ( 1 ),1 );
56  c.SetMarker ( l1[comb_i]->GetMarker ( 2 ) |l2[comb_k]->GetMarker ( 2 ),2 );
57  c.SetMarker ( l1[comb_i]->GetMarker ( 3 ) |l2[comb_k]->GetMarker ( 3 ),3 );
58  c.SetPosition ( GetVertex() );
59  c.SetVect ( GetMomentum() );
60  c.SetE ( c.E() );
61  out.Put ( &c );
62  }
63  }
64  }
65  }
66  } else {
67  //combination of 2 different lists
68  for ( Int_t comb_i=0; comb_i<endpos1; ++comb_i ) {
69  for ( Int_t comb_k=0; comb_k<endpos2; ++comb_k ) {
70  if ( !l1[comb_i]->Overlaps ( l2[comb_k] ) ) {
71  vl=l1[comb_i]->P4() +l2[comb_k]->P4();
72  charge=l1[comb_i]->Charge() +l2[comb_k]->Charge();
73  nearby = Accept ( l1[comb_i],l2[comb_k] );
74  if ( nearby ) {
75  //fill list with new candidate
76  RhoCandidate c ( vl,charge );
77  c.SetMarker ( l1[comb_i]->GetMarker ( 0 ) |l2[comb_k]->GetMarker ( 0 ),0 );
78  c.SetMarker ( l1[comb_i]->GetMarker ( 1 ) |l2[comb_k]->GetMarker ( 1 ),1 );
79  c.SetMarker ( l1[comb_i]->GetMarker ( 2 ) |l2[comb_k]->GetMarker ( 2 ),2 );
80  c.SetMarker ( l1[comb_i]->GetMarker ( 3 ) |l2[comb_k]->GetMarker ( 3 ),3 );
81  c.SetPosition ( GetVertex() );
82  c.SetVect ( GetMomentum() );
83  c.SetE ( c.E() );
84  out.Put ( &c );
85  }
86  }
87  }
88  }
89  }
90 }
91 
93 {
94  o << GetName() << " settings:" << endl;
95  o << "Distance of closest approach < " << fDoca << " cm" << endl;
96  o << "Angle vertex-IP->momentum < " << fVtxip << " rad" << endl;
97  o << "Radius of acceptance = " << fRmin << " ... " << fRmax << " cm" << endl;
98  o << endl;
99 }
100 
102 {
103  a.PrintOn ( o );
104  return o;
105 }
106 
void Cleanup()
Definition: RhoCandList.cxx:62
void Combine(RhoCandList &in1, RhoCandList &in2, RhoCandList &out)
RhoVertexSelectorBase(const char *name="RhoVertexSelectorBase")
Int_t GetLength() const
Definition: RhoCandList.h:46
void SetVect(const TVector3 &p3)
Definition: RhoCandidate.h:238
void SetPosition(const TVector3 &pos)
TVector3 GetMomentum() const
void SetE(Double_t energy)
Definition: RhoCandidate.h:232
Int_t a
Definition: anaLmdDigi.C:126
Double_t
std::ostream & operator<<(std::ostream &o, const RhoVertexSelectorBase &a)
TFile * out
Definition: reco_muo.C:20
TString name
Double_t E() const
Definition: RhoCandidate.h:202
ClassImp(RhoVertexSelectorBase) using namespace std
virtual Bool_t Accept(RhoCandidate *, RhoCandidate *)=0
void Put(const RhoCandidate *, Int_t i=-1)
Definition: RhoCandList.cxx:77
void SetMarker(UInt_t l, UInt_t m)
virtual void PrintOn(std::ostream &o=std::cout) const