]>
Commit | Line | Data |
---|---|---|
67427ff7 | 1 | /*************************************************************************** |
2 | * | |
3 | * $Id$ | |
4 | * | |
5 | * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu | |
6 | *************************************************************************** | |
7 | * | |
8 | * Description: part of STAR HBT Framework: AliFemtoMaker package | |
9 | * a cut to remove "shared" and "split" pairs | |
10 | * | |
11 | *************************************************************************** | |
12 | * | |
13 | * | |
14 | **************************************************************************/ | |
15 | ||
b2f60a91 | 16 | #include "AliFemtoShareQualityPairCut.h" |
67427ff7 | 17 | #include <string> |
18 | #include <cstdio> | |
19 | ||
20 | #ifdef __ROOT__ | |
21 | ClassImp(AliFemtoShareQualityPairCut) | |
22 | #endif | |
23 | ||
24 | //__________________ | |
0215f606 | 25 | AliFemtoShareQualityPairCut::AliFemtoShareQualityPairCut(): |
26 | fNPairsPassed(0), | |
27 | fNPairsFailed(0), | |
28 | fShareQualityMax(1.0) | |
29 | { | |
67427ff7 | 30 | } |
31 | //__________________ | |
32 | AliFemtoShareQualityPairCut::~AliFemtoShareQualityPairCut(){ | |
33 | /* no-op */ | |
34 | } | |
35 | //__________________ | |
36 | bool AliFemtoShareQualityPairCut::Pass(const AliFemtoPair* pair){ | |
37 | bool temp; | |
38 | ||
39 | Int_t nh = 0; | |
40 | Int_t an = 0; | |
41 | Int_t ns = 0; | |
42 | ||
65423af9 | 43 | for (unsigned int imap=0; imap<pair->Track1()->Track()->TPCclusters().GetNbits(); imap++) { |
67427ff7 | 44 | // If both have clusters in the same row |
65423af9 | 45 | if (pair->Track1()->Track()->TPCclusters().TestBitNumber(imap) && |
46 | pair->Track2()->Track()->TPCclusters().TestBitNumber(imap)) { | |
67427ff7 | 47 | // Do they share it ? |
65423af9 | 48 | if (pair->Track1()->Track()->TPCsharing().TestBitNumber(imap) && |
49 | pair->Track2()->Track()->TPCsharing().TestBitNumber(imap)) | |
67427ff7 | 50 | { |
51 | // cout << "A shared cluster !!!" << endl; | |
52 | // cout << "imap idx1 idx2 " | |
53 | // << imap << " " | |
54 | // << tP1idx[imap] << " " << tP2idx[imap] << endl; | |
55 | an++; | |
56 | nh+=2; | |
57 | ns+=2; | |
58 | } | |
59 | ||
60 | // Different hits on the same padrow | |
61 | else { | |
62 | an--; | |
63 | nh+=2; | |
64 | } | |
65 | } | |
65423af9 | 66 | else if (pair->Track1()->Track()->TPCclusters().TestBitNumber(imap) || |
67 | pair->Track2()->Track()->TPCclusters().TestBitNumber(imap)) { | |
67427ff7 | 68 | // One track has a hit, the other does not |
69 | an++; | |
70 | nh++; | |
71 | } | |
72 | } | |
73 | ||
74 | Float_t hsmval = 0.0; | |
75 | Float_t hsfval = 0.0; | |
76 | ||
77 | if (nh >0) { | |
78 | hsmval = an*1.0/nh; | |
79 | hsfval = ns*1.0/nh; | |
80 | } | |
81 | // if (hsmval > -0.4) { | |
82 | cout << "Pair quality: " << hsmval << " " << an << " " << nh << " " | |
65423af9 | 83 | << (pair->Track1()->Track()) << " " |
84 | << (pair->Track2()->Track()) << endl; | |
85 | cout << "Bits: " << pair->Track1()->Track()->TPCclusters().GetNbits() << endl; | |
67427ff7 | 86 | // } |
87 | if (hsfval > 0.0) { | |
88 | cout << "Pair sharity: " << hsfval << " " << ns << " " << nh << " " << hsmval << " " << an << " " << nh << endl; | |
89 | } | |
90 | ||
91 | temp = hsmval < fShareQualityMax; | |
92 | ||
93 | temp ? fNPairsPassed++ : fNPairsFailed++; | |
94 | return temp; | |
95 | } | |
96 | //__________________ | |
97 | AliFemtoString AliFemtoShareQualityPairCut::Report(){ | |
98 | string Stemp = "AliFemtoShareQuality Pair Cut - remove shared and split pairs\n"; char Ctemp[100]; | |
99 | sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed); | |
100 | Stemp += Ctemp; | |
101 | AliFemtoString returnThis = Stemp; | |
102 | return returnThis;} | |
103 | //__________________ | |
104 | ||
105 | void AliFemtoShareQualityPairCut::SetShareQualityMax(Double_t aShareQualityMax) { | |
106 | fShareQualityMax = aShareQualityMax; | |
107 | } | |
108 | ||
109 | Double_t AliFemtoShareQualityPairCut::GetAliFemtoShareQualityMax() { | |
110 | return fShareQualityMax; | |
111 | } |