#include "TH1F.h"
#include "TString.h"
#include "AliESDCaloCluster.h"
+#include "TVector3.h"
+#include "TLorentzVector.h"
AliHLTCaloHistoInvMass::AliHLTCaloHistoInvMass(TString det) :
fHistTwoClusterInvMass(NULL)
cEnergy[ic] = cluster->E();
}
- for(Int_t ipho = 0; ipho<(nc-1); ipho++) {
- for(Int_t jpho = ipho+1; jpho<nc; jpho++) {
+ for(Int_t ic = 0; ic<(nc-1); ic++) {
+
+ //Get the Lorentz vector of one photon
+ TVector3 iVec(cPos[ic]);
+ // iVec.Print();
+ iVec = iVec.Unit();
+ //iVec.Print();
+ iVec = cEnergy[ic] * iVec;
+ //iVec.Print();
+ TLorentzVector iLorentz(iVec, -1);
+
+
+ for(Int_t jc = ic+1; jc<nc; jc++) {
+
+ TVector3 jVec(cPos[ic]);
+ //jVec.Print();
+ jVec = jVec.Unit();
+ //jVec.Print();
+ jVec = cEnergy[jc] * jVec;
+ //jVec.Print();
+ TLorentzVector jLor(jVec, -1);
+
- // Calculate the theta angle between two photons
- Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
+
+// g.SetXYZM(gammaCandidate->GetPx(),gammaCandidate->GetPy(),gammaCandidate->GetPz(),fGammaMass);
+// TLorentzVector xyg = xy + g;
+
+
+// TVector3 vec( cPos[ic][0] - cPos[jc][0] , cPos[ic][1] - cPos[jc][2] , cPos[ic][1] - cPos[jc][2] );
+
+// // Calculate the theta angle between two photons
+// Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ic][0]-cPos[jc][0])*(cPos[ic][0]-cPos[jc][0]) +(cPos[ic][1]-cPos[jc][1])*(cPos[ic][1]-cPos[jc][1]))/460));
// Calculate the mass m of the pion candidate
- Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
+ //Double_t m =(TMath::Sqrt(2 * cEnergy[ic]* cEnergy[jc]*(1-TMath::Cos(theta))));
+
+ Double_t m = TMath::Sqrt( 2 *(cEnergy[ic]* cEnergy[jc] - iVec.Dot(jVec) ) );
fHistTwoClusterInvMass->Fill(m);
}
AliHLTCaloHistoMatchedTracks::AliHLTCaloHistoMatchedTracks(TString det) :
fHistMatchDistance(NULL),
- fHistDyxDz(NULL),
+ fHistDxyDz(NULL),
fHistMatchedEnergy(NULL),
fHistUnMatchedEnergy(NULL)
{
fHistArray->AddLast(fHistUnMatchedEnergy);
- fHistDyxDz = new TH2F( Form("%s fHist dXY dZ", det.Data()), Form("%s dXY - dZ distribution of track - cluster residuals", det.Data()), 50, 0, 50, 50, 0, 50);
- fHistDyxDz->GetXaxis()->SetTitle("sqrt(dx^2 + dy^2) (cm)");
- fHistDyxDz->GetYaxis()->SetTitle("dz (cm)");
- //fHistDyxDz->SetMarkerStyle(21);
- fHistArray->AddLast(fHistDyxDz);
+ fHistDxyDz = new TH2F( Form("%s fHist dXY dZ", det.Data()), Form("%s dXY - dZ distribution of track - cluster residuals", det.Data()), 50, 0, 50, 50, 0, 50);
+ fHistDxyDz->GetXaxis()->SetTitle("sqrt(dx^2 + dy^2) (cm)");
+ fHistDxyDz->GetYaxis()->SetTitle("dz (cm)");
+ //fHistDxyDz->SetMarkerStyle(21);
+ fHistArray->AddLast(fHistDxyDz);
}
delete fHistUnMatchedEnergy;
fHistUnMatchedEnergy = NULL;
- if (fHistDyxDz)
- delete fHistDyxDz;
- fHistDyxDz = NULL;
+ if (fHistDxyDz)
+ delete fHistDxyDz;
+ fHistDxyDz = NULL;
}
if(cluster->GetNTracksMatched() > 0) {
fHistMatchedEnergy->Fill(cluster->E());
fHistMatchDistance->Fill(cluster->GetEmcCpvDistance());
+ fHistDxyDz->Fill(cluster->GetTrackDx(), cluster->GetTrackDz());
} else {
fHistUnMatchedEnergy->Fill(cluster->E());
}
/** Histograms of the track - cluster residuals */
TH1F *fHistMatchDistance; //!transient
- TH2F *fHistDyxDz; //!transient
+ TH2F *fHistDxyDz; //!transient
/** Histograms of the energy distribution of mached and unmatched clusters */
TH1F *fHistMatchedEnergy; //!transient