Skip to content

Commit

Permalink
Add refmult3/remult4 to picoEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji Xu committed May 20, 2016
1 parent 54c68a7 commit 17a4396
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3 deletions.
10 changes: 10 additions & 0 deletions StPicoDstMaker/StPicoEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ StPicoEvent::StPicoEvent():
mRefMultFtpcEast(0), mRefMultFtpcWest(0),
mRefMultNeg(0), mRefMultPos(0),
mRefMult2NegEast(0), mRefMult2PosEast(0), mRefMult2NegWest(0), mRefMult2PosWest(0),
mRefMult3NegEast(0), mRefMult3PosEast(0), mRefMult3NegWest(0), mRefMult3PosWest(0),
mRefMult4NegEast(0), mRefMult4PosEast(0), mRefMult4NegWest(0), mRefMult4PosWest(0),
mRefMultHalfNegEast(0), mRefMultHalfPosEast(0), mRefMultHalfNegWest(0), mRefMultHalfPosWest(0),
mGRefMult(0), mNumberOfGlobalTracks(0), mbTofTrayMultiplicity(0), mNHitsHFT{},
mNVpdHitsEast(0), mNVpdHitsWest(0), mNT0(0), mVzVpd(std::numeric_limits<short>::max()),
Expand Down Expand Up @@ -64,6 +66,14 @@ StPicoEvent::StPicoEvent(const StMuDst& muDst) : StPicoEvent()
mRefMult2PosEast = (UShort_t)StPicoUtilities::refMult2(1, 0, muDst);
mRefMult2NegWest = (UShort_t)StPicoUtilities::refMult2(0, 1, muDst);
mRefMult2PosWest = (UShort_t)StPicoUtilities::refMult2(1, 1, muDst);
mRefMult3NegEast = (UShort_t)StPicoUtilities::refMult3(0, 0, muDst);
mRefMult3PosEast = (UShort_t)StPicoUtilities::refMult3(1, 0, muDst);
mRefMult3NegWest = (UShort_t)StPicoUtilities::refMult3(0, 1, muDst);
mRefMult3PosWest = (UShort_t)StPicoUtilities::refMult3(1, 1, muDst);
mRefMult4NegEast = (UShort_t)StPicoUtilities::refMult4(0, 0, muDst);
mRefMult4PosEast = (UShort_t)StPicoUtilities::refMult4(1, 0, muDst);
mRefMult4NegWest = (UShort_t)StPicoUtilities::refMult4(0, 1, muDst);
mRefMult4PosWest = (UShort_t)StPicoUtilities::refMult4(1, 1, muDst);
mRefMultHalfNegEast = (UShort_t)StPicoUtilities::refMultHalf(0, 0, muDst);
mRefMultHalfPosEast = (UShort_t)StPicoUtilities::refMultHalf(1, 0, muDst);
mRefMultHalfNegWest = (UShort_t)StPicoUtilities::refMultHalf(0, 1, muDst);
Expand Down
36 changes: 36 additions & 0 deletions StPicoDstMaker/StPicoEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ class StPicoEvent : public TObject {
Int_t refMult2NegEast() const;
Int_t refMult2PosWest() const;
Int_t refMult2NegWest() const;
Int_t refMult3PosEast() const;
Int_t refMult3NegEast() const;
Int_t refMult3PosWest() const;
Int_t refMult3NegWest() const;
Int_t refMult4PosEast() const;
Int_t refMult4NegEast() const;
Int_t refMult4PosWest() const;
Int_t refMult4NegWest() const;
Int_t refMultHalfPosEast() const;
Int_t refMultHalfNegEast() const;
Int_t refMultHalfPosWest() const;
Expand All @@ -46,6 +54,12 @@ class StPicoEvent : public TObject {
Int_t refMult2() const;
Int_t refMultHalfEast() const;
Int_t refMultHalfWest() const;
Int_t refMult3East() const;
Int_t refMult3West() const;
Int_t refMult3() const;
Int_t refMult4East() const;
Int_t refMult4West() const;
Int_t refMult4() const;

Int_t grefMult() const;
UShort_t numberOfGlobalTracks() const;
Expand Down Expand Up @@ -110,6 +124,14 @@ class StPicoEvent : public TObject {
UShort_t mRefMult2PosEast; // TPC refMult2 pos (-1<eta<-0.5)
UShort_t mRefMult2NegWest; // TPC refMult2 neg (0.5<eta<1.0)
UShort_t mRefMult2PosWest; // TPC refMult2 pos (0.5<eta<1.0)
UShort_t mRefMult3NegEast;
UShort_t mRefMult3PosEast;
UShort_t mRefMult3NegWest;
UShort_t mRefMult3PosWest;
UShort_t mRefMult4NegEast;
UShort_t mRefMult4PosEast;
UShort_t mRefMult4NegWest;
UShort_t mRefMult4PosWest;
UShort_t mRefMultHalfNegEast ;// TPC refMultHalf neg (eta<0)
UShort_t mRefMultHalfPosEast ;// TPC refMultHalf pos (eta<0)
UShort_t mRefMultHalfNegWest ;// TPC refMultHalf neg (eta>0)
Expand Down Expand Up @@ -174,6 +196,14 @@ inline Int_t StPicoEvent::refMult2PosEast() const { return (Int_t)mRefMu
inline Int_t StPicoEvent::refMult2NegEast() const { return (Int_t)mRefMult2NegEast; }
inline Int_t StPicoEvent::refMult2PosWest() const { return (Int_t)mRefMult2PosWest; }
inline Int_t StPicoEvent::refMult2NegWest() const { return (Int_t)mRefMult2NegWest; }
inline Int_t StPicoEvent::refMult3PosEast() const { return (Int_t)mRefMult3PosEast; }
inline Int_t StPicoEvent::refMult3NegEast() const { return (Int_t)mRefMult3NegEast; }
inline Int_t StPicoEvent::refMult3PosWest() const { return (Int_t)mRefMult3PosWest; }
inline Int_t StPicoEvent::refMult3NegWest() const { return (Int_t)mRefMult3NegWest; }
inline Int_t StPicoEvent::refMult4PosEast() const { return (Int_t)mRefMult4PosEast; }
inline Int_t StPicoEvent::refMult4NegEast() const { return (Int_t)mRefMult4NegEast; }
inline Int_t StPicoEvent::refMult4PosWest() const { return (Int_t)mRefMult4PosWest; }
inline Int_t StPicoEvent::refMult4NegWest() const { return (Int_t)mRefMult4NegWest; }
inline Int_t StPicoEvent::refMultHalfPosEast() const { return (Int_t)mRefMultHalfPosEast; }
inline Int_t StPicoEvent::refMultHalfNegEast() const { return (Int_t)mRefMultHalfNegEast; }
inline Int_t StPicoEvent::refMultHalfPosWest() const { return (Int_t)mRefMultHalfPosWest; }
Expand All @@ -183,6 +213,12 @@ inline Int_t StPicoEvent::refMult2West() const { return (Int_t)(mRefMul
inline Int_t StPicoEvent::refMult2() const { return (Int_t)(mRefMult2PosEast+mRefMult2NegEast+mRefMult2PosWest+mRefMult2NegWest); }
inline Int_t StPicoEvent::refMultHalfEast() const { return (Int_t)(mRefMultHalfPosEast+mRefMultHalfNegEast); }
inline Int_t StPicoEvent::refMultHalfWest() const { return (Int_t)(mRefMultHalfPosWest+mRefMultHalfNegWest); }
inline Int_t StPicoEvent::refMult3East() const { return (Int_t)(mRefMult3PosEast+mRefMult3NegEast); }
inline Int_t StPicoEvent::refMult3West() const { return (Int_t)(mRefMult3PosWest+mRefMult3NegWest); }
inline Int_t StPicoEvent::refMult3() const { return (Int_t)(mRefMult3PosEast+mRefMult3NegEast+mRefMult3PosWest+mRefMult3NegWest); }
inline Int_t StPicoEvent::refMult4East() const { return (Int_t)(mRefMult4PosEast+mRefMult4NegEast); }
inline Int_t StPicoEvent::refMult4West() const { return (Int_t)(mRefMult4PosWest+mRefMult4NegWest); }
inline Int_t StPicoEvent::refMult4() const { return (Int_t)(mRefMult4PosEast+mRefMult4NegEast+mRefMult4PosWest+mRefMult4NegWest); }

inline Int_t StPicoEvent::grefMult() const { return (Int_t)(mGRefMult); }
inline UShort_t StPicoEvent::numberOfGlobalTracks() const { return mNumberOfGlobalTracks ; }
Expand Down
74 changes: 71 additions & 3 deletions StPicoDstMaker/StPicoUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ namespace StPicoUtilities {

// these first 3 checks are easy, save time
const Bool_t isChargeOk = (charge==0&&track->charge()<0)||(charge==1&&track->charge()>0);
if (track->flag()<0 || !isChargeOk || track->nHitsFit(kTpcId)<10 ) continue;
if (track->flag()<0 || !isChargeOk || track->nHitsFit(kTpcId)<10 || fabs(track->momentum().mag())<1.e-10) continue;

// check eta, a bit more elaborate
if (fabs(track->momentum().mag())<1.e-10) continue;
const Double_t eta = track->momentum().pseudoRapidity() ;
if (fabs(eta)>1.0) continue;

Expand All @@ -86,7 +85,76 @@ namespace StPicoUtilities {
return countedTracks;
}

//______________________________________________________________________________
// Reference multiplicity3 |eta|<1 (Pions and Kaons)
inline UInt_t refMult3(const UInt_t charge, const UInt_t etaId, const StMuDst& muDst)
{
// charge 0:negative, 1:positive
// etaId 0:East(-1<eta<0), 1:West(1>eta>0)

size_t countedTracks = 0;
for (Int_t itrk=0; itrk<muDst.primaryTracks()->GetEntries(); itrk++){
StMuTrack* track = muDst.primaryTracks(itrk) ;
if(!track) continue;

// these first 3 checks are easy, save time
const Bool_t isChargeOk = (charge==0&&track->charge()<0)||(charge==1&&track->charge()>0);
if (track->flag()<0 || !isChargeOk || track->nHitsFit(kTpcId)<10 || fabs(track->momentum().mag())<1.e-10 || track->dca().mag()>3) continue;

// check eta, a bit more elaborate
const Double_t eta = track->momentum().pseudoRapidity() ;
const Bool_t isEtaOk = (etaId==0&&(eta>-1.0&&eta<0)) || (etaId==1&&(eta>0&&eta<1.0));
if (!isEtaOk) continue;

// finally, nsigmaproton,mass square, if a track satisfies gets inside the if, count it
const Double_t p = track->momentum().mag();
const Double_t beta = track->btofPidTraits().beta();
Double_t M2;
if(beta<=1.e-5 ) M2=-999.;
else M2=p*p*(pow(1./beta, 2)-1);
if (track->nSigmaProton()<(-3.0) && M2<0.4) ++countedTracks;
}
return countedTracks;
}

//______________________________________________________________________________
// Reference multiplicity4 |eta|<1 (Pions and Protons)
inline UInt_t refMult4(const UInt_t charge, const UInt_t etaId, const StMuDst& muDst)
{
// charge 0:negative, 1:positive
// etaId 0:East(-1<eta<0), 1:West(1>eta>0)

size_t countedTracks = 0;
for (Int_t itrk=0; itrk<muDst.primaryTracks()->GetEntries(); itrk++){
StMuTrack* track = muDst.primaryTracks(itrk) ;
if(!track) continue;

// these first 3 checks are easy, save time
const Bool_t isChargeOk = (charge==0&&track->charge()<0)||(charge==1&&track->charge()>0);
if (track->flag()<0 || !isChargeOk || track->nHitsFit(kTpcId)<15 || fabs(track->momentum().mag())<1.e-10 || track->dca().mag()>3) continue;

// check eta, a bit more elaborate
const Double_t eta = track->momentum().pseudoRapidity() ;
const Bool_t isEtaOk = (etaId==0&&(eta>-1.0&&eta<0)) || (etaId==1&&(eta>0&&eta<1.0));
if (!isEtaOk) continue;

// finally, check nsigmaproton, mass square, if a track satisfies gets inside the if, count it
const Double_t beta = track->btofPidTraits().beta();
if (beta<=1.e-5)
{
if (track->nSigmaKaon()>3||track->nSigmaKaon()<-3) ++countedTracks;
}
else
{
const Double_t p = track->momentum().mag();
const Double_t M2 = p*p*(pow(1./beta, 2)-1);
if (M2>0.6||M2<0.1) ++countedTracks;
}
}
return countedTracks;
}


}

#endif

0 comments on commit 17a4396

Please sign in to comment.