using namespace std;
#include "hrichcut.h"
#include "hrichhitsim.h"
#include "hrichhit.h"
#include "hhitmatch.h"
#include "hhitmatchsim.h"
#include "hdihitmatch.h"
#include "hdihitmatchsim.h"
#include "hlinearcategory.h"
#include <iostream>
#include <iomanip>
ClassImp(HRichCut)
HRichCut::HRichCut()
{
}
HRichCut::~HRichCut(void)
{
}
Bool_t HRichCut::isRICHBetween(HHitMatch* track,Float_t low,Float_t high)
{
Bool_t k = kFALSE;
Float_t ringtheta=track->getRichTheta();
if(ringtheta<=high&&ringtheta>=low) k=kTRUE;
return k;
}
Bool_t HRichCut::isTOFBetween(HHitMatch* track,Float_t low,Float_t high)
{
Bool_t k = kFALSE;
Float_t toftof, tofinotof;
toftof=tofinotof=-1;
toftof=track->getTofTof();
tofinotof=track->getTofinoTof();
if (toftof>-1 && toftof>=low && toftof<=high) return kTRUE;
else if (tofinotof>-1 && tofinotof>=low && tofinotof<=high) return kTRUE;
return k;
}
Bool_t HRichCut::isRMThetaDiff(HHitMatch* track,Float_t limit)
{
Bool_t k = kFALSE;
Float_t richtheta = track->getRichTheta();
Float_t mdctheta = track->getMdcTheta();
if ((TMath::Abs(richtheta-mdctheta))<limit)
{
k=kTRUE;
}
return k;
}
Bool_t HRichCut::isRMPhiDiff(HHitMatch* track,Float_t limit)
{
Bool_t k = kFALSE;
Float_t richphi = track->getRichPhi();
Float_t mdcphi = track->getMdcPhi();
if ((TMath::Abs(richphi-mdcphi))<limit)
{
k=kTRUE;
}
return k;
}
Bool_t HRichCut::isInKickTrack(HDiHitMatch* pair)
{
if (pair->getOpangKICK()>0.) return kTRUE;
else return kFALSE;
}
Bool_t HRichCut::isOpangGreaterThan(HDiHitMatch* pair,Float_t th)
{
Bool_t k = kFALSE;
Float_t opang = pair->getOpangMDC();
if (opang>th) k = kTRUE;
return k;
}
Bool_t HRichCut::isOpangBetween(HDiHitMatch* pair,Float_t low,Float_t high)
{
Bool_t k = kFALSE;
Float_t opang = pair->getOpangMDC();
if (opang>=low&&opang<=high) k = kTRUE;
return k;
}
Bool_t HRichCut::isFullRichMdcMetaTracklet(HHitMatch* track)
{
Bool_t k = kFALSE;
Int_t nRInd = track->getRichInd();
Int_t nMInd = track->getMdcInd();
Int_t nTInd = track->getTofInd();
Int_t nSInd = track->getShowInd();
Int_t nRM = track->getMatchedRichMdc();
Int_t nRT = track->getMatchedRichTof();
Int_t nMT = track->getMatchedMdcTof();
Int_t nRS = track->getMatchedRichShower();
Int_t nMS = track->getMatchedMdcShower();
if (nRInd!=-1 && nTInd!=-1 && nMInd!=-1
&& nRM==1 && nRT==1 && nMT==1 )
{
k=kTRUE;
}
else if (nRInd!=-1 && nSInd!=-1 && nMInd!=-1
&& nRM==1 && nRS==1 && nMS==1 )
{
k=kTRUE;
}
return k;
}
Int_t HRichCut::NbRingsPerMDCUNLIKEPair(HDiHitMatch* pair)
{
if(isUnlikeSignPair(pair) && pair->getNbDMdcHit()==2)
{
return pair->getNbDRichHit();
}
else return -1;
}
Bool_t HRichCut::isGEANTPair(HDiHitMatchSim* pair, HLinearCategory* cat, const Char_t* opt)
{
Bool_t isPair=kFALSE;
HHitMatchSim *track1 = (HHitMatchSim*)cat->getObject(pair->getIndTrk1());
HHitMatchSim *track2 = (HHitMatchSim*)cat->getObject(pair->getIndTrk2());
HTrackInfo *trackG1 = track1->getTrackInfoObj();
HTrackInfo *trackG2 = track2->getTrackInfoObj();
Int_t mech=-1;
TString mechanism(opt);
if (!mechanism.CompareTo("Conversion")) mech=6;
else if (!mechanism.CompareTo("pi0Dalitz")) mech=5;
Int_t trackcorr1 = pair->getCorrCode1();
Int_t trackcorr2 = pair->getCorrCode2();
for(Int_t i=0;i<MAXPARTICLES;i++)
{
Int_t nPart1 = trackG1->getPartNr();
Int_t nTrkNb1 = trackG1->getTrkNb(i);
if (nTrkNb1<=-1) break;
Int_t parID1 = trackG1->getParId(i);
Int_t mech1 = trackG1->getMech(i);
Int_t med1 = trackG1->getMed(i);
Int_t creaID1 = trackG1->getCreaId(i);
Int_t cTrkNb1 = trackG1->getCreaTrkNb(i);
Int_t corr1 = trackG1->calcCorrCode(i);
Int_t srcLep1 = -1;
if (!mechanism.CompareTo("Conversion"))
srcLep1=trackG1->getConvLep(i);
else if(!mechanism.CompareTo("pi0Dalitz"))
srcLep1=trackG1->getPi0Dalitz(i);
for(Int_t j=0;j<MAXPARTICLES;j++)
{
Int_t nPart2 = trackG2->getPartNr();
Int_t nTrkNb2 = trackG2->getTrkNb(j);
if (nTrkNb2<=-1) break;
Int_t parID2 = trackG2->getParId(j);
Int_t mech2 = trackG2->getMech(j);
Int_t med2 = trackG2->getMed(j);
Int_t creaID2 = trackG2->getCreaId(j);
Int_t cTrkNb2 = trackG2->getCreaTrkNb(j);
Int_t corr2 = trackG2->calcCorrCode(j);
Int_t srcLep2 = -1;
if (!mechanism.CompareTo("Conversion"))
srcLep2=trackG2->getConvLep(j);
else if(!mechanism.CompareTo("pi0Dalitz"))
srcLep2=trackG2->getPi0Dalitz(j);
if (nTrkNb1!=nTrkNb2 &&
srcLep1==1 && srcLep2==1 &&
creaID1==creaID2 && cTrkNb1==cTrkNb2 &&
mech1==mech &&
mech1==mech2 && med1==med2 &&
corr1==7 && corr2==7 &&
nPart1==1 && nPart2==1 &&
(parID1==2 || parID1==3) && (parID1+parID2==5) &&
trackcorr1==7 && trackcorr2==7)
{
isPair=kTRUE;
}
}
}
return isPair;
}
Bool_t HRichCut::isUnlikeSignPair(HDiHitMatch* pair)
{
Bool_t isPair=kFALSE;
if (pair->getCharge()==0) isPair=kTRUE;
return isPair;
}
Bool_t HRichCut::isNew2Tuple(Int_t i,Int_t j,Int_t *tuple,Int_t max)
{
Int_t base=10;
Int_t cnt=1;
while ((max%cnt)<max)
{
cnt=cnt*base;
}
Int_t f1=cnt*i+j;
Int_t f2=cnt*j+i;
Int_t index=-1;
for (Int_t k=0;k<max;k++)
{
if (tuple[k]==-2)
{
index=k;
break;
}
if (f1==tuple[k] || f2==tuple[k])
{
return kFALSE;
}
}
if (index>-1)
{
tuple[index]=f1;
}
else cout<<"(isNew2Tuple,index of new slot not set)"<<endl;
return kTRUE;
}
Bool_t HRichCut::isNewIndex(Int_t i,Int_t* iarr,Int_t max)
{
Int_t n=0;
do{
if(i==iarr[n]) break;
else if(iarr[n]==-2)
{
iarr[n]=i;
return kTRUE;
}
n++;
} while(n<max);
return kFALSE;
}
Bool_t HRichCut::isGoodRing(HRichHitSim *r)
{
Bool_t kTEST = kFALSE;
Int_t nPatMatCut = 200;
Int_t nPadNrCut = 4;
Int_t nLocMax4Cut = 3;
Int_t nAvrgChrgCut = 4;
Float_t nCentroidCut = 2.5;
if(
r->getRingPatMat() > nPatMatCut &&
(r->getRingAmplitude()/r->getRingPadNr()) > nAvrgChrgCut &&
r->getRingPadNr() > nPadNrCut &&
r->getRingLocalMax4() > nLocMax4Cut &&
r->getCentroid() < nCentroidCut
)
{
kTEST = kTRUE;
}
return kTEST;
}
Bool_t HRichCut::isGoodRing(HRichHit *r)
{
Bool_t kTEST = kFALSE;
Int_t nPatMatCut = 200;
Int_t nPadNrCut = 4;
Int_t nLocMax4Cut = 3;
Int_t nAvrgChrgCut = 4;
Float_t nCentroidCut = 2.5;
if(
r->getRingPatMat() > nPatMatCut &&
(r->getRingAmplitude()/r->getRingPadNr()) > nAvrgChrgCut &&
r->getRingPadNr() > nPadNrCut &&
r->getRingLocalMax4() > nLocMax4Cut &&
r->getCentroid() < nCentroidCut
)
{
kTEST = kTRUE;
}
return kTEST;
}
Bool_t HRichCut::isGoodRing(HHitMatch *r)
{
Bool_t kTEST = kFALSE;
Int_t nPatMatCut = 200;
Int_t nPadNrCut = 5;
Int_t nAvrgChrgCut = 4;
Float_t nCentroidCut = 2.8;
if(
r->getRingPatMat() > nPatMatCut &&
(r->getRingAmplitude()/r->getRingPadNr()) > nAvrgChrgCut &&
r->getRingPadNr() > nPadNrCut &&
r->getCentroid() < nCentroidCut
)
{
kTEST = kTRUE;
}
return kTEST;
}
Bool_t HRichCut::isGoodTrack(HHitMatchSim *t)
{
Bool_t kTEST = kFALSE;
Int_t kickind = t->getKickInd();
if (kickind > -1) kTEST = kTRUE;
return kTRUE;
}
Last change: Sat May 22 13:08:30 2010
Last generated: 2010-05-22 13:08
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.