]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliESDCaloCluster.cxx,.h: Removed fM11 and related getter and setter,
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 May 2008 08:15:22 +0000 (08:15 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 10 May 2008 08:15:22 +0000 (08:15 +0000)
added fTOF and related getter and setter, increased the class def to 8
AliAODCaloCluster.cxx,.h: Added fTOF and the related getters and
setters, increased the class def  5 . Added the method
GetMomentum(TLorentzVector, Double v) like the one in ESDCaloCluster

AliAODCluster.h: Added a Getter to return fLabels array

AliAODEvent.cxx.h: Added methods to get the list of aodCaloClusters of
PHOS or EMCAL separately, as it is done in AliESDEvent.

AliEMCALReconstructor.cxx, AliPHOSReconstructor.cxx: Removed  filling
of  M11 and added filling of TOF

AliAnalysisTaskESDfilter.cxx: Added TOF and track matching information
to CaloClusters.

AliHLTPHOSESDMaker.cxx: Remove setting of fM11 (the fTOF should be added)

Gustavo

ANALYSIS/AliAnalysisTaskESDfilter.cxx
EMCAL/AliEMCALReconstructor.cxx
HLT/PHOS/AliHLTPHOSESDMaker.cxx
PHOS/AliPHOSReconstructor.cxx
STEER/AliAODCaloCluster.cxx
STEER/AliAODCaloCluster.h
STEER/AliAODCluster.h
STEER/AliAODEvent.cxx
STEER/AliAODEvent.h
STEER/AliESDCaloCluster.cxx
STEER/AliESDCaloCluster.h

index d2ab24d810e0aadb9c4a348045bd70b3a9dcd60a..83c4c795caf5593faeafed17489d8c937524377c 100644 (file)
@@ -841,12 +841,21 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD() {
       
       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
index 7a1c97154e4383fc7a17f3ca2786c271985e8ffd..a3e6d153b2a28a5f20744db526099e7e33588b8f 100644 (file)
@@ -411,7 +411,7 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
       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];
index 0fb8234ce326ac4f194d662b65ccff58b2e13aee..cd9b2ef755e66f9908cdaa3a602ca37293da74df 100644 (file)
@@ -152,7 +152,6 @@ AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClust
       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);
index d026f57ad438b97fe954a8fad2bfc223048c6b09..813cf1d052f413b53651738c62ee19979b5655e3 100644 (file)
@@ -298,8 +298,8 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     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);
index 5c62f837d2e6f4b6c6c44e59b5dfd63c81a3f8a2..4b8a2765f65b7ac8ace381e0d3c8607110dbaf49 100644 (file)
@@ -20,6 +20,7 @@
 //     Author: Markus Oldenburg, CERN
 //-------------------------------------------------------------------------
 
+#include <TLorentzVector.h>
 #include "AliAODCaloCluster.h"
 
 ClassImp(AliAODCaloCluster)
@@ -31,9 +32,9 @@ AliAODCaloCluster::AliAODCaloCluster() :
   fDispersion(-1),
   fM20(0.),
   fM02(0.),
-  fM11(0.),
   fEmcCpvDistance(-999.),
-  fNExMax(0),
+  fNExMax(0), 
+  fTOF(0.),
   fTracksMatched(),
   fNCells(0),
   fCellsAbsId(),
@@ -57,9 +58,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fDispersion(-1),
   fM20(0.),
   fM02(0.),
-  fM11(0.),
   fEmcCpvDistance(-999.),
   fNExMax(0),
+  fTOF(0.),
   fTracksMatched(),
   fNCells(0),
   fCellsAbsId(),
@@ -83,9 +84,9 @@ AliAODCaloCluster::AliAODCaloCluster(Int_t id,
   fDispersion(-1),
   fM20(0.),
   fM02(0.),
-  fM11(0.),
   fEmcCpvDistance(-999.),
   fNExMax(0),
+  fTOF(0.),
   fTracksMatched(),
   fNCells(0),
   fCellsAbsId(),
@@ -111,9 +112,9 @@ AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
   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(),
@@ -151,9 +152,9 @@ AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
     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;
@@ -189,3 +190,28 @@ Bool_t AliAODCaloCluster::HasTrackMatched(TObject *trk) const
   }
   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) ; 
+  
+}
index 3ce741aaee6740d9a90ebd18c6a03b4302b6e181..6a7da2922afd2f054b48b8907c1886e1d95e70bb 100644 (file)
@@ -16,6 +16,8 @@
 #include <TRefArray.h>
 #include <TArrayS.h>
 
+class TLorentzVector;
+
 class AliAODCaloCluster : public AliAODCluster {
 
  public:
@@ -49,9 +51,9 @@ class AliAODCaloCluster : public AliAODCluster {
   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); }
@@ -78,26 +80,28 @@ class AliAODCaloCluster : public AliAODCluster {
   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); }
@@ -109,9 +113,9 @@ class AliAODCaloCluster : public AliAODCluster {
   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.
 
@@ -119,7 +123,7 @@ class AliAODCaloCluster : public AliAODCluster {
   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
index 03db84e8155479943d29c4754047aab0d4025409..f3e11712be40b377982abb7b41912d0ef8675ff2 100644 (file)
@@ -74,6 +74,7 @@ class AliAODCluster : public TObject {
 
   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; }
index 9cdb7915b2613dc14cefde44be2bc84b0cbbcc03..e5d0a4247e3956b38b8d38e1e737e0b5d0e23de1 100644 (file)
@@ -332,6 +332,47 @@ void AliAODEvent::ClearStd()
   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
 {
index 7389f01879b1a37ca689c8cdaa35a4177344ae13..2639342112bc5f42b309261b075489f25fbb82ef 100644 (file)
@@ -128,6 +128,10 @@ class AliAODEvent : public AliVEvent {
   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(); }
index 3c3bc9f9c8d2016b50d314ab781a73a33e2ac208..60c417b7ec7ee76694aba61de1fc475750b143f1 100644 (file)
@@ -45,12 +45,11 @@ AliESDCaloCluster::AliESDCaloCluster() :
   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 
@@ -75,12 +74,12 @@ AliESDCaloCluster::AliESDCaloCluster(const AliESDCaloCluster& clus) :
   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 
@@ -127,7 +126,6 @@ AliESDCaloCluster &AliESDCaloCluster::operator=(const AliESDCaloCluster& source)
   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];
@@ -157,6 +155,7 @@ AliESDCaloCluster &AliESDCaloCluster::operator=(const AliESDCaloCluster& source)
 
   fNExMax = source.fNExMax;
   fClusterType = source.fClusterType;
+  fTOF = source.fTOF;
 
   //not in use
   if(source.fTracksMatched){
index 6fc951eb114e67ba9101b63e8fa317d7729f658b..c10afab34273a045962f5b79d8c2be6c85c636e1 100644 (file)
@@ -75,9 +75,6 @@ public:
   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; }
 
@@ -87,19 +84,22 @@ public:
   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(); 
@@ -159,15 +159,16 @@ protected:
   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