]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Correct setting of non linearity correction in Tender
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Nov 2011 13:02:57 +0000 (13:02 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Nov 2011 13:02:57 +0000 (13:02 +0000)
Change default setting for R cut to 0.05 in RecoUtils
Move functions SetClusterMatchedToTrack SetTracksMatchedToCluster from Tender to RecoUtils
Correct setting of geometry matrix for fixed module option

ANALYSIS/TenderSupplies/AliEMCALTenderSupply.cxx
ANALYSIS/TenderSupplies/AliEMCALTenderSupply.h
EMCAL/AliEMCALRecoUtils.cxx
EMCAL/AliEMCALRecoUtils.h

index 5b3d009ffc5fd5846ca0ed0c1590a6b0896e3e55..ba3efbe56b552f1fd83f84da96dd5e288d8377cf 100644 (file)
@@ -318,7 +318,6 @@ void AliEMCALTenderSupply::ProcessEvent()
       continue;
     if  (!clust->IsEMCAL()) 
       continue;
-    
     if (fEMCALRecoUtils->ClusterContainsBadChannel(fEMCALGeo, clust->GetCellsAbsId(), clust->GetNCells())) {
       delete clusArr->RemoveAt(icluster);
       continue; //todo is it really needed to remove it? Or should we flag it?
@@ -331,15 +330,19 @@ void AliEMCALTenderSupply::ProcessEvent()
       }
     }
     
-    fEMCALRecoUtils->CorrectClusterEnergyLinearity(clust);
     if(fRecalDistToBadChannels) 
       fEMCALRecoUtils->RecalculateClusterDistanceToBadChannel(fEMCALGeo, cells, clust);  
     if(fReCalibCluster) 
       fEMCALRecoUtils->RecalibrateClusterEnergy(fEMCALGeo, clust, cells);
     if(fRecalClusPos) 
       fEMCALRecoUtils->RecalculateClusterPosition(fEMCALGeo, cells, clust);
+    
+    Float_t correctedEnergy = fEMCALRecoUtils->CorrectClusterEnergyLinearity(clust);
+    clust->SetE(correctedEnergy);
+    
   }
-  
+
+
   clusArr->Compress();
   
   // Track matching
@@ -356,77 +359,9 @@ void AliEMCALTenderSupply::ProcessEvent()
   
   fEMCALRecoUtils->FindMatches(event,0x0,fEMCALGeo);
   
-  SetClusterMatchedToTrack(event);
-  SetTracksMatchedToCluster(event);
-  
-}
-
-//_____________________________________________________
-void AliEMCALTenderSupply::SetClusterMatchedToTrack(AliESDEvent *event)
-{
-  // Checks if tracks are matched to EMC clusters and set the matched EMCAL cluster index to ESD track. 
-  
-  Int_t nTracks = event->GetNumberOfTracks();
-  for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
-    AliESDtrack* track = event->GetTrack(iTrack);
-    if (!track) {
-      AliWarning(Form("Could not receive track %d", iTrack));
-      continue;
-    }
-    Int_t matchClusIndex = fEMCALRecoUtils->GetMatchedClusterIndex(iTrack);               
-    track->SetEMCALcluster(matchClusIndex); //sets -1 if track not matched within residual
-    if(matchClusIndex != -1) 
-      track->SetStatus(AliESDtrack::kEMCALmatch);
-    else
-      track->ResetStatus(AliESDtrack::kEMCALmatch);
-  }
-  if (fDebugLevel>2) 
-    AliInfo("Track matched to closest cluster");       
-}
-
-//_____________________________________________________
-void AliEMCALTenderSupply::SetTracksMatchedToCluster(AliESDEvent *event)
-{
-  // Checks if EMC clusters are matched to ESD track.
-  // Adds track indexes of all the tracks matched to a cluster withing residuals in ESDCalocluster.
-  
-  for (Int_t iClus=0; iClus < event->GetNumberOfCaloClusters(); ++iClus) {
-    AliESDCaloCluster *cluster = event->GetCaloCluster(iClus);
-    if (!cluster->IsEMCAL()) 
-      continue;
-    
-    Int_t nTracks = event->GetNumberOfTracks();
-    TArrayI arrayTrackMatched(nTracks);
-    
-    // Get the closest track matched to the cluster
-    Int_t nMatched = 0;
-    Int_t matchTrackIndex = fEMCALRecoUtils->GetMatchedTrackIndex(iClus);
-    if (matchTrackIndex != -1) {
-      arrayTrackMatched[nMatched] = matchTrackIndex;
-      nMatched++;
-    }
-    
-    // Get all other tracks matched to the cluster
-    for(Int_t iTrk=0; iTrk<nTracks; ++iTrk) {
-      AliESDtrack* track = event->GetTrack(iTrk);
-      if(iTrk == matchTrackIndex) continue;
-      if(track->GetEMCALcluster() == iClus){
-        arrayTrackMatched[nMatched] = iTrk;
-        ++nMatched;
-      }
-    }
-    
-    arrayTrackMatched.Set(nMatched);
-    cluster->AddTracksMatched(arrayTrackMatched);
-    
-    Float_t eta= -999, phi = -999;
-    if (matchTrackIndex != -1) 
-      fEMCALRecoUtils->GetMatchedResiduals(iClus, eta, phi);
-    cluster->SetTrackDistance(phi, eta);
-  }
+  fEMCALRecoUtils->SetClusterMatchedToTrack(event);
+  fEMCALRecoUtils->SetTracksMatchedToCluster(event);
   
-  if (fDebugLevel>2) 
-    AliInfo("Cluster matched to tracks");      
 }
 
 //_____________________________________________________
@@ -464,6 +399,7 @@ Bool_t AliEMCALTenderSupply::InitMisalignMatrix()
   TObjArray *mobj = 0;
 
  if(fMisalignSurvey == kdefault){ //take default alignment corresponding to run no
+   printf("***DEFAULT MATRICES***\n!");
     AliOADBContainer emcalgeoCont(Form("emcal"));
     emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
     mobj=(TObjArray*)emcalgeoCont.GetObject(runGM,"EmcalMatrices");
@@ -482,13 +418,14 @@ Bool_t AliEMCALTenderSupply::InitMisalignMatrix()
   }
  }
 
- if(fMisalignSurvey == kSurveybyS){ //take alignment at module level
+ if(fMisalignSurvey == kSurveybyM){ //take alignment at module level
   if (runGM <= 140000) { //2010 data
     AliOADBContainer emcalgeoCont(Form("emcal2010"));
     emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
     mobj=(TObjArray*)emcalgeoCont.GetObject(100,"survey10");
     
   } else if (runGM>140000) { // 2011 LHC11a pass1 data
+    
     AliOADBContainer emcalgeoCont(Form("emcal2011"));
     emcalgeoCont.InitFromFile("$ALICE_ROOT/OADB/EMCAL/EMCALlocal2master.root",Form("AliEMCALgeo"));
     mobj=(TObjArray*)emcalgeoCont.GetObject(100,"survey11byM");                        
index 4f301797c99e2bf597bf1eccc747552dced586fc..cf08ef1a7eecb92f7174fa7249b3153f63ffa64c 100644 (file)
@@ -134,10 +134,6 @@ private:
 
   void     UpdateCells();
 
-  void     SetClusterMatchedToTrack (AliESDEvent *event);
-
-  void     SetTracksMatchedToCluster(AliESDEvent *event);
-
   void     UpdateClusters();
 
   AliEMCALGeometry      *fEMCALGeo;               //! EMCAL geometry
index 04dcd892e9548a757776355546f2d562a205e543..40e0b5326ffa9bd0d9d564af3e565999494b6c55 100644 (file)
@@ -78,7 +78,7 @@ AliEMCALRecoUtils::AliEMCALRecoUtils():
   fPIDUtils(),                            fAODFilterMask(32),
   fMatchedTrackIndex(0x0),                fMatchedClusterIndex(0x0), 
   fResidualEta(0x0), fResidualPhi(0x0),   fCutEtaPhiSum(kTRUE),                   fCutEtaPhiSeparate(kFALSE), 
-  fCutR(0.1),                             fCutEta(0.025),                         fCutPhi(0.05),
+  fCutR(0.05),                            fCutEta(0.025),                         fCutPhi(0.05),
   fClusterWindow(100),                    fMass(0.139),                           
   fStepSurface(10.),                      fStepCluster(5.),
   fTrackCutsType(kLooseCut),              fCutMinTrackPt(0),                      fCutMinNClusterTPC(-1), 
@@ -576,7 +576,7 @@ Float_t AliEMCALRecoUtils::CorrectClusterEnergyLinearity(AliVCluster* cluster){
   }
   
   Float_t energy = cluster->E();
-  
+
   switch (fNonLinearityFunction) {
       
     case kPi0MC:
@@ -647,7 +647,7 @@ Float_t AliEMCALRecoUtils::CorrectClusterEnergyLinearity(AliVCluster* cluster){
       break;
       
   }
-  
+
   return energy;
 
 }
@@ -1476,7 +1476,7 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,TObjArray * clusterArr,  Al
   
   AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
   AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
-
+  
   TObjArray *clusterArray = 0x0;
   if(!clusterArr)
     {
@@ -2067,6 +2067,76 @@ void AliEMCALRecoUtils::InitTrackCuts()
     }
 }
 
+
+//__________________________________________________________________
+void AliEMCALRecoUtils::SetClusterMatchedToTrack(AliESDEvent *event)
+{
+  // Checks if tracks are matched to EMC clusters and set the matched EMCAL cluster index to ESD track. 
+  
+  Int_t nTracks = event->GetNumberOfTracks();
+  for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
+    AliESDtrack* track = event->GetTrack(iTrack);
+    if (!track) {
+      AliWarning(Form("Could not receive track %d", iTrack));
+      continue;
+    }
+    Int_t matchClusIndex = GetMatchedClusterIndex(iTrack);                
+    track->SetEMCALcluster(matchClusIndex); //sets -1 if track not matched within residual
+    if(matchClusIndex != -1) 
+      track->SetStatus(AliESDtrack::kEMCALmatch);
+    else
+      track->ResetStatus(AliESDtrack::kEMCALmatch);
+  }
+    AliDebug(2,"Track matched to closest cluster");    
+}
+
+//_________________________________________________________________
+void AliEMCALRecoUtils::SetTracksMatchedToCluster(AliESDEvent *event)
+{
+  // Checks if EMC clusters are matched to ESD track.
+  // Adds track indexes of all the tracks matched to a cluster withing residuals in ESDCalocluster.
+  
+  for (Int_t iClus=0; iClus < event->GetNumberOfCaloClusters(); ++iClus) {
+    AliESDCaloCluster *cluster = event->GetCaloCluster(iClus);
+    if (!cluster->IsEMCAL()) 
+      continue;
+    
+    Int_t nTracks = event->GetNumberOfTracks();
+    TArrayI arrayTrackMatched(nTracks);
+    
+    // Get the closest track matched to the cluster
+    Int_t nMatched = 0;
+    Int_t matchTrackIndex = GetMatchedTrackIndex(iClus);
+    if (matchTrackIndex != -1) {
+      arrayTrackMatched[nMatched] = matchTrackIndex;
+      nMatched++;
+    }
+    
+    // Get all other tracks matched to the cluster
+    for(Int_t iTrk=0; iTrk<nTracks; ++iTrk) {
+      AliESDtrack* track = event->GetTrack(iTrk);
+      if(iTrk == matchTrackIndex) continue;
+      if(track->GetEMCALcluster() == iClus){
+        arrayTrackMatched[nMatched] = iTrk;
+        ++nMatched;
+      }
+    }
+    
+    //printf("Tender::SetTracksMatchedToCluster - cluster E %f, N matches %d, first match %d\n",cluster->E(),nMatched,arrayTrackMatched[0]);
+    
+    arrayTrackMatched.Set(nMatched);
+    cluster->AddTracksMatched(arrayTrackMatched);
+    
+    Float_t eta= -999, phi = -999;
+    if (matchTrackIndex != -1) 
+      GetMatchedResiduals(iClus, eta, phi);
+    cluster->SetTrackDistance(phi, eta);
+  }
+  
+    AliDebug(2,"Cluster matched to tracks");   
+}
+
+
 //___________________________________________________
 void AliEMCALRecoUtils::Print(const Option_t *) const 
 {
index 9644ee4d240fe83d81096df2790312b5d12a05a1..be9f9abf69adac0ef7d37abaa931b9d07971cbe6 100644 (file)
@@ -27,6 +27,7 @@ class TH2F;
 class AliVCluster;
 class AliVCaloCells;
 class AliVEvent;
+#include "AliESDEvent.h"
 
 // EMCAL includes
 class AliEMCALGeometry;
@@ -246,8 +247,8 @@ public:
   
   static Bool_t ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, Double_t emcalR, Double_t mass, Double_t step, Float_t &eta, Float_t &phi);
   static Bool_t ExtrapolateTrackToPosition(AliExternalTrackParam *trkParam, Float_t *clsPos, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
-  static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
-  Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, AliVCluster *cluster, Float_t &tmpEta, Float_t &tmpPhi);
+  static Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi);
+  Bool_t        ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, AliVCluster *cluster, Float_t &tmpEta, Float_t &tmpPhi);
 
   UInt_t   FindMatchedPosForCluster(Int_t clsIndex) const;
   UInt_t   FindMatchedPosForTrack(Int_t trkIndex)   const;
@@ -260,6 +261,9 @@ public:
   Bool_t   IsClusterMatched(Int_t clsIndex)         const;
   Bool_t   IsTrackMatched(Int_t trkIndex)           const;
 
+  void     SetClusterMatchedToTrack (AliESDEvent *event);
+  
+  void     SetTracksMatchedToCluster(AliESDEvent *event);  
 
   void     SwitchOnCutEtaPhiSum()                     { fCutEtaPhiSum      = kTRUE    ; 
                                                         fCutEtaPhiSeparate = kFALSE   ; }