AliPhysics  608b256 (608b256)
AliDalitzAODESD.cxx
Go to the documentation of this file.
1 #include "AliVTrack.h"
2 #include "AliVVertex.h"
3 #include "AliESDEvent.h"
4 #include "AliAODEvent.h"
5 #include "AliDalitzData.h"
6 #include "AliDalitzAODESD.h"
7 #include "AliESDtrack.h"
8 #include "AliAODTrack.h"
9 #include "AliLog.h"
10 #include "AliESDInputHandler.h"
11 #include "AliExternalTrackParam.h"
12 #include <iostream>
13 using namespace std;
14 
15 
16 
17 ClassImp( AliDalitzAODESD )
18 //-----------------------------------------------------------------------------------------------
19 
21  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam()->Pt();
22  else return fAODtrack->Pt();
23  }
25  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam()->Px();
26  else return fAODtrack->Px();
27  }
29  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam()->Py();
30  else return fAODtrack->Py();
31  }
33  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam()->Pz();
34  else return fAODtrack->Pz();
35  }
37  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam()->Phi();
38  else return fAODtrack->Phi();
39  }
40  const AliExternalTrackParam* AliDalitzAODESD::GetParamG(){
41  if (fIsESD==kTRUE) return fESDtrack->GetConstrainedParam();
42  else{ //AliExternalTrackParam* aodParam;
43  const AliExternalTrackParam* aodParam1=0;
44  //AliExternalTrackParam etp;
45  // etp.CopyFromVTrack(fAODtrack);
46 
47  std::cout<<"definio aodParam"<<std::endl;
48  // std::cout<<fAODtrack->Pt()<<endl;
49  // AliExternalTrackParam((AliVTrack*)fAODtrack);
50  // aodParam->CopyFromVTrack(fAODtrack);
51  std::cout<<"Copio"<<std::endl;
52  // const AliExternalTrackParam* aodParam1 =static_cast< const AliExternalTrackParam*>(*etp);
53  //const AliExternalTrackParam* aodParam1=etp;
54  aodParam1 = fAODtrack->GetOuterParam();
55  std::cout<<"Lista para retornar"<<std::endl;
56  //return aodParam1;
57  return aodParam1;
58  }
59  }
61  if (fIsESD==kTRUE) return fESDtrack->GetLabel();
62  else return fAODtrack->GetLabel();
63  }
65  if (fIsESD==kTRUE) return fESDtrack->GetPxPyPz(p);
66  else return fAODtrack->GetPxPyPz(p);
67  };
69  p[0]=b[0];
70  p[1]=b[1];
71  cov[0]=bCov[0];
72  cov[1]=bCov[1];
73  cov[2]=bCov[2];
74  };
76  if (fIsESD==kTRUE) return fESDtrack->GetSign();
77  else return fAODtrack->Charge();
78  };
80  if (fIsESD==kTRUE) return fESDtrack->Eta();
81  else return fAODtrack->Eta();
82  };
84  //Selection of Reconstructed electrons
85  Float_t bF[2],bCovF[3];
86  //fESDtrack->GetImpactParameters(bF,bCovF);//GetImpactParameters(b,cov)
87  if(fIsESD) fESDtrack->GetImpactParameters(bF,bCovF);
88  else {
89  bF[0]=fAODtrack->DCA();
90  bF[1]=fAODtrack->ZAtDCA();
91  fAODtrack->GetCovarianceXYZPxPyPz((Double_t*) bCovF);
92  }
93  b[0]=bF[0];//DCAXY
94  b[1]=bF[1];//DCAZ
95  bCov[0]=bCovF[0];
96  bCov[1]=bCovF[1];
97  bCov[2]=bCovF[2];
98  if (bCov[0]<=0 || bCov[2]<=0) {
99  // AliDebug(1, "Estimated b resolution lower or equal zero!");
100  bCov[0]=0; bCov[2]=0;
101  }
102  }
103  void AliDalitzAODESD::ComputeImpactParameter(const AliVVertex* vx,Double_t bmag){
104  AliExternalTrackParam etp; etp.CopyFromVTrack(fAODtrack);
105  //AliAODVertex *vtxAOD = aod->GetPrimaryVertex();
106  // activate the following two lines if you want to check that the event primary vertex is that reconstructed with tracks
107  // TString title=vtxAOD->GetTitle();
108  // if(!title.Contains("VertexerTracks")) { you could decide what to do in case the primary vertex is not reconstructed with tracks }
109  //Double_t b=aod->GetMagneticField();
110  if(!(etp.PropagateToDCA(vx,bmag,3.0,b,bCov))){
111  b[0]=-999;//DCAXY
112  b[1]=-999;//DCAZ
113  bCov[0]=-999;
114  bCov[1]=-999;
115  bCov[2]=-999;
116  }
117  // --> see above what dz and covdz represen
118  if (bCov[0]<=0 || bCov[2]<=0) {
119  // AliDebug(1, "Estimated b resolution lower or equal zero!");
120  bCov[0]=0; bCov[2]=0;
121  }
122  }
124  if (fIsESD==kTRUE) return fESDtrack->GetTPCNclsF();
125  else return fAODtrack->GetTPCNclsF();
126  }
128  if (fIsESD==kTRUE) return fESDtrack->GetNcls(1);
129  else return fAODtrack->GetTPCNcls();
130  }
132  if (fIsESD==kTRUE) return fESDtrack->GetTPCCrossedRows();
133  else return fAODtrack->GetTPCNCrossedRows();
134  }
136  if (fIsESD==kTRUE) return fESDtrack->GetNcls(0);
137  else return fAODtrack->GetITSNcls();
138  }
140  if (fIsESD==kTRUE) return fESDtrack->HasPointOnITSLayer(i);
141  else return fAODtrack->HasPointOnITSLayer(i);
142  }
144  return b[0];
145  }
147  return b[1];
148  }
149 
150 
double Double_t
Definition: External.C:58
Bool_t HasPointOnITSLayerG(Int_t i)
const AliExternalTrackParam * GetParamG()
int Int_t
Definition: External.C:63
Double_t GetTPCNclsFG()
float Float_t
Definition: External.C:68
Bool_t GetPxPyPzG(Double_t *p) const
void GetImpactParametersG(Float_t *p, Float_t *cov) const
Double_t GetTPCCrossedRowsG()
bool Bool_t
Definition: External.C:53
void ComputeImpactParameter()