// - added histograms and values for LCMS momenta (for simulation)\r
// - added random particle order switch in correlations (9/09/13)\r
// - added more bins for 3D OSL analysis (9/19/13)\r
+// - added merit cut choice, pass as argument (10/16/13)\r
+// - 1-mass, 2-v0dca, 3-dddca, 4-combination (used to be v0dca)\r
+// - added passable argument for two-track minimum separation (10/16/13)\r
////////////////////////////////////////////////////////////////////////////////\r
\r
\r
fOnlineCase(kTRUE),\r
fMeritCase(kTRUE),\r
fMinDecayLength(0.0),\r
+ fMeritCutChoice(0),\r
+ fMinSep(0.0),\r
fEventCount(0),\r
fEC(0x0),\r
fEvt(0X0),\r
{\r
}\r
//________________________________________________________________________\r
-AliFemtoK0Analysis::AliFemtoK0Analysis(const char *name, bool FieldPositive, bool OnlineCase, bool MeritCase, float MinDL) \r
+AliFemtoK0Analysis::AliFemtoK0Analysis(const char *name, bool FieldPositive, bool OnlineCase, bool MeritCase, float MinDL, int MeritCutChoice, float MinSep) \r
: AliAnalysisTaskSE(name), \r
fFieldPos(FieldPositive),\r
fOnlineCase(OnlineCase),\r
fMeritCase(MeritCase),\r
fMinDecayLength(MinDL),\r
+ fMeritCutChoice(MeritCutChoice),\r
+ fMinSep(MinSep),\r
fEventCount(0),\r
fEC(0x0),\r
fEvt(0X0),\r
fOnlineCase = OnlineCase;\r
fMeritCase = MeritCase;\r
fMinDecayLength = MinDL;\r
+ fMeritCutChoice = MeritCutChoice;\r
+ fMinSep = MinSep;\r
\r
// Define output slots here \r
// Output slot #1\r
fOnlineCase(obj.fOnlineCase),\r
fMeritCase(obj.fMeritCase),\r
fMinDecayLength(obj.fMinDecayLength),\r
+ fMeritCutChoice(obj.fMeritCutChoice),\r
+ fMinSep(obj.fMinSep),\r
fEventCount(obj.fEventCount),\r
fEC(obj.fEC),\r
fEvt(obj.fEvt),\r
fOnlineCase = obj.fOnlineCase;\r
fMeritCase = obj.fMeritCase;\r
fMinDecayLength= obj.fMinDecayLength;\r
+ fMeritCutChoice= obj.fMeritCutChoice;\r
+ fMinSep = obj.fMinSep;\r
fEventCount = obj.fEventCount;\r
fEC = obj.fEC;\r
fEvt = obj.fEvt;\r
const float kEtaCut = 0.8; //maximum |pseudorapidity|\r
const float kMinCosAngle = 0.99; //minimum cosine of K0 pointing angle \r
\r
- const float kMinSeparation = 5.0; //minimum daughter (pair) separation\r
+ const float kMinSeparation = fMinSep; //minimum daughter (pair) separation\r
\r
const float kTOFLow = 0.8; //boundary for TOF usage\r
const float kMaxTOFSigmaPion = 3.0; //TOF # of sigmas\r
}\r
\r
//K0 cuts\r
- if(v0->Eta() > kEtaCut) continue; \r
- if(v0->CosPointingAngle(primaryVertex) < kMinCosAngle) continue;\r
- if(v0->MassK0Short() < .2 || v0->MassK0Short() > .8) continue;\r
- if(v0->DcaNegToPrimVertex() < kMinDCAPrimaryPion) continue;\r
- if(v0->DcaPosToPrimVertex() < kMinDCAPrimaryPion) continue; \r
- if(v0->DecayLength(primaryVertex) > kMaxDLK0) continue;\r
+ if(v0->Eta() > kEtaCut) continue; \r
+ if(v0->CosPointingAngle(primaryVertex) < kMinCosAngle) continue;\r
+ if(v0->MassK0Short() < .2 || v0->MassK0Short() > .8) continue;\r
+ if(v0->DcaNegToPrimVertex() < kMinDCAPrimaryPion) continue;\r
+ if(v0->DcaPosToPrimVertex() < kMinDCAPrimaryPion) continue; \r
+ if(v0->DecayLength(primaryVertex) > kMaxDLK0) continue;\r
if(v0->DecayLength(primaryVertex) < kMinDLK0) continue;\r
- if(v0->DcaV0Daughters() > kMaxDCADaughtersK0) continue;\r
+ if(v0->DcaV0Daughters() > kMaxDCADaughtersK0) continue;\r
double v0Dca = v0->DcaV0ToPrimVertex();\r
- if(v0Dca > kMaxDCAK0) continue; \r
- if(!goodPiMinus || !goodPiPlus) continue; \r
+ if(v0Dca > kMaxDCAK0) continue; \r
+ if(!goodPiMinus || !goodPiPlus) continue; \r
\r
//EVERYTHING BELOW HERE PASSES SINGLE PARTICLE CUTS, PION PID, and LOOSE MASS CUT\r
\r
//else continue; //removed, Apr 18\r
\r
//Check for shared daughters, using v0 DCA to judge\r
+ bool v0JudgeNew; //true if new v0 beats old\r
tempK0[v0Count].fSkipShared = kFALSE;\r
+ double newV0Pars[3] = {fabs(v0->MassK0Short()-kMassK0Short),v0Dca,v0->DcaV0Daughters()}; //parameters used in merit cut\r
if(fMeritCase){\r
for(int iID = 0; iID<v0Count; iID++){\r
if(tempK0[iID].fSkipShared == kFALSE){ //if old is already skipped, go to next old\r
if(tempK0[iID].fDaughterID1 == prongTrackPos->GetID() || tempK0[iID].fDaughterID2 == prongTrackNeg->GetID()){\r
- if(tempK0[iID].fV0Dca <= v0Dca){ //if old beats new...\r
+ double oldV0Pars[3] = {fabs(tempK0[iID].fMass-kMassK0Short), tempK0[iID].fV0Dca, tempK0[iID].fDDDca}; \r
+ v0JudgeNew = CheckMeritCutWinner(fMeritCutChoice, oldV0Pars, newV0Pars); //true if new wins\r
+ if(!v0JudgeNew){ //if old beats new...\r
if(!tempK0[iID].fK0 && goodK0) continue; //if bad old beats new good, do nothing... \r
else{ //but if bad old beats new bad, or good old beats anything, skip new\r
tempK0[v0Count].fSkipShared = kTRUE; //skip new\r
else{ //if new beats old...\r
if(tempK0[iID].fK0 && !goodK0) continue; //if bad new beats good old, do nothing...\r
else{ //but if bad new beats bad old, or good new beats anything, skip old\r
- tempK0[iID].fSkipShared = kTRUE; //skip old \r
- if(tempK0[iID].fK0) k0Count--; //if good old gets skipped, subtract from number of K0s (new one will be added later, if it succeeds)\r
+ tempK0[iID].fSkipShared = kTRUE; //skip old \r
+ if(tempK0[iID].fK0) k0Count--; //if good old gets skipped, subtract from number of K0s (new one will be added later, if it succeeds)\r
}\r
}\r
}\r
//else tempK0[v0Count].fSideLeft = kFALSE;\r
//if(v0->MassK0Short() > .515 && v0->MassK0Short() < .545) tempK0[v0Count].fSideRight = kTRUE;\r
//else tempK0[v0Count].fSideRight = kFALSE;\r
- //if(!goodK0) continue; //no sides, speed up analysis (REDUNDANT RIGHT NOW)\r
+ //if(!goodK0) continue; //no sides, speed up analysis (REDUNDANT RIGHT NOW)\r
\r
tempK0[v0Count].fDaughterID1 = prongTrackPos->GetID();\r
tempK0[v0Count].fDaughterID2 = prongTrackNeg->GetID();\r
\r
//for hists\r
tempK0[v0Count].fDDDca = v0->DcaV0Daughters();\r
- tempK0[v0Count].fDecayLength = v0->DecayLength(primaryVertex);\r
+ tempK0[v0Count].fDecayLength = v0->DecayLength(primaryVertex);\r
tempK0[v0Count].fPosPt = v0->PtProng(pos0or1);\r
tempK0[v0Count].fNegPt = v0->PtProng(neg0or1);\r
tempK0[v0Count].fPosPhi = v0->PhiProng(pos0or1);\r
tempK0[v0Count].fNegPhi = v0->PhiProng(neg0or1);\r
- if(!orderswitch){\r
+ if(!orderswitch){\r
tempK0[v0Count].fPosDca = v0->DcaPosToPrimVertex();\r
tempK0[v0Count].fNegDca = v0->DcaNegToPrimVertex();\r
- }\r
+ }\r
else{\r
tempK0[v0Count].fPosDca = v0->DcaNegToPrimVertex();\r
tempK0[v0Count].fNegDca = v0->DcaPosToPrimVertex();\r
- } \r
+ } \r
\r
//for separation\r
GetGlobalPositionAtGlobalRadiiThroughTPC(prongTrackPos, bField, tempK0[v0Count].fPosXYZ, vertex);\r
- GetGlobalPositionAtGlobalRadiiThroughTPC(prongTrackNeg, bField, tempK0[v0Count].fNegXYZ, vertex);\r
+ GetGlobalPositionAtGlobalRadiiThroughTPC(prongTrackNeg, bField, tempK0[v0Count].fNegXYZ, vertex);\r
//for DPC\r
prongTrackPos->GetPxPyPz(tempK0[v0Count].fPPos);\r
prongTrackNeg->GetPxPyPz(tempK0[v0Count].fPNeg);\r
float pairPt, pairMt, pairKt; //pair momentum values\r
float pairMInv, pairPDotQ;\r
float qinv, q0, qx, qy, qz; //pair q values\r
- //float qLength, thetaSHCos; //Spherical Harmonics values\r
- //float phiSH, thetaSH;\r
+ float qLength, thetaSH, thetaSHCos, phiSH; //Spherical Harmonics values\r
float am12, epm, h1, p12, p112, ppx, ppy, ppz, ks; //PRF\r
//float qOutLCMS;\r
float qOutPRF, qSide, qLong; //relative momentum in LCMS/PRF frame\r
*histname3D += ktBin;\r
\r
//Spherical harmonics\r
- //qLength = sqrt(qLong*qLong + qSide*qSide + qOutPRF*qOutPRF);\r
- //thetaSHCos = qLong/qLength;\r
- //thetaSH = acos(thetaSHCos);\r
- //phiSH = acos(qOutPRF/(qLength*sin(thetaSH)));\r
+ qLength = sqrt(qLong*qLong + qSide*qSide + qOutPRF*qOutPRF);\r
+ thetaSHCos = qLong/qLength;\r
+ thetaSH = acos(thetaSHCos);\r
+ phiSH = acos(qOutPRF/(qLength*sin(thetaSH)));\r
\r
//Finding average separation of daughters throughout TPC - two-track cut\r
float posPositions1[9][3] = {{0}};\r
((TH3F*)fOutputList->FindObject("fHistSHCentHighKt"))->Fill(qLength,thetaSHCos, phiSH);}\r
else if(centBin > 9){\r
((TH3F*)fOutputList->FindObject("fHistOSLSemiCentHighKt"))->Fill(qOutPRF,qSide,qLong);\r
+\r
((TH3F*)fOutputList->FindObject("fHistSHSemiCentHighKt"))->Fill(qLength, thetaSHCos, phiSH);}}*/ \r
\r
}//centercenter\r
}\r
}\r
\r
+bool AliFemtoK0Analysis::CheckMeritCutWinner(int cutChoice, double oldPars[3], double newPars[3]){\r
+ //performs "merit cut" judgement check on v0s with shared daughters, using one of three criteria.\r
+ //if cutChoice = 4, it uses all three criteria, needed 2 of 3 'points'\r
+\r
+ bool newV0Wins = kFALSE;\r
+ double pardiff[3] = {newPars[0]-oldPars[0],\r
+ newPars[1]-oldPars[1],\r
+ newPars[2]-oldPars[2]};\r
+ if(cutChoice > 0 && cutChoice < 4){\r
+ if(pardiff[cutChoice] <= 0.) newV0Wins = kTRUE;\r
+ }\r
+ else if(cutChoice == 4){\r
+ int newWinCount = 0;\r
+ for(int i=0;i<3;i++){if(pardiff[i+1] <= 0) newWinCount++;}\r
+ if(newWinCount > 1) newV0Wins = kTRUE; \r
+ }\r
+ else{};\r
+ return newV0Wins;\r
+}\r
+\r
+\r