Access to EMCAL Local2Master matrices via OADB
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Feb 2011 18:31:36 +0000 (18:31 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 26 Feb 2011 18:31:36 +0000 (18:31 +0000)
Marco Bregant <Marco.Bregant@subatech.in2p3.fr>, Magali Estienne <Magali.Estienne@subatech.in2p3.fr>

14 files changed:
JETAN/AliAnalysisTaskJets.cxx
JETAN/AliJetAODFillUnitArrayTracks.cxx
JETAN/AliJetAODReader.cxx
JETAN/AliJetAODReader.h
JETAN/AliJetESDFillUnitArrayTracks.cxx
JETAN/AliJetESDReader.cxx
JETAN/AliJetESDReader.h
JETAN/AliJetFillUnitArray.h
JETAN/AliJetReader.cxx
JETAN/AliJetReader.h
JETAN/AliJetReaderHeader.cxx
JETAN/AliJetReaderHeader.h
JETAN/CMakelibJETAN.pkg
OADB/PWG4/JetReconstruction/EMCALlocal2master.root [new file with mode: 0644]

index a9bb38b..f15db37 100644 (file)
@@ -218,6 +218,12 @@ void AliAnalysisTaskJets::Init()
   AliJetReaderHeader *header = (AliJetReaderHeader*)fJetFinder->GetReader()->GetReaderHeader();
   fOpt = header->GetDetector();
 
+// AODB path for Jetan Analysis... if not alread defined, use the standard one
+if ((!(((AliJetReader*) fJetFinder->GetReader())->GetJetanOADBPath()).Length())) {
+((AliJetReader*) fJetFinder->GetReader())->SetJetanOADBPath(AliAnalysisManager::GetOADBPath());
+}
+else Info( "Init"," OADBPath for Jetan was already defined (config file?) as %s",(char*)((fJetFinder->GetReader()->GetJetanOADBPath()).Data()));
+       
   // Initialise Jet Analysis
   if(fOpt == 0) fJetFinder->Init();
   else fJetFinder->InitTask(fChain); // V2
index c4bd4ed..49feeae 100644 (file)
@@ -111,7 +111,7 @@ AliJetAODFillUnitArrayTracks& AliJetAODFillUnitArrayTracks::operator=(const AliJ
 void AliJetAODFillUnitArrayTracks::InitParameters()
 {
   //  fHadCorr        = 0;     // For hadron correction
-  fNumUnits = fGeom->GetNCells();      // Number of towers in EMCAL
+  fNumUnits = fGeom->GetEMCGeometry()->GetNCells();      // Number of towers in EMCAL
 
   fTPCGrid->GetAccParam(fNphi,fNeta,fPhiMin, 
                        fPhiMax,fEtaMin,fEtaMax);
@@ -279,11 +279,11 @@ void AliJetAODFillUnitArrayTracks::Exec(Option_t* const /*option*/)
                {
                  Double_t phimin0 = 0., phimin1 = 0., phimin2 = 0., phimin3 = 0., phimin4 = 0.;
                  Double_t phimax0 = 0., phimax1 = 0., phimax2 = 0., phimax3 = 0., phimax4 = 0.;
-                 fGeom->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
-                 fGeom->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
-                 fGeom->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
-                 fGeom->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
-                 fGeom->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
                  Int_t n0 = fGrid0->GetNEntries();
                  Int_t n1 = fGrid1->GetNEntries();
                  Int_t n2 = fGrid2->GetNEntries();
@@ -707,15 +707,3 @@ void AliJetAODFillUnitArrayTracks::Exec(Option_t* const /*option*/)
   
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
index 34148c6..1de092d 100644 (file)
 // is executed after the ESD filter task, in order to read its output
 //
 // Author: Davide Perrino <davide.perrino@cern.ch>
+//
+// **February 2011
+// implemented standard geometry (AliEMCALGeoUtils) instead of dummy one (AliJetDummyGeo)
+// moved geometry definition in AliJetReader
+// marco.bregant@subatech.in2p3.fr
 //------------------------------------------------------------------------- 
 
 
 #include <TFile.h>
 #include <TTask.h>
 #include <TGeoManager.h>
+#include <TGeoMatrix.h>
 
 #include "AliJetAODReader.h"
 #include "AliJetAODReaderHeader.h"
 #include "AliAODEvent.h"
 #include "AliAODTrack.h"
 #include "AliAODMCParticle.h"
-#include "AliJetDummyGeo.h"
+#include "AliEMCALGeoUtils.h"
 #include "AliJetAODFillUnitArrayTracks.h"
 #include "AliJetAODFillUnitArrayEMCalDigits.h"
 #include "AliJetHadronCorrectionv1.h"
 #include "AliJetUnitArray.h"
+#include "AliOADBContainer.h"
 
 ClassImp(AliJetAODReader)
 
@@ -51,7 +58,6 @@ AliJetAODReader::AliJetAODReader():
     fRef(new TRefArray),
     fDebug(0),
     fOpt(0),
-    fGeom(0),
     fHadCorr(0x0),
     fTpcGrid(0x0),
     fEmcalGrid(0x0),
@@ -472,9 +478,11 @@ void AliJetAODReader::CreateTasks(TChain* tree)
   fDZ = fReaderHeader->GetDZ();
   fTree = tree;
 
-  // Init EMCAL geometry and create UnitArray object
-  SetEMCALGeometry();
-  //  cout << "In create task" << endl;
+  // Init EMCAL geometry, if needed
+   if(fGeom == 0)
+         SetEMCALGeometry();
+       else Info(" SetEMCALGeometry","was already done.. it's called just once !!");
+  // Init parameters
   InitParameters();
   InitUnitArray();
 
@@ -577,43 +585,14 @@ Bool_t AliJetAODReader::ExecTasks(Bool_t procid, TRefArray* refArray)
   return kTRUE;
 }
 
-//____________________________________________________________________________
-Bool_t AliJetAODReader::SetEMCALGeometry()
-{
-  // 
-  // Set the EMCal Geometry
-  //
-  
-  if (!fTree->GetFile()) 
-    return kFALSE;
 
-  TString geomFile(fTree->GetFile()->GetName());
-  geomFile.ReplaceAll("AliESDs", "geometry");
-  
-  // temporary workaround for PROOF bug #18505
-  geomFile.ReplaceAll("#geometry.root#geometry.root", "#geometry.root");
-  if(fDebug>1) printf("Current geometry file %s \n", geomFile.Data());
-
-  // Define EMCAL geometry to be able to read ESDs
-  fGeom = AliJetDummyGeo::GetInstance();
-  if (fGeom == 0)
-    fGeom = AliJetDummyGeo::GetInstance("EMCAL_COMPLETE","EMCAL");
-  
-  // To be setted to run some AliEMCALGeometry functions
-  TGeoManager::Import(geomFile);
-  fGeom->GetTransformationForSM();  
-  printf("\n EMCal Geometry set ! \n");
-  
-  return kTRUE;
-  
-}
 
 //____________________________________________________________________________
 void AliJetAODReader::InitParameters()
 {
   // Initialise parameters
   fOpt = fReaderHeader->GetDetector();
-  fNumUnits       = fGeom->GetNCells();      // Number of cells in EMCAL
+  fNumUnits       = fGeom->GetEMCGeometry()->GetNCells();      // Number of cells in EMCAL
   if(fDebug>1) printf("\n EMCal parameters initiated ! \n");
 }
 
@@ -650,31 +629,31 @@ void AliJetAODReader::InitUnitArray()
           // Define a grid of cell for the gaps between SM
           Double_t phimin0 = 0., phimin1 = 0., phimin2 = 0., phimin3 = 0., phimin4 = 0.;
           Double_t phimax0 = 0., phimax1 = 0., phimax2 = 0., phimax3 = 0., phimax4 = 0.;
-          fGeom->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
+          fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
           fGrid0 = new AliJetGrid(0,95,phimin0,phimax0,-0.7,0.7); // 0.015 x 0.015
           fGrid0->SetGridType(0);
           fGrid0->SetMatrixIndexes();
           fGrid0->SetIndexIJ();
           n0 = fGrid0->GetNEntries();
-          fGeom->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
+          fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
           fGrid1 = new AliJetGrid(0,95,phimin1,phimax1,-0.7,0.7); // 0.015 x 0.015
           fGrid1->SetGridType(0);
           fGrid1->SetMatrixIndexes();
           fGrid1->SetIndexIJ();
           n1 = fGrid1->GetNEntries();
-          fGeom->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
+          fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
           fGrid2 = new AliJetGrid(0,95,phimin2,phimax2,-0.7,0.7); // 0.015 x 0.015
           fGrid2->SetGridType(0);
           fGrid2->SetMatrixIndexes();
           fGrid2->SetIndexIJ();
           n2 = fGrid2->GetNEntries();
-          fGeom->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
+          fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
           fGrid3 = new AliJetGrid(0,95,phimin3,phimax3,-0.7,0.7); // 0.015 x 0.015
           fGrid3->SetGridType(0);
           fGrid3->SetMatrixIndexes();
           fGrid3->SetIndexIJ();
           n3 = fGrid3->GetNEntries();
-          fGeom->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
+          fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
           fGrid4 = new AliJetGrid(0,95,phimin4,phimax4,-0.7,0.7); // 0.015 x 0.015
           fGrid4->SetGridType(0);
           fGrid4->SetMatrixIndexes();
index 9b5b708..d3e87e5 100644 (file)
@@ -14,7 +14,7 @@
 #include "AliJetUnitArray.h"
 #include "AliJetGrid.h"
 class AliJetUnitArray;
-class AliJetDummyGeo;
+class AliEMCALGeoUtils;
 class AliJetHadronCorrection;
 class AliJetAODReaderHeader;
 class AliJetReaderHeader;
@@ -65,8 +65,6 @@ class AliJetAODReader : public AliJetReader
   TRefArray                  *fRef;    //! pointer to array of references to tracks
   Int_t                       fDebug;  // Debug option
   Int_t                       fOpt;    // Detector to be used for jet reconstruction
-  AliJetDummyGeo             *fGeom;             //! EMCAL Geometry
-
   AliJetHadronCorrection     *fHadCorr;          //! Pointer to Hadron Correction Object
   AliJetGrid                 *fTpcGrid;          //! Pointer to grid object
   AliJetGrid                 *fEmcalGrid;        //! Pointer to grid object
index 05d4140..96ddbaf 100644 (file)
@@ -114,7 +114,7 @@ AliJetESDFillUnitArrayTracks& AliJetESDFillUnitArrayTracks::operator=(const AliJ
 void AliJetESDFillUnitArrayTracks::InitParameters()
 {
   //  fHadCorr        = 0;                 // For hadron correction
-  fNumUnits = fGeom->GetNCells();      // Number of towers in EMCAL
+  fNumUnits = fGeom->GetEMCGeometry()->GetNCells();      // Number of towers in EMCAL
   cout << "In AliJetESDFillUnitArrayTracks:InitParameters(), Ncells : " << fNumUnits << endl;
 
   fTPCGrid->GetAccParam(fNphi,fNeta,fPhiMin, 
@@ -295,11 +295,11 @@ void AliJetESDFillUnitArrayTracks::Exec(Option_t* const /*option*/)
                {
                  Double_t phimin0 = 0., phimin1 = 0., phimin2 = 0., phimin3 = 0., phimin4 = 0.;
                  Double_t phimax0 = 0., phimax1 = 0., phimax2 = 0., phimax3 = 0., phimax4 = 0.;
-                 fGeom->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
-                 fGeom->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
-                 fGeom->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
-                 fGeom->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
-                 fGeom->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
+                 fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
                  Int_t n0 = fGrid0->GetNEntries();
                  Int_t n1 = fGrid1->GetNEntries();
                  Int_t n2 = fGrid2->GetNEntries();
index 5477303..ffebed0 100755 (executable)
 // ESD reader for jet analysis
 // Authors: Mercedes Lopez Noriega (mercedes.lopez.noriega@cern.ch)
 //          Magali Estienne <magali.estienne@subatech.in2p3.fr>
+//
+// **February 2011
+// implemented standard geometry (AliEMCALGeoUtils) instead of dummy one (AliJetDummyGeo)
+// moved geometry definition in AliJetReader
+// marco.bregant@subatech.in2p3.fr
 //------------------------------------------------------------------------- 
 
 // --- Standard library ---
@@ -25,6 +30,7 @@
 
 // --- ROOT system ---
 #include <TSystem.h>
+#include <TString.h>
 #include <TStopwatch.h>
 #include <TLorentzVector.h>
 #include <TVector3.h>
 #include "AliJetESDReader.h"
 #include "AliJetESDReaderHeader.h"
 #include "AliESDEvent.h"
+#include "AliVEvent.h"
 #include "AliESD.h"
 #include "AliESDtrack.h"
-#include "AliJetDummyGeo.h"
+#include "AliEMCALGeoUtils.h"
+#include "AliEMCALEMCGeometry.h"
 #include "AliJetESDFillUnitArrayTracks.h"
 #include "AliJetESDFillUnitArrayEMCalDigits.h"
 #include "AliJetHadronCorrectionv1.h"
 #include "AliJetUnitArray.h"
 #include "AliAnalysisTask.h"
+#include "AliOADBContainer.h"
 
 ClassImp(AliJetESDReader)
 
 AliJetESDReader::AliJetESDReader():
-  AliJetReader(),  
-  fGeom(0),
+  AliJetReader(), 
   fHadCorr(0x0),
   fTpcGrid(0x0),
   fEmcalGrid(0x0),
@@ -294,8 +302,11 @@ void AliJetESDReader::CreateTasks(TChain* tree)
   fDZ = fReaderHeader->GetDZ();
   fTree = tree;
 
-  // Init EMCAL geometry 
-  SetEMCALGeometry();
+  // Init EMCAL geometry, if needed
+   if(fGeom == 0)
+         SetEMCALGeometry();
+       else Info(" SetEMCALGeometry","was already done.. it's called just once !!");
+
   // Init parameters
   InitParameters();
   // Create and init unit array
@@ -393,35 +404,6 @@ Bool_t AliJetESDReader::ExecTasks(Bool_t procid, TRefArray* refArray)
   return kTRUE;
 }
 
-//____________________________________________________________________________
-Bool_t AliJetESDReader::SetEMCALGeometry()
-{
-  // 
-  // Set the EMCal Geometry
-  //
-
-  if (!fTree->GetFile()) 
-    return kFALSE;
-
-  TString geomFile(fTree->GetFile()->GetName());
-  geomFile.ReplaceAll("AliESDs", "geometry");
-  
-  // temporary workaround for PROOF bug #18505
-  geomFile.ReplaceAll("#geometry.root#geometry.root", "#geometry.root");
-  if(fDebug>1) printf("Current geometry file %s \n", geomFile.Data());
-
-  // Define EMCAL geometry to be able to read ESDs
-  fGeom = AliJetDummyGeo::GetInstance();
-  if (fGeom == 0)
-    fGeom = AliJetDummyGeo::GetInstance("EMCAL_COMPLETE","EMCAL");
-  
-  // To be setted to run some AliEMCALGeometry functions
-  TGeoManager::Import(geomFile);
-  fGeom->GetTransformationForSM();  
-  printf("\n EMCal Geometry set ! \n");
-  
-  return kTRUE;
-}
 
 //____________________________________________________________________________  
 void AliJetESDReader::InitParameters()
@@ -434,7 +416,7 @@ void AliJetESDReader::InitParameters()
       fECorrection    = 0;        // For electron correction
     else fECorrection = 1;        // For electron correction
   }
-  fNumUnits       = fGeom->GetNCells();      // Number of cells in EMCAL
+  fNumUnits       = fGeom->GetEMCGeometry()->GetNCells();      // Number of cells in EMCAL
   if(fDebug>1) printf("\n EMCal parameters initiated ! \n");
 }
 
@@ -473,31 +455,31 @@ void AliJetESDReader::InitUnitArray()
          // Define a grid of cell for the gaps between SM
          Double_t phimin0 = 0., phimin1 = 0., phimin2 = 0., phimin3 = 0., phimin4 = 0.;
          Double_t phimax0 = 0., phimax1 = 0., phimax2 = 0., phimax3 = 0., phimax4 = 0.;
-         fGeom->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
+         fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(0,phimin0,phimax0);
          fGrid0 = new AliJetGrid(0,95,phimin0,phimax0,-0.7,0.7); // 0.015 x 0.015
          fGrid0->SetGridType(0);
          fGrid0->SetMatrixIndexes();
          fGrid0->SetIndexIJ();
          n0 = fGrid0->GetNEntries();
-         fGeom->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
+         fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(1,phimin1,phimax1);
          fGrid1 = new AliJetGrid(0,95,phimin1,phimax1,-0.7,0.7); // 0.015 x 0.015
          fGrid1->SetGridType(0);
          fGrid1->SetMatrixIndexes();
          fGrid1->SetIndexIJ();
          n1 = fGrid1->GetNEntries();
-         fGeom->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
+         fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(2,phimin2,phimax2);
          fGrid2 = new AliJetGrid(0,95,phimin2,phimax2,-0.7,0.7); // 0.015 x 0.015
          fGrid2->SetGridType(0);
          fGrid2->SetMatrixIndexes();
          fGrid2->SetIndexIJ();
          n2 = fGrid2->GetNEntries();
-         fGeom->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
+         fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(3,phimin3,phimax3);
          fGrid3 = new AliJetGrid(0,95,phimin3,phimax3,-0.7,0.7); // 0.015 x 0.015
          fGrid3->SetGridType(0);  
          fGrid3->SetMatrixIndexes();
          fGrid3->SetIndexIJ();
          n3 = fGrid3->GetNEntries();
-         fGeom->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
+         fGeom->GetEMCGeometry()->GetPhiBoundariesOfSMGap(4,phimin4,phimax4);
          fGrid4 = new AliJetGrid(0,95,phimin4,phimax4,-0.7,0.7); // 0.015 x 0.015
          fGrid4->SetGridType(0);
          fGrid4->SetMatrixIndexes();
index 9a99919..b42db07 100755 (executable)
@@ -21,7 +21,7 @@
 class TRefArray;
 class AliJetESDReaderHeader;
 class AliEMCALGeometry;
-class AliJetDummyGeo;
+class AliEMCALGeoUtils;
 class AliJetHadronCorrection;
 class AliJetUnitArray;
 class AliJetReaderHeader;
@@ -55,7 +55,6 @@ class AliJetESDReader : public AliJetReader
   void       SetFractionHadronicCorrection(Double_t val);
 
  protected:
-  AliJetDummyGeo             *fGeom;             //! EMCAL Geometry 
   AliJetHadronCorrection     *fHadCorr;          //! Pointer to Hadron Correction Object 
   AliJetGrid                 *fTpcGrid;          //! Pointer to grid object
   AliJetGrid                 *fEmcalGrid;        //! Pointer to grid object
@@ -80,7 +79,6 @@ class AliJetESDReader : public AliJetReader
   Int_t                       fNphi;             // Number of bins in phi of tpc grid
   TRefArray                  *fRefArray;         // array of digit position and energy
   Bool_t                      fProcId;           // Bool_t for TProcessID synchronization
-  Bool_t SetEMCALGeometry();
   void InitParameters();
   AliJetESDReader(const AliJetESDReader &det);
   AliJetESDReader &operator=(const AliJetESDReader &det);
index 8dabec5..539a2cf 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "AliJetReaderHeader.h"
 #include "AliJetAODReaderHeader.h"
-#include "AliJetDummyGeo.h"
+#include "AliEMCALGeoUtils.h"
 #include "AliJetGrid.h"
 #include "AliESDEvent.h"
 #include "AliAODEvent.h"
@@ -29,7 +29,7 @@
 
 class Riostream;
 
-class AliEMCALGeometry;
+class AliEMCALGeoUtils;
 class AliJetReader;
 class AliJetESDReader;
 
@@ -43,7 +43,7 @@ class AliJetFillUnitArray : public TTask
   
   // Setter
   virtual void SetReaderHeader(AliJetReaderHeader* const readerHeader) {fReaderHeader = readerHeader;}
-  virtual void SetGeom(AliJetDummyGeo* const geom)                     {fGeom = geom;}
+  virtual void SetGeom(AliEMCALGeoUtils* const geom)                     {fGeom = geom;}
   virtual void SetMomentumArray(TClonesArray* const momentumArray)     {fMomentumArray = momentumArray;}
   virtual void SetUnitArray(TClonesArray* const unitArray)             {fUnitArray = unitArray;}
   virtual void SetRefArray(TRefArray* const refArray)                  {fRefArray = refArray;}
@@ -104,7 +104,7 @@ class AliJetFillUnitArray : public TTask
   Bool_t                fProcId;          // Bool_t for TProcessID synchronization  
   AliJetGrid           *fTPCGrid;         // Define filled grid
   AliJetGrid           *fEMCalGrid;       // Define filled grid
-  AliJetDummyGeo       *fGeom;            // Define EMCal geometry
+  AliEMCALGeoUtils     *fGeom;            // Define EMCal geometry
 
   Int_t                 fNphi;            // number of points in the grid:   phi
   Int_t                 fNeta;            //               "                 eta
index 88a3a4c..a6ae71d 100755 (executable)
 // manages the reading of input for jet algorithms
 // Authors: jgcn@mda.cinvestav.mx
 //          magali.estienne@IReS.in2p3.fr
-//------------------------------------------------------------------------
+//
+// **February 2011
+// implemented  standard geometry (AliEMCALGeoUtils) (was AliJetDummyGeo implented separately in ESDReader and AODReader
+// local2master matrices are now get from $ALICE_ROOT/OADB/PWG4/JetReconstruction/EMCALlocal2master.root
+// you can choose the geometry (EMCAL_COMPLETE, EMCAL_FIRSTYEARv1, etc) via SetEMCALgeo2bLoad('Name_of_Geometry') in the Readerheader
+// different options for survey(ed) matrice are provided too
+// marco.bregant@subatech.in2p3.fr
+//------------------------------------------------------------------------- 
 
 // root
+#include <TSystem.h>
+#include <TString.h>
 #include <TClonesArray.h>
 #include <TRefArray.h>
 #include "TTask.h"
+#include <TGeoManager.h>
 //AliRoot
+#include "AliLog.h"
 #include "AliJetReader.h"
 #include "AliJetReaderHeader.h"
 #include "AliESDEvent.h"
 #include "AliHeader.h"
+#include "AliEMCALGeoUtils.h"
+#include "AliEMCALEMCGeometry.h"
 #include "AliJetESDFillUnitArrayTracks.h" 
 #include "AliJetESDFillUnitArrayEMCalDigits.h"
 #include "AliJetUnitArray.h"
 #include "AliJetHadronCorrectionv1.h"
+#include "AliOADBContainer.h"
 
 ClassImp(AliJetReader)
 
 ////////////////////////////////////////////////////////////////////////
+AliEMCALGeoUtils *AliJetReader::fGeom=0;
 
 AliJetReader::AliJetReader():
   // Constructor
+  fJetanOADBpath(""),
   fChain(0), 
   fTree(0), 
   fMomentumArray(new TClonesArray("TLorentzVector",4000)),
@@ -59,7 +75,8 @@ AliJetReader::AliJetReader():
   fHadronCorrector(0),
   fHCorrection(0),
   fECorrection(0),
-  fEFlag(kFALSE)
+  fEFlag(kFALSE),
+  fDebug(0)
 {
   // Default constructor
   fSignalFlag = TArrayI();
@@ -91,7 +108,6 @@ AliJetReader::~AliJetReader()
   
 }
 
-
 ////////////////////////////////////////////////////////////////////////
 
 void AliJetReader::ClearArray()
@@ -99,3 +115,101 @@ void AliJetReader::ClearArray()
   if (fMomentumArray)  fMomentumArray->Clear();
   if (fFillUnitArray)  fFillUnitArray->Clear();
 }
+
+Bool_t AliJetReader::SetEMCALGeometry()
+{
+  // 
+  // Set the EMCal Geometry
+  //
+  
+  fDebug = fReaderHeader->GetDebug();
+  
+  if(fGeom != 0){
+         Info(" SetEMCALGeometry:","was already done.. it's called just once !!");
+     return kTRUE;
+     }
+     
+  if(fDebug>9) cout<<"JetReader: Setting EMCALGeometry"<<endl;
+
+//path to the OADB file
+
+
+ TString  myPath=  fReaderHeader ->GetMyOADBfile();
+ TString OADBfile;
+
+ Bool_t customFile=kFALSE;
+
+if(myPath.Length()) {
+       Info(" SetEMCALGeometry","custom version of OADB file: %s",myPath.Data());
+        customFile=kTRUE;
+       OADBfile=myPath;
+ } else OADBfile.Form("%s/PWG4/JetReconstruction/EMCALlocal2master.root",(const char*) fJetanOADBpath);
+ AliOADBContainer EMCALgeoCont;
+       Info(" SetEMCALGeometry"," I'm going to read the matrices from %s",OADBfile.Data()); 
+       TObjArray *EmcalMatrArray;
+       if(fDebug>19) cout<<"array definito"<<endl;
+       
+        EMCALgeoCont.InitFromFile((char*) OADBfile.Data(),"AliEMCALgeo");
+        EMCALgeoCont.GetDefaultList()->Print(); 
+       
+       const char*  geoType= fReaderHeader -> GetEMCALgeo2bLoad();
+       if(fDebug>19)  cout<<"geometry: "<<geoType<<endl;
+       
+       const char*  loc2master = ((AliJetESDReaderHeader*) fReaderHeader)->GetEMCALmatrices2bLoad();
+       if(fDebug>19) cout<<"matrices: "<<loc2master<<endl;
+       
+       
+     if(fDebug>9)      cout<<"geometry type is: "<<geoType<<endl;
+        if(fDebug>9)   cout<<"survey matrices are: "<<loc2master<<endl;
+       
+       // some crosschecks to avoid not existing cases
+       if(!(!strcmp(geoType, "EMCAL_COMPLETE") || !strcmp(geoType, "EMCAL_COMPLETEV1") || !strcmp(geoType, "EMCAL_FIRSTYEARV1")) ) 
+        Warning(" SetEMCALGeometry","%s is not a known good geometry!  either your are using an old one or everything will crash right now!",geoType);
+               
+       if(! (!strcmp(loc2master, "survey10") || !strcmp(loc2master, "survey11") || !strcmp(loc2master, "ideal") || !strcmp(loc2master, "test")) ) {
+               Warning(" SetEMCALGeometry"," %s is not one of the allowed cases  (listed few lines above) !!----!!!", loc2master);
+               loc2master="survey11";
+               Warning(" SetEMCALGeometry"," to avoid crashes, your decision has been overrulled!, matrices '%s' will be used instead",loc2master);
+               if(fDebug>9)   cout<<"survey matrices are (new, after overrulling): "<<loc2master<<endl;
+               }
+       
+       
+       // some warning for not so orthodox combination
+       if(!strcmp(geoType, "EMCAL_COMPLETE"))
+                Warning(" SetEMCALGeometry:", "!!----!!  this geometry contains wrong tilt angles for stripmodules.. are you really sure?  please consider using EMCAL_COMPLETEV1 !! ---!! ");
+       if(  !strcmp(loc2master, "survey11") && strcmp(geoType, "EMCAL_COMPLETEV1") )
+               Warning(" SetEMCALGeometry:",  "!!----!! survey11 matrices should be used with EMCAL_COMPLETEV1 geometry !!---!!");
+       if(  !strcmp(loc2master, "survey10") && strcmp(geoType, "EMCAL_FIRSTYEARV1") )
+               Warning(" SetEMCALGeometry",  "!!----!! survey10 matrices should be used ONLY with EMCAL_FIRSTYEARV1 geometry!!");
+    if(!strcmp(loc2master,"ideal"))
+               Warning(" SetEMCALGeometry","!!----!! ideal matrices are without any survey (misalignment correction)... is it really what you want?");
+    if(!strcmp(loc2master,"test") && !customFile)
+               Warning(" SetEMCALGeometry","!!----!! 'test' matrices will be used. but it seems you didn't provide a custom version of OADB file, the default 'test' is as 'ideal', no survey (misalignment correction) !!----!!");
+       if(!strcmp(loc2master,"test") && customFile)
+               Info(" SetEMCALGeometry"," !!----!! 'test' matrices read from the custom file you provided     !!----!!");
+
+       EmcalMatrArray=(TObjArray*)EMCALgeoCont.GetObject(100,(char*) loc2master);
+       
+  // Define EMCAL geometry
+  if(fDebug>10) cout<<"which EMCALgeometry is going to be uploaded?"<<geoType<<endl; 
+  fGeom = new AliEMCALGeoUtils(geoType,"EMCAL");
+  
+  
+       for (Int_t mod=0;mod<(fGeom->GetEMCGeometry())->GetNumberOfSuperModules();mod+=1)
+ {
+      fGeom->SetMisalMatrix(((TGeoHMatrix*) EmcalMatrArray->At(mod)),mod);
+     if(fDebug>9)  cout<<"and the matrix is: SM "<<mod<<" (to print the matrix, fDebug>11!) "<<endl;
+    if(fDebug>11) { 
+    cout<<"print the matrix, (will it work?)"<<endl;
+       ((TGeoHMatrix*) EmcalMatrArray->At(mod))->Print();
+       cout<<"if you read that, it did!"<<endl;
+       } 
+}
+  
+  Info("\n SetEMCALGeometry:"," EMCal Geometry set ! \n");
+  
+  return kTRUE;
+}
index c74f08a..26cae2c 100755 (executable)
@@ -18,6 +18,7 @@ class TChain;
 class TTask;
 class TClonesArray;
 class TRefArray;
+class AliEMCALGeoUtils;
 class AliJetReaderHeader;
 class AliESDEvent;
 class AliHeader;
@@ -25,6 +26,8 @@ class AliJetUnitArray;
 class AliJetHadronCorrection;
 class AliJet;
 class AliJetFillUnitArray;
+class AliOADBContainer;
+
 
 class AliJetReader : public TObject 
 {
@@ -68,11 +71,20 @@ class AliJetReader : public TObject
   virtual Bool_t GetGenJets(AliJet* /*genJets*/) {return kFALSE;}
   
   void ClearArray();
+  
+  virtual const TString GetJetanOADBPath()  {return fJetanOADBpath.Data();}
+  void SetJetanOADBPath(TString name) {fJetanOADBpath = name;}
  
+  virtual void SetDebug(Int_t debug = 0) {fDebug = debug;}
+  
  protected:
   AliJetReader(const AliJetReader& rJetReader);
   AliJetReader& operator = (const AliJetReader& rhsr);
+  Bool_t SetEMCALGeometry();
+  
 
+  TString                         fJetanOADBpath;          //! path to official OADB, to be set by the task
+  static AliEMCALGeoUtils         *fGeom;                  //! EMCAL Geometry 
   TChain                          *fChain;                 // chain for reconstructed tracks
   TChain                          *fTree;                  // tree for reconstructed tracks
   TClonesArray                    *fMomentumArray;         // array of particle momenta
@@ -95,7 +107,7 @@ class AliJetReader : public TObject
   Int_t                            fHCorrection;           //  Hadron correction flag 
   Int_t                            fECorrection;           //  Electron correction flag 
   Bool_t                           fEFlag;                 //  Electron correction flag 
-
+  Int_t                            fDebug;                //! Debug option
 
   ClassDef(AliJetReader,1)
 };
index 3d687b7..81764cc 100755 (executable)
@@ -44,7 +44,10 @@ AliJetReaderHeader::AliJetReaderHeader():
  fComment("No comment"),
  fDir(""),
  fBgDir(""),
- fPattern("")
+ fPattern(""),
+ fMatricesEMCAL("survey11"),
+ fGeomEMCAL("EMCAL_COMPLETEV1"),
+ fMyOADBfile("")
 {
   // Default constructor
 }
@@ -68,7 +71,10 @@ AliJetReaderHeader::AliJetReaderHeader(const char * name):
  fComment("No comment"),
  fDir(""),
  fBgDir(""),
- fPattern("")
+ fPattern(""),
+ fMatricesEMCAL("survey11"),
+ fGeomEMCAL("EMCAL_COMPLETEV1"),
+ fMyOADBfile("")
 {
   // Constructor
 }
index 6bb5586..c6093df 100755 (executable)
@@ -26,6 +26,10 @@ class AliJetReaderHeader : public TNamed
   virtual const char* GetDirectory()  {return fDir.Data();}
   virtual const char* GetBgDirectory(){return fBgDir.Data();}
   virtual const char* GetPattern() {return fPattern.Data();}
+  virtual const TString GetEMCALmatrices2bLoad() {return fMatricesEMCAL;}
+  virtual const TString GetEMCALgeo2bLoad() {return fGeomEMCAL;}
+  virtual const TString GetMyOADBfile() {return fMyOADBfile;} 
+  
   virtual Float_t     GetFiducialEtaMin() const {return fFiducialEtaMin;}
   virtual Float_t     GetFiducialEtaMax() const {return fFiducialEtaMax;} 
   virtual Float_t     GetFiducialPhiMin() const {return fFiducialPhiMin;}
@@ -46,6 +50,9 @@ class AliJetReaderHeader : public TNamed
   virtual void SetDirectory(const char* s)   {fDir=TString(s);}
   virtual void SetBgDirectory(const char* s, Int_t n = 1)
       {fBgDir=TString(s); fSignalPerBg = n;}
+  virtual void SetEMCALgeo2bLoad(const char* s)   {fGeomEMCAL=TString(s);} 
+  virtual void SetEMCALmatrices2bLoad(const char* s)   {fMatricesEMCAL=TString(s);}
+  virtual void SetMyOADBfile(const char* s)   {fMyOADBfile=TString(s);}
   virtual void SetFirstEvent(Int_t i=0) {fFirst=i;}
   virtual void SetLastEvent(Int_t i=-1) {fLast=i;}
   virtual void SetFiducialEta(Float_t etamin, Float_t etamax) 
@@ -75,8 +82,11 @@ class AliJetReaderHeader : public TNamed
   TString fDir;            // directory with input files for signal
   TString fBgDir;          // directory with input files for background
   TString fPattern;        // pattern to look for input files
+  TString fMatricesEMCAL;              // survey/matrices version for EMCAL
+  TString fGeomEMCAL;        // geometry version for EMCAL
+  TString fMyOADBfile;      //  private version of the OADB file with EMCAL matrices 
   
-  ClassDef(AliJetReaderHeader,2);
+  ClassDef(AliJetReaderHeader,3);
 };
  
 #endif
index 5a71402..a96ef1c 100644 (file)
@@ -39,7 +39,7 @@ else()
   set ( EDEFINE -isystem${ALICE_ROOT}/JETAN/fastjet)
 endif(FASTJET_ROOT)
 
-set ( EINCLUDE  ANALYSIS)
+set ( EINCLUDE  ANALYSIS  OADB)
 
 if( ALICE_TARGET STREQUAL "win32gcc")
        
diff --git a/OADB/PWG4/JetReconstruction/EMCALlocal2master.root b/OADB/PWG4/JetReconstruction/EMCALlocal2master.root
new file mode 100644 (file)
index 0000000..6151a46
Binary files /dev/null and b/OADB/PWG4/JetReconstruction/EMCALlocal2master.root differ