예제 #1
0
///
/// Configure the class handling the calorimeter clusters specific methods
///
AliCalorimeterUtils* ConfigureCaloUtils(TString calorimeter, TString trigger, 
                                        Bool_t  simulation , Bool_t  calibrate,
                                        Int_t   year       , Int_t   debugLevel)
{
  AliCalorimeterUtils *cu = new AliCalorimeterUtils;
  cu->SetDebug(debugLevel);
  
  // Remove clusters close to borders, at least max energy cell is 1 cell away 
  cu->SetNumberOfCellsFromEMCALBorder(1);
  cu->SetNumberOfCellsFromPHOSBorder(2);
  
  // Search of local maxima in cluster
  cu->SetLocalMaximaCutE(0.1);
  cu->SetLocalMaximaCutEDiff(0.03);

  //cu->SwitchOffClusterPlot();
  cu->SwitchOffRecalculateClusterTrackMatching();
  
  cu->SwitchOnBadChannelsRemoval() ;
  
  //EMCAL settings

  if(!simulation)
    cu->SwitchOnLoadOwnEMCALGeometryMatrices();
  
  cu->SwitchOffRecalibration(); // Check the reader if it is taken into account during filtering
  cu->SwitchOffRunDepCorrection();

  cu->SwitchOffCorrectClusterLinearity();

  Bool_t bExotic  = kTRUE;
  Bool_t bNonLin  = kFALSE;
  Bool_t bBadMap  = kTRUE;
  
  Bool_t bEnCalib = kFALSE;
  Bool_t bTiCalib = kFALSE;
  
  if(calibrate && !simulation)
  {
    cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
    cu->SwitchOffRunDepCorrection();    
    cu->SwitchOnRecalculateClusterPosition() ;

    bEnCalib = kTRUE;
    bTiCalib = kTRUE;
  }
  
//  AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
//
//  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");
//  ConfigureEMCALRecoUtils(recou,
//                          simulation,
//                          bExotic,
//                          bNonLin,
//                          bEnCalib,
//                          bBadMap,
//                          bTiCalib,
//                          debugLevel
//                          );
  
  cu->ConfigureEMCALRecoUtils(simulation,
                              bExotic,
                              bNonLin,
                              bEnCalib,
                              bBadMap,
                              bTiCalib,
                              debugLevel);
  
  //recou->SetExoticCellDiffTimeCut(50.);

  if(calorimeter=="PHOS")
  {
    if(year < 2014) cu->SetNumberOfSuperModulesUsed(3);
    else            cu->SetNumberOfSuperModulesUsed(4);
  }
  else
  {
    Int_t nSM     = 20;
    Int_t lastEMC = 11;
    if      (year == 2010) { nSM =  4; lastEMC = 3; }// EMCAL first year
    else if (year <  2014) { nSM = 10; lastEMC = 9; }// EMCAL active 2011-2013
    
    cu->SetNumberOfSuperModulesUsed(nSM);
    
    if      (trigger.Contains("EMCAL"))
    {
      cu->SetFirstSuperModuleUsed( 0);
      cu->SetLastSuperModuleUsed (lastEMC);
    }
    else if (trigger.Contains("DCAL"))
    {
      cu->SetFirstSuperModuleUsed(12);
      cu->SetLastSuperModuleUsed (19);
    }
    else
    {
      cu->SetFirstSuperModuleUsed(0);
      cu->SetLastSuperModuleUsed (cu->GetNumberOfSuperModulesUsed()-1);
    }
    
    printf("AddTaskPi0IMGammaCorrQA::CalorimeterUtils() - nSM %d, first %d, last %d\n",
           cu->GetNumberOfSuperModulesUsed(),cu->GetFirstSuperModuleUsed(), cu->GetLastSuperModuleUsed());
  }

  // PHOS 
  cu->SwitchOffLoadOwnPHOSGeometryMatrices();
    
  if(debugLevel > 0) cu->Print("");
  
  return cu;
}