caloCluster->SetCaloCluster(cluster->GetDistanceToBadChannel(),
cluster->GetClusterDisp(),
- cluster->GetM20(), cluster->GetM02(), cluster->GetM11(),
- cluster->GetEmcCpvDistance(), cluster->GetNExMax()) ;
+ cluster->GetM20(), cluster->GetM02(),
+ cluster->GetEmcCpvDistance(),
+ cluster->GetNExMax(),cluster->GetTOF()) ;
caloCluster->SetNCells(cluster->GetNCells());
caloCluster->SetCellsAbsId(cluster->GetCellsAbsId());
caloCluster->SetCellsAmplitudeFraction(cluster->GetCellsAmplitudeFraction());
+
+ TArrayI* matchedT = cluster->GetTracksMatched();
+ if (matchedT) {
+ for (Int_t im = 0; im < matchedT->GetSize(); im++) {
+ caloCluster->AddTrackMatched((esd->GetTrack(im)));
+ }
+ }
+
}
caloClusters.Expand(jClusters); // resize TObjArray to 'remove' slots for pseudo clusters
// end of loop on calo clusters
ec->SetClusterChi2(-1); //not yet implemented
ec->SetM02(elipAxis[0]*elipAxis[0]) ;
ec->SetM20(elipAxis[1]*elipAxis[1]) ;
- ec->SetM11(-1) ; //not yet implemented
+ ec->SetTOF(clust->GetTime()) ; //time-of-fligh
TArrayI arrayTrackMatched(1);// Only one track, temporal solution.
arrayTrackMatched[0]= matchedTrack[iClust];
caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
caloCluster->SetM20(caloClusterStruct->fM20);
caloCluster->SetM02(caloClusterStruct->fM02);
- caloCluster->SetM11(caloClusterStruct->fM11);
caloCluster->SetNExMax(caloClusterStruct->fNExMax);
caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
ec->SetNExMax(emcRP->GetNExMax()); //number of local maxima
ec->SetEmcCpvDistance(ts->GetCpvDistance("r")); //Only radius, what about separate x,z????
ec->SetClusterChi2(-1); //not yet implemented
- ec->SetM11(-1) ; //not yet implemented
-
+ ec->SetTOF(emcRP->GetTime()); //Time of flight
+
//Cells contributing to clusters
ec->SetNCells(cellMult);
ec->SetCellsAbsId(absIdList);
// Author: Markus Oldenburg, CERN
//-------------------------------------------------------------------------
+#include <TLorentzVector.h>
#include "AliAODCaloCluster.h"
ClassImp(AliAODCaloCluster)
fDispersion(-1),
fM20(0.),
fM02(0.),
- fM11(0.),
fEmcCpvDistance(-999.),
- fNExMax(0),
+ fNExMax(0),
+ fTOF(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(),
fDispersion(-1),
fM20(0.),
fM02(0.),
- fM11(0.),
fEmcCpvDistance(-999.),
fNExMax(0),
+ fTOF(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(),
fDispersion(-1),
fM20(0.),
fM02(0.),
- fM11(0.),
fEmcCpvDistance(-999.),
fNExMax(0),
+ fTOF(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(),
fDispersion(clus.fDispersion),
fM20(clus.fM20),
fM02(clus.fM02),
- fM11(clus.fM11),
fEmcCpvDistance(clus.fEmcCpvDistance),
fNExMax(clus.fNExMax),
+ fTOF(clus.fTOF),
fTracksMatched(clus.fTracksMatched),
fNCells(clus.fNCells),
fCellsAbsId(),
fDispersion = clus.fDispersion;
fM20 = clus.fM20;
fM02 = clus.fM02;
- fM11 = clus.fM11;
fEmcCpvDistance = clus.fEmcCpvDistance;
fNExMax = clus.fNExMax;
+ fTOF = clus.fTOF;
fTracksMatched = clus.fTracksMatched;
fNCells= clus. fNCells;
}
return kFALSE;
}
+
+//_______________________________________________________________________
+void AliAODCaloCluster::GetMomentum(TLorentzVector& p, Double_t *vertex ) {
+ // Returns TLorentzVector with momentum of the cluster. Only valid for clusters
+ // identified as photons or pi0 (overlapped gamma) produced on the vertex
+ //Vertex can be recovered with esd pointer doing:
+ //" Double_t vertex[3] ; esd->GetVertex()->GetXYZ(vertex) ; "
+
+ Double32_t energy = E();
+ Double32_t pos[3];
+ GetPosition(pos);
+
+ if(vertex){//calculate direction from vertex
+ pos[0]-=vertex[0];
+ pos[1]-=vertex[1];
+ pos[2]-=vertex[2];
+ }
+
+ Double_t r = TMath::Sqrt(pos[0]*pos[0]+
+ pos[1]*pos[1]+
+ pos[2]*pos[2] ) ;
+
+ p.SetPxPyPzE( energy*pos[0]/r, energy*pos[1]/r, energy*pos[2]/r, energy) ;
+
+}
#include <TRefArray.h>
#include <TArrayS.h>
+class TLorentzVector;
+
class AliAODCaloCluster : public AliAODCluster {
public:
Double_t GetDispersion() const { return fDispersion; }
Double_t GetM20() const { return fM20; }
Double_t GetM02() const { return fM02; }
- Double_t GetM11() const { return fM11; }
Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
UShort_t GetNExMax() const { return fNExMax; }
+ Double_t GetTOF() const { return fTOF; }
Int_t GetNTracksMatched() const { return fTracksMatched.GetEntriesFast(); }
TObject *GetTrackMatched(Int_t i) const { return fTracksMatched.At(i); }
void SetDispersion(Double_t disp) { fDispersion = disp; }
void SetM20(Double_t m20) { fM20 = m20; }
void SetM02(Double_t m02) { fM02 = m02; }
- void SetM11(Double_t m11) { fM11 = m11; }
void SetEmcCpvDistance(Double_t emcCpvDist) { fEmcCpvDistance = emcCpvDist; }
void SetNExMax(UShort_t nExMax) { fNExMax = nExMax; }
+ void SetTOF(Double_t tof) { fTOF = tof; }
void SetCaloCluster(Double_t dist = -999.,
Double_t disp = -1.,
Double_t m20 = 0.,
Double_t m02 = 0.,
- Double_t m11 = 0.,
Double_t emcCpvDist = -999.,
- UShort_t nExMax = 0)
+ UShort_t nExMax = 0,
+ Double_t tof = 0.)
{
fDistToBadChannel = dist;
fDispersion = disp;
fM20 = m20;
fM02 = m02;
- fM11 = m11;
fEmcCpvDistance = emcCpvDist;
fNExMax = nExMax;
+ fTOF = tof ;
}
+
+ void GetMomentum(TLorentzVector& p, Double_t * vertexPosition );
void AddTrackMatched(TObject *trk) { fTracksMatched.Add(trk); }
void RemoveTrackMatched(TObject *trk) { fTracksMatched.Remove(trk); }
Double32_t fDispersion; // cluster dispersion, for shape analysis
Double32_t fM20; // 2-nd moment along the main eigen axis
Double32_t fM02; // 2-nd moment along the second eigen axis
- Double32_t fM11; // 2-nd mixed moment Mxy
Double32_t fEmcCpvDistance; // the distance from PHOS EMC rec.point to the closest CPV rec.point
UShort_t fNExMax; // number of (Ex-)maxima before unfolding
+ Double32_t fTOF; ////[0,0,12] time-of-flight
TRefArray fTracksMatched; // references to tracks close to cluster. First entry is the most likely match.
UShort_t *fCellsAbsId; //[fNCells] array of cell absId numbers
Double32_t *fCellsAmpFraction; //[fNCells][0.,1.,16] array with cell amplitudes fraction.
- ClassDef(AliAODCaloCluster,3);
+ ClassDef(AliAODCaloCluster,5);
};
#endif
Int_t GetID() const { return fID; }
Int_t GetLabel(UInt_t i) const;
+ Int_t * GetLabels() const {return fLabel ; }
UInt_t GetNLabel() const { return (UInt_t)fNLabel; }
Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
Char_t GetType() const { return fType; }
fPmdClusters ->Clear();
}
+//_________________________________________________________________
+Int_t AliAODEvent::GetPHOSClusters(TRefArray *clusters) const
+{
+ // fills the provided TRefArray with all found phos clusters
+
+ clusters->Clear();
+
+ AliAODCaloCluster *cl = 0;
+ for (Int_t i = 0; i < GetNCaloClusters() ; i++) {
+
+ if ( (cl = GetCaloCluster(i)) ) {
+ if (cl->IsPHOSCluster()){
+ clusters->Add(cl);
+ //AliDebug(1,Form("IsPHOS cluster %d Size: %d \n",i,clusters->GetEntriesFast()));
+ }
+ }
+ }
+ return clusters->GetEntriesFast();
+}
+
+//_________________________________________________________________
+Int_t AliAODEvent::GetEMCALClusters(TRefArray *clusters) const
+{
+ // fills the provided TRefArray with all found emcal clusters
+
+ clusters->Clear();
+
+ AliAODCaloCluster *cl = 0;
+ for (Int_t i = 0; i < GetNCaloClusters(); i++) {
+
+ if ( (cl = GetCaloCluster(i)) ) {
+ if (cl->IsEMCALCluster()){
+ clusters->Add(cl);
+ //AliDebug(1,Form("IsEMCAL cluster %d Size: %d \n",i,clusters->GetEntriesFast()));
+ }
+ }
+ }
+ return clusters->GetEntriesFast();
+}
+
+
//______________________________________________________________________________
Int_t AliAODEvent::GetMuonTracks(TRefArray *muonTracks) const
{
Int_t AddCaloCluster(const AliAODCaloCluster* clus)
{new((*fCaloClusters)[fCaloClusters->GetEntriesFast()]) AliAODCaloCluster(*clus); return fCaloClusters->GetEntriesFast()-1;}
+ Int_t GetEMCALClusters(TRefArray *clusters) const;
+ Int_t GetPHOSClusters(TRefArray *clusters) const;
+
+
// -- FMD Cluster
TClonesArray *GetFmdClusters() const { return fFmdClusters; }
Int_t GetNFmdClusters() const { return fFmdClusters->GetEntriesFast(); }
fChi2(0),
fM20(0),
fM02(0),
- fM11(0),
fEmcCpvDistance(1024),
fDistToBadChannel(1024),
fID(0),
fNExMax(0),
- fClusterType(kUndef)
+ fClusterType(kUndef), fTOF(0.)
{
//
// The default ESD constructor
fChi2(clus.fChi2),
fM20(clus.fM20),
fM02(clus.fM02),
- fM11(clus.fM11),
fEmcCpvDistance(clus.fEmcCpvDistance),
fDistToBadChannel(clus.fDistToBadChannel),
fID(clus.fID),
fNExMax(clus.fNExMax),
- fClusterType(clus.fClusterType)
+ fClusterType(clus.fClusterType),
+ fTOF(clus.fTOF)
{
//
// The copy constructor
fChi2 = source.fChi2;
fM20 = source.fM20;
fM02 = source.fM02;
- fM11 = source.fM11;
fEmcCpvDistance = source.fEmcCpvDistance;
fDistToBadChannel = source.fDistToBadChannel ;
for(Int_t i=0; i<AliPID::kSPECIESN; i++) fPID[i] = source.fPID[i];
fNExMax = source.fNExMax;
fClusterType = source.fClusterType;
+ fTOF = source.fTOF;
//not in use
if(source.fTracksMatched){
void SetM02(Float_t m02) { fM02 = m02; }
Double_t GetM02() const { return fM02; }
- void SetM11(Float_t m11) { fM11 = m11; }
- Double_t GetM11() const { return fM11; }
-
void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; }
UChar_t GetNExMax() const { return fNExMax; }
void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
Double_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
+ void SetTOF(Double_t tof) { fTOF = tof; }
+ Double_t GetTOF() const { return fTOF; }
+
void AddTracksMatched(TArrayI & array) { fTracksMatched = new TArrayI(array) ; }
void AddLabels(TArrayI & array) { fLabels = new TArrayI(array) ; }
-
+
TArrayI * GetTracksMatched() const {return fTracksMatched;}
TArrayI * GetLabels() const {return fLabels;}
-
+
Int_t GetTrackMatched() const
{if( fTracksMatched && fTracksMatched->GetSize() >0) return fTracksMatched->At(0);
else return -1;} //Most likely the track associated to the cluster
Int_t GetLabel() const
{if( fLabels && fLabels->GetSize() >0) return fLabels->At(0);
else return -1;} //Most likely the track associated to the cluster
-
+
Int_t GetNTracksMatched() const {if (fTracksMatched) return fTracksMatched->GetSize();
else return -1;}
Int_t GetNLabels() const { if (fLabels) return fLabels->GetSize();
Double32_t fChi2; // chi2 of cluster fi
Double32_t fM20; // 2-nd moment along the main eigen axis
Double32_t fM02; // 2-nd moment along the second eigen axis
- Double32_t fM11; // 2-nd mixed moment Mxy
+
Double32_t fEmcCpvDistance; // the distance from PHOS EMC rec.point to the closest CPV rec.point
Double32_t fDistToBadChannel; // Distance to nearest bad channel
Double32_t fPID[AliPID::kSPECIESN]; //[0,1,8]"detector response probabilities" (for the PID)
Int_t fID; // Unique Id of the cluster
UChar_t fNExMax ; // number of (Ex-)maxima before unfolding
Char_t fClusterType; // Flag for different cluster type/versions
+ Double32_t fTOF; //[0,0,12] time-of-flight
- ClassDef(AliESDCaloCluster,7) //ESDCaloCluster
+ ClassDef(AliESDCaloCluster,8) //ESDCaloCluster
};
#endif