Fixing effc++ warnings and code rule conformance
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoShareQualityTPCEntranceSepPairCut.cxx
1 /////////////////////////////////////////////////////////////////////////////
2 //                                                                         //
3 // AliFemtoShareQualityTPCEntranceSepPairCut - a pair cut which checks     //
4 // for some pair qualities that attempt to identify slit/doubly            //
5 // reconstructed tracks and also selects pairs based on their separation   //
6 // at the entrance to the TPC                                              //
7 //                                                                         //
8 /////////////////////////////////////////////////////////////////////////////
9 /***************************************************************************
10  *
11  * $Id: AliFemtoShareQualityTPCEntranceSepPairCut.cxx,v 1.1.2.1 2007/10/19 13:35:33 akisiel Exp $
12  *
13  * Author: Adam Kisiel, Ohio State, kisiel@mps.ohio-state.edu
14  ***************************************************************************
15  *
16  * Description: part of STAR HBT Framework: AliFemtoMaker package
17  *   a cut to remove "shared" and "split" pairs
18  *
19  ***************************************************************************
20  *
21  *
22  **************************************************************************/
23
24 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
25 #include <string>
26 #include <cstdio>
27
28 #ifdef __ROOT__
29 ClassImp(AliFemtoShareQualityTPCEntranceSepPairCut)
30 #endif
31
32 //__________________
33 AliFemtoShareQualityTPCEntranceSepPairCut::AliFemtoShareQualityTPCEntranceSepPairCut():
34   AliFemtoShareQualityPairCut(),
35   fDTPCMin(0)
36 {
37 }
38 //__________________
39 AliFemtoShareQualityTPCEntranceSepPairCut::AliFemtoShareQualityTPCEntranceSepPairCut(const AliFemtoShareQualityTPCEntranceSepPairCut& c) : 
40   AliFemtoShareQualityPairCut(c),
41   fDTPCMin(0)
42
43   fDTPCMin = c.fDTPCMin;
44 }
45
46 //__________________
47 AliFemtoShareQualityTPCEntranceSepPairCut::~AliFemtoShareQualityTPCEntranceSepPairCut(){
48   /* no-op */
49 }
50 //__________________
51 bool AliFemtoShareQualityTPCEntranceSepPairCut::Pass(const AliFemtoPair* pair){
52   // Accept pairs based on their TPC entrance separation and
53   // quality and sharity
54   bool temp = true;
55   
56   double distx = pair->Track1()->Track()->NominalTpcEntrancePoint().x() - pair->Track2()->Track()->NominalTpcEntrancePoint().x();
57   double disty = pair->Track1()->Track()->NominalTpcEntrancePoint().y() - pair->Track2()->Track()->NominalTpcEntrancePoint().y();
58   double distz = pair->Track1()->Track()->NominalTpcEntrancePoint().z() - pair->Track2()->Track()->NominalTpcEntrancePoint().z();
59   double dist = sqrt(distx*distx + disty*disty + distz*distz);
60
61   temp = dist > fDTPCMin;
62
63   if (temp) {
64     temp = AliFemtoShareQualityPairCut::Pass(pair);
65   }
66   else
67     fNPairsFailed++;
68
69   return temp;
70 }
71 //__________________
72 AliFemtoString AliFemtoShareQualityTPCEntranceSepPairCut::Report(){
73   // Prepare a report from the execution
74   string stemp = "AliFemtoShareQualityTPCEntranceSep Pair Cut - remove shared and split pairs and pairs with small separation at the entrance to the TPC\n";  char ctemp[100];
75   sprintf(ctemp,"Accept pair with TPC entrance separation more that %f",fDTPCMin);
76   stemp += ctemp;
77   sprintf(ctemp,"Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
78   stemp += ctemp;
79   AliFemtoString returnThis = stemp;
80   return returnThis;}
81 //__________________
82
83 TList *AliFemtoShareQualityTPCEntranceSepPairCut::ListSettings()
84 {
85   // return a list of settings in a writable form
86   TList *tListSetttings =  AliFemtoShareQualityPairCut::ListSettings();
87   char buf[200];
88   snprintf(buf, 200, "AliFemtoShareQualityTPCEntranceSepPairCut.tpcentsepmin=%f", fDTPCMin);
89   tListSetttings->AddLast(new TObjString(buf));
90
91   return tListSetttings;
92 }
93
94 void AliFemtoShareQualityTPCEntranceSepPairCut::SetTPCEntranceSepMinimum(double dtpc)
95 {
96   fDTPCMin = dtpc;
97 }