//////////////////////////////////////////////////////////////////////////// // // $Id: StFlowSelection.cxx,v 1.24 2004/12/09 23:43:38 posk Exp $ // // Author: Art Poskanzer and Raimond Snellings, LBNL, Mar 2000 // FTPC added by Markus Oldenburg, MPI, Dec 2000 // // Description: Class for making selections // //////////////////////////////////////////////////////////////////////////// #include #include #include "StFlowSelection.h" #include "StFlowEvent.h" #include "StFlowTrack.h" #define PR(x) cout << "##### FlowSelection: " << (#x) << " = " << (x) << endl; ClassImp(StFlowSelection) //----------------------------------------------------------------------- StFlowSelection::StFlowSelection() : mSubevent(-1) { // To make selections mPidPart[0] = '\0'; mPtPart[0] = 0.; mPtPart[1] = 0.; mPtBinsPart = 0; mPPart[0] = 0.; mPPart[1] = 0.; mEtaPart[0] = 0.; mEtaPart[1] = 0.; mFitPtsPart[0] = 0; mFitPtsPart[1] = 0; mDedxPtsPart[0] = 0; mDedxPtsPart[1] = 0; mFitOverMaxPtsPart[0] = 0.; mFitOverMaxPtsPart[1] = 0.; mChiSqPart[0] = 0.; mChiSqPart[1] = 0.; mDcaGlobalPart[0] = 0.; mDcaGlobalPart[1] = 2.; mYPart[0] = 0.; mYPart[1] = 0.; } //----------------------------------------------------------------------- StFlowSelection::~StFlowSelection() { } //----------------------------------------------------------------------- Bool_t StFlowSelection::Select(StFlowEvent* pFlowEvent) { // Returns kTRUE if the event is selected return kTRUE; } //----------------------------------------------------------------------- Bool_t StFlowSelection::Select(StFlowTrack* pFlowTrack) { // Selects particles for event plane determination // Returns kTRUE if the track is selected // Selected for event plane if (!pFlowTrack->Select(mHarmonic, mSelection, mSubevent)) return kFALSE; return kTRUE; } //----------------------------------------------------------------------- Bool_t StFlowSelection::SelectPart(StFlowTrack* pFlowTrack) { // Selects particles for correlation with the event plane // Returns kTRUE if the track is selected // PID if (mPidPart[0] != '\0') { if (strstr(mPidPart, "h")!=0) { int charge = pFlowTrack->Charge(); if (strcmp("h+", mPidPart)==0 && charge != 1) return kFALSE; if (strcmp("h-", mPidPart)==0 && charge != -1) return kFALSE; } else { const Char_t* pid = pFlowTrack->Pid(); if (strstr(pid, mPidPart)==0) return kFALSE; } } // Pt float pt = pFlowTrack->Pt(); if (mPtPart[1] > mPtPart[0] && (pt < mPtPart[0] || pt >= mPtPart[1])) return kFALSE; // P float totalp = pFlowTrack->P(); if (mPPart[1] > mPPart[0] && (totalp < mPPart[0] || totalp >= mPPart[1])) return kFALSE; // Eta float eta = pFlowTrack->Eta(); if (mEtaPart[1] > mEtaPart[0] && (eta < mEtaPart[0] || eta >= mEtaPart[1])) return kFALSE; // Fit Points int fitPts = pFlowTrack->FitPts(); if (mFitPtsPart[1] > mFitPtsPart[0] && (fitPts < mFitPtsPart[0] || fitPts >= mFitPtsPart[1])) return kFALSE; // Dedx Points int dedxPts = pFlowTrack->NdedxPts(); if (mDedxPtsPart[1] > mDedxPtsPart[0] && (dedxPts < mDedxPtsPart[0] || dedxPts >= mDedxPtsPart[1])) return kFALSE; // Fit Points over Max Points int maxPts = pFlowTrack->MaxPts(); float fitOverMaxPts = (float)fitPts/(float)maxPts; if (mFitOverMaxPtsPart[1] > mFitOverMaxPtsPart[0] && (fitOverMaxPts < mFitOverMaxPtsPart[0] || fitOverMaxPts >= mFitOverMaxPtsPart[1])) return kFALSE; // Chi Squared float chiSq = pFlowTrack->Chi2(); if (mChiSqPart[1] > mChiSqPart[0] && (chiSq < mChiSqPart[0] || chiSq >= mChiSqPart[1])) return kFALSE; // Dca Global float globdca = pFlowTrack->DcaGlobal(); if (mDcaGlobalPart[1] > mDcaGlobalPart[0] && (globdca < mDcaGlobalPart[0] || globdca >= mDcaGlobalPart[1])) return kFALSE; // Rapidity float Y = pFlowTrack->Y(); if (mYPart[1] > mYPart[0] && (Y < mYPart[0] || Y >= mYPart[1])) return kFALSE; return kTRUE; } //----------------------------------------------------------------------- void StFlowSelection::PrintList() const { cout << "#################################################################" << endl; cout << "# Selection List:" << endl; cout << "# Particles correlated with the event plane: " << mPidPart << endl; cout << "# Pt for particles correlated with the event plane: " << mPtPart[0] << " to " << mPtPart[1] << " GeV/c" <