FairRoot/PandaRoot
PndPidFtsInfo.cxx
Go to the documentation of this file.
1 #include "PndPidCorrelator.h"
2 #include "PndFtsHit.h"
3 
4 #include <cmath>
5 
6 //_________________________________________________________________
8 
9  std::vector<Double_t> dedxvec;
10  dedxvec.clear();
11 
12  //Double_t tuberadius = fFtsParameters->GetTubeInRad(); //[R.K. 01/2017] unused variable
13 
14  Int_t ftsCounts = 0, ftsRawCounts = 0;
15  PndTrackCand trackCand = track->GetTrackCand();
16  for (size_t ii=0; ii<trackCand.GetNHits(); ii++)
17  {
18  PndTrackCandHit candHit = trackCand.GetSortedHit(ii);
19  Double_t dedx = 0.;
20 
21  if ( ( candHit.GetDetId()!=FairRootManager::Instance()->GetBranchId("FTSHit") && fMixMode==kFALSE) ||
22  ( candHit.GetDetId()!=FairRootManager::Instance()->GetBranchId("FTSHitMix") && fMixMode==kTRUE) ) continue;
23  PndFtsHit *ftsHit = (PndFtsHit*) fFtsHit->At(candHit.GetHitId());
24  if(!ftsHit) continue;
25  ftsRawCounts++;
26 
27  // compute dE/dx
28  //dedx = ftsHit->ComputedEdx(track, tuberadius);
29 
30  if(dedx != 0)
31  {
32  dedxvec.push_back(dedx);
33  ftsCounts++;
34  }
35  }
36 
37  if( ftsCounts > 0) {
38  // truncated mean
39  Double_t perc = 0.70;
40  // sort
41  std::sort(dedxvec.begin(), dedxvec.end());
42 
43  //truncated mean
44  Double_t sum = 0;
45  Int_t endnum = int(floor(ftsCounts * perc));
46 
47  // ****************************************
48  // CUT on n of hits: to have a meaningful
49  // truncated mean we require not to have less
50  // than 5 hits (in the already truncated list)
51  // ****************************************
52  if(endnum > 5) {
53  for(Int_t m = 0; m < endnum; m++) sum += dedxvec[m];
54  pidCand->SetSttMeanDEDX(sum/(Double_t) endnum); // else default in pidCand is SttDEDXMean = 0
55  }
56  }
57 
58  pidCand->SetSttHits(ftsRawCounts);
59  return kTRUE;
60 }
61 
__m128 m
Definition: P4_F32vec4.h:28
PndTrackCandHit GetSortedHit(UInt_t i)
Definition: PndTrackCand.h:54
TClonesArray * fFtsHit
PndSttHit TCA.
PndTrackCand GetTrackCand()
Definition: PndTrack.h:47
Double_t
PndMCTrack * track
Definition: anaLmdCluster.C:89
void SetSttMeanDEDX(Double_t val)
UInt_t GetNHits() const
Definition: PndTrackCand.h:59
ClassImp(PndAnaContFact)
Int_t GetHitId() const
Bool_t GetFtsInfo(PndTrack *track, PndPidCandidate *pid)
Int_t GetDetId() const
void SetSttHits(Int_t val)