189 fuse_kIsLepton = kTRUE;
191 fdoSkippedFullCandPairs = kTRUE;
192 fpairs .resize(10000);
193 fothers .resize(1000);
194 ffullrecoOthers .resize(100);
195 fnofullrecoOthers .resize(1000);
196 freference.resize(100);
215 for(UInt_t i=0;i<fCaseVec.size();i++) fCaseCt.push_back(0);
232 if( cand->
getCharge() > 0 )
return kTRUE;
244 if( cand->
getCharge() < 0 )
return kTRUE;
254 vector<HParticleCand*> v;
264 vector<HParticleCand*> v;
274 vector<HParticleCand*> v;
286 vector<HParticleCand*> v;
294 vector<HParticleCand*> v;
302 vector<HParticleCand*> v;
310 vector<HParticleCand*> v;
318 vector<HParticleCand*> v;
333 Warning(
"nextEvent()",
"Reference particle not labeled with PID! Should not happen. Check your selection functions. frequireRich = kTRUE but kIsLepton is not used as referencce this might cause empty pids.");
368 UInt_t
n = candCat->getEntries();
373 for(UInt_t i=0; i <
n; i++){
408 for(UInt_t i = 0 ; i <
n ; i++){
414 for(UInt_t j = i+1 ; j <
n; j++){
437 for(UInt_t i = 0 ; i <
freference.size(); i++){
443 for(UInt_t j = 0 ; j <
fothers.size(); j++){
484 for(UInt_t k = 0; k <
fCaseVec.size(); k ++){
490 if(!good2 || ct>1) pair.
print();
504 for(UInt_t j = 0 ; j <
fothers.size(); j++){
622 for(UInt_t i = 0; i <
fpairs.size(); i++){
630 for(UInt_t k = 0; k <
fCaseVec.size(); k ++){
639 vector<HParticlePair*> pairs;
640 pairs.push_back(pair);
646 vector<HParticlePair*> pairs;
647 pairs.push_back(pair);
685 for(UInt_t i = 0; i <
fpairs.size(); i++){
688 filterpairs.push_back(&pair);
697 for(UInt_t i = 0; i <
fpairs.size(); i++){
700 filterpairs.push_back(&pair);
717 map<HVirtualCand*,vector<HParticlePair*> >::iterator it =
mCandtoPair.find(cand);
719 vector<HParticlePair*>& v = it->second;
721 for(UInt_t i = 0 ; i < v.size(); i++){
725 if(pair.
getCand(0) == cand) candidates.push_back(pair.
getCand(1));
726 else candidates.push_back(pair.
getCand(0));
730 return candidates.size();
746 map<HVirtualCand*,vector<HParticlePair*> >::iterator it =
mCandtoPair.find(cand);
748 vector<HParticlePair*>& v = it->second;
749 for(UInt_t i = 0 ; i < v.size(); i++){
752 filterpairs.push_back(v[i]);
758 return filterpairs.size();
775 vector<HParticleCand*>& v = it->second;
776 for(UInt_t i = 0 ; i < v.size(); i++){
779 if(flag == 0 ) candidates.push_back(v[i]);
785 candidates.push_back(v[i]);
792 return candidates.size();
807 vector<HParticleCand*>& v = it->second;
808 for(UInt_t i = 0 ; i < v.size(); i++){
811 if(flag == 0 ) candidates.push_back(v[i]);
817 candidates.push_back(v[i]);
824 return candidates.size();
839 vector<HParticleCand*>& v = it->second;
840 for(UInt_t i = 0 ; i < v.size(); i++){
843 if(flag == 0 ) candidates.push_back(v[i]);
849 candidates.push_back(v[i]);
856 return candidates.size();
873 map<Int_t,vector<HParticleCand*> >* mp =0;
881 Error(
"getSameMeta()",
"unknown Meta case!");
return 0;
883 map<Int_t,vector<HParticleCand*> >::iterator it = mp->find(metaind);
886 vector<HParticleCand*>& v = it->second;
887 for(UInt_t i = 0 ; i < v.size(); i++){
890 if(flag == 0 ) candidates.push_back(v[i]);
896 candidates.push_back(v[i]);
903 return candidates.size();
911 TCanvas* c =
new TCanvas(
"pairCase",
"pairCase",1500,800);
914 c->SetBottomMargin(0.15);
918 TH1F* h =
new TH1F(
"h",
"",bins,0,bins);
919 h->SetLineColor(kRed);
921 h->SetYTitle(
"Fraction of pairs [%]");
922 h->GetXaxis()->SetNdivisions(100+bins);
923 h->GetXaxis()->SetLabelSize(0);
925 h->GetYaxis()->SetRangeUser(0.,50.);
927 for(UInt_t i=0;i<bins;i++) sum+=
fCaseCt[i];
929 cout<<
"Pairs Cases for Leptons :"<<endl;
930 for(UInt_t i=0;i<bins;i++){
933 if(sum !=0 ) h->Fill(i,frac);
934 cout<<Form(
"case%2i : ",i+1)<<setw(15)<< frac <<
" cts "<<setw(15)<<
fCaseCt[i]<<endl;
939 Double_t offsetX = 0.25;
940 Double_t offsetY = -8;
941 Double_t scaleX = 1.;
942 Double_t scaleY = 1.;
946 for(UInt_t i=0; i < bins; i++){
947 pairdraw.
drawPair(offsetX+i,offsetY,scaleX,scaleY,
fCaseVec[i],Form(
"Case%i",i+1),
"");
949 cout<<
"sum "<<sum<<
" check " <<
richCandCt<<endl;
void drawPair(Double_t xoff, Double_t yoff, Double_t scx, Double_t scy, UInt_t flag, TString nameCase, TString cuts="")
static Int_t charge(const Int_t id)
Bool_t isShowerUsed() const
void selectPID(HParticleCand *cand1, Int_t &pid1, Bool_t warn=kTRUE)
Short_t getCharge() const
Bool_t isTofHitUsed() const
void filterPairsVector(vector< HParticlePair * > &filterpairs, UInt_t flag=0)
Bool_t isFlagBit(eFlagBits bit)
Int_t getInnerSegInd() const
Int_t fPID1
user filter function to avoid unneeded combinatorics
Float_t getOpeningAngle()
Int_t fVertexCase
ask for rich index in selctPos/selectNeg function
vector< HParticleCand * > ffullrecoOthers
other candidates (not KIsLepton flagged)
virtual void print(UInt_t selection=31)
HEvent *& getCurrentEvent(void)
map< Int_t, vector< HParticleCand * > > mInnerMdctoCand
EMC Cluster lookup detector hit ind -> list of candidates using this hit.
vector< HParticlePair > fpairs
not full reco cands (inner/outer MDC or META missing) inside others
void clearVectors()
counter for all pair cases with both candidates matching a Rich (check)
ClassImp(HDbColumn) HDbColumn
static HGeomVector getGlobalVertex(Int_t v, Bool_t warn=kFALSE)
static Bool_t setPairFlags(UInt_t &flag, HParticleCand *cand2=0, HParticleCand *cand1=0)
map< Int_t, vector< HParticleCand * > > mShowertoCand
RPC cluster lookup detector hit ind -> list of candidates using this hit.
Bool_t setPair(HVirtualCand *cnd1, Int_t pid1, HVirtualCand *cnd2, Int_t pid2, Int_t motherpid, UInt_t pairflags, HGeomVector &vertex)
static T * getObject(T *pout, Short_t num=-1, Int_t index=-1, Bool_t silent=kFALSE)
map< Int_t, vector< HParticleCand * > > mRpcClsttoCand
TOF cluster lookup detector hit ind -> list of candidates using this hit.
HGeomVector fVertex
which eventvertex to use (see eVertex in hparticledef.h)
map< HVirtualCand *, vector< HParticlePair * > > mCandtoPair
RICH hit lookup detector hit ind -> list of candidates using this hit.
Int_t filterCandidates(HVirtualCand *cand, vector< HVirtualCand * > &candidates, UInt_t flag=0, Float_t oAngle=-1)
Int_t fMotherPID
pid2 (default electrons)
static Bool_t getRequireRich()
Int_t getSameMeta(HParticleCand *cand, vector< HParticleCand * > &candidates, UInt_t flag=0, Bool_t isReference=kTRUE)
Int_t getSelectedMeta() const
map< Int_t, vector< HParticleCand * > > mRichtoCand
outer Seg lookup detector hit ind -> list of candidates using this hit
Int_t getOuterSegInd() const
static Bool_t selectNeg(HParticleCand *)
Int_t getSameOuterMdc(HParticleCand *cand, vector< HParticleCand * > &candidates, UInt_t flag=0, Bool_t isReference=kTRUE)
Int_t richCandCt
vector for pair cases
void bookHits(HParticleCand *cand1)
Int_t getSameRich(HParticleCand *cand, vector< HParticleCand * > &candidates, UInt_t flag=0, Bool_t isReference=kTRUE)
Bool_t(* fselectPID1)(HParticleCand *)
candidate lookup candidate -> list of pairs using this candidate
map< Int_t, vector< HParticleCand * > > mEmctoCand
SHOWER hit lookup detector hit ind -> list of candidates using this hit.
Bool_t(* fselectPID2)(HParticleCand *)
selection function pid1 (default positrons)
HVirtualCand * getCand(Int_t ind)
Bool_t(* fuserFilter)(HParticleCand *)
selection function pid2 (default electrons)
map< Int_t, vector< HParticleCand * > > mTofClsttoCand
TOF hit lookup detector hit ind -> list of candidates using this hit.
Short_t getSystemUsed() const
Bool_t isTofClstUsed() const
Bool_t isRpcClstUsed() const
void print(UInt_t selection=63)
static Int_t pid(const Char_t *pidName)
Int_t fPID2
pid1 (default positrons)
vector< HParticleCand * > fothers
reference candidates (kIsLepton flagged)
Bool_t fdoSkippedFullCandPairs
== kTRUE use kIsLepton as refererence selection (default)
Int_t getSameInnerMdc(HParticleCand *cand, vector< HParticleCand * > &candidates, UInt_t flag=0, Bool_t isReference=kTRUE)
Int_t getMetaHitInd() const
vector< HParticleCand * > freference
map< Int_t, vector< HParticleCand * > > mOuterMdctoCand
inner Seg lookup detector hit ind -> list of candidates using this hit
map< Int_t, vector< HParticleCand * > > mTofHittoCand
all pair combinations freference x fothers
vector< HParticleCand * > fnofullrecoOthers
full reco cands (inner/outer MDC + META) inside others
Bool_t fuse_kIsLepton
default dilepton
vector< UInt_t > fCaseVec
counter array for cases
static Bool_t evalPairsFlags(UInt_t flag, UInt_t fl)
static Bool_t selectPos(HParticleCand *)
const Cat_t catParticleCand
Bool_t isFlagAND(Int_t num,...)