LCOV - code coverage report
Current view: top level - EMCAL/EMCALrec - AliEMCALClusterizer.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 122 289 42.2 %
Date: 2016-06-14 17:26:59 Functions: 12 22 54.5 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : //_________________________________________________________________________
      19             : //  Base class for the clusterization algorithm (pure abstract)
      20             : //*--
      21             : //*-- Author: Yves Schutz  SUBATECH 
      22             : // 
      23             : //   Clusterization mother class. Contains common methods/data members of different 
      24             : //   clusterizers. GCB 2010
      25             : //////////////////////////////////////////////////////////////////////////////
      26             : 
      27             : // --- ROOT system ---
      28             : #include <TTree.h>
      29             : #include <TFile.h> 
      30             : class TFolder;
      31             : #include <TMath.h> 
      32             : #include <TMinuit.h>
      33             : #include <TTree.h> 
      34             : class TSystem; 
      35             : #include <TBenchmark.h>
      36             : #include <TBrowser.h>
      37             : #include <TROOT.h>
      38             : 
      39             : // --- Standard library ---
      40             : #include <cassert>
      41             : 
      42             : // --- AliRoot header files ---
      43             : #include "AliEMCALClusterizer.h"
      44             : #include "AliEMCALReconstructor.h"
      45             : #include "AliRunLoader.h"
      46             : #include "AliRun.h"
      47             : #include "AliLog.h"
      48             : #include "AliEMCAL.h"
      49             : #include "AliEMCALRecPoint.h"
      50             : #include "AliEMCALRecParam.h"
      51             : #include "AliEMCALGeometry.h"
      52             : #include "AliEMCALRecParam.h"
      53             : #include "AliCDBManager.h"
      54             : #include "AliCaloCalibPedestal.h"
      55             : #include "AliEMCALCalibData.h"
      56             : #include "AliEMCALCalibTime.h"
      57             : class AliCDBStorage;
      58             : #include "AliCDBEntry.h"
      59             : 
      60          42 : ClassImp(AliEMCALClusterizer)
      61             : 
      62             : //____________________________________________________________________________
      63           0 : AliEMCALClusterizer::AliEMCALClusterizer():
      64           0 :   fIsInputCalibrated(kFALSE),
      65           0 :   fJustClusters(kFALSE),
      66           0 :   fDigitsArr(NULL),
      67           0 :   fTreeR(NULL),
      68           0 :   fRecPoints(NULL),
      69           0 :   fGeom(NULL),
      70           0 :   fCalibData(NULL), 
      71           0 :   fCalibTime(NULL), 
      72           0 :   fCaloPed(NULL),
      73           0 :   fADCchannelECA(0.),fADCpedestalECA(0.), fTimeECA(0.),
      74           0 :   fTimeMin(-1.),fTimeMax(1.),fTimeCut(1.), fTimeCalibration(0),
      75           0 :   fDefaultInit(kFALSE),fToUnfold(kFALSE),
      76           0 :   fNumberOfECAClusters(0), fECAClusteringThreshold(0.),
      77           0 :   fECALocMaxCut(0.),fECAW0(0.),fMinECut(0.),fRejectBelowThreshold(0),
      78           0 :   fClusterUnfolding(NULL)
      79           0 : {
      80             :   // ctor
      81             :   
      82           0 :   Init();
      83           0 : }
      84             : 
      85             : //____________________________________________________________________________
      86           0 : AliEMCALClusterizer::AliEMCALClusterizer(AliEMCALGeometry* geometry): 
      87           0 :   fIsInputCalibrated(kFALSE),
      88           0 :   fJustClusters(kFALSE),
      89           0 :   fDigitsArr(NULL),
      90           0 :   fTreeR(NULL),
      91           0 :   fRecPoints(NULL),
      92           0 :   fGeom(geometry),
      93           0 :   fCalibData(NULL), 
      94           0 :   fCalibTime(NULL), 
      95           0 :   fCaloPed(NULL),
      96           0 :   fADCchannelECA(0.),fADCpedestalECA(0.), fTimeECA(0.),
      97           0 :   fTimeMin(-1.),fTimeMax(1.),fTimeCut(1.), fTimeCalibration(0),
      98           0 :   fDefaultInit(kFALSE),fToUnfold(kFALSE),
      99           0 :   fNumberOfECAClusters(0), fECAClusteringThreshold(0.),
     100           0 :   fECALocMaxCut(0.),fECAW0(0.),fMinECut(0.),fRejectBelowThreshold(0),
     101           0 :   fClusterUnfolding(NULL)
     102           0 : {
     103             :   // Ctor with the indication of the file where header Tree and digits Tree are stored.
     104             :   // Use this contructor to avoid usage of Init() which uses runloader.
     105             :   // Change needed by HLT - MP.
     106             :   // Note for the future: the use on runloader should be avoided or optional at least.
     107             :   // Another way is to make Init virtual and protected at least 
     108             :   // such that the deriving classes can overload Init();
     109             :   
     110           0 :   if (!fGeom)
     111             :   {
     112           0 :     AliFatal("Geometry not initialized.");
     113             :   }
     114             :   Int_t i=0;
     115           0 :   for (i = 0; i < 8; i++)
     116           0 :     fSSPars[i] = 0.;
     117           0 :   for (i = 0; i < 3; i++) {
     118           0 :     fPar5[i] = 0.;
     119           0 :     fPar6[i] = 0.;
     120             :   }
     121           0 : }
     122             : 
     123             : //____________________________________________________________________________
     124           2 : AliEMCALClusterizer::AliEMCALClusterizer(AliEMCALGeometry *geometry, 
     125             :                                          AliEMCALCalibData *calib, 
     126             :                                          AliEMCALCalibTime *calibt, 
     127             :                                          AliCaloCalibPedestal *caloped): 
     128           2 :   fIsInputCalibrated(kFALSE),
     129           2 :   fJustClusters(kFALSE),
     130           2 :   fDigitsArr(NULL),
     131           2 :   fTreeR(NULL),
     132           2 :   fRecPoints(NULL),
     133           2 :   fGeom(geometry),
     134           2 :   fCalibData(calib),
     135           2 :   fCalibTime(calibt),
     136           2 :   fCaloPed(caloped),
     137           2 :   fADCchannelECA(0.),fADCpedestalECA(0.), fTimeECA(0.),
     138           2 :   fTimeMin(-1.),fTimeMax(1.),fTimeCut(1.), fTimeCalibration(0),
     139           2 :   fDefaultInit(kFALSE),fToUnfold(kFALSE),
     140           2 :   fNumberOfECAClusters(0), fECAClusteringThreshold(0.),
     141           2 :   fECALocMaxCut(0.),fECAW0(0.),fMinECut(0.),fRejectBelowThreshold(0),
     142           2 :   fClusterUnfolding(NULL)
     143           6 : {
     144             :   // ctor, geometry and calibration are initialized elsewhere.
     145             :   
     146           2 :   if (!fGeom)
     147           0 :     AliFatal("Geometry not initialized.");
     148             :   
     149             :   Int_t i=0;
     150          36 :   for (i = 0; i < 8; i++)
     151          16 :     fSSPars[i] = 0.;
     152          16 :   for (i = 0; i < 3; i++) {
     153           6 :     fPar5[i] = 0.;
     154           6 :     fPar6[i] = 0.;
     155             :   }
     156           2 : }
     157             : 
     158             : //____________________________________________________________________________
     159             : AliEMCALClusterizer::~AliEMCALClusterizer()
     160           4 : {
     161             :   // dtor
     162             :   //Already deleted in AliEMCALReconstructor.
     163             : 
     164           2 :   if(fClusterUnfolding) delete fClusterUnfolding;
     165             : 
     166             :   // make sure we delete the rec points array
     167           2 :   DeleteRecPoints();
     168             : 
     169             :   //Delete digits array
     170           2 :   DeleteDigits();
     171             : 
     172           2 : }
     173             : 
     174             : //____________________________________________________________________________
     175             : void AliEMCALClusterizer::DeleteRecPoints()
     176             : {
     177             :   // free the cluster array
     178          20 :   if (fRecPoints) 
     179             :     {
     180          24 :       AliDebug(2, "Deleting fRecPoints.");
     181           8 :       fRecPoints->Delete();
     182          16 :       delete fRecPoints;
     183           8 :       fRecPoints = 0;
     184           8 :     }
     185          10 : }
     186             : 
     187             : //____________________________________________________________________________
     188             : void AliEMCALClusterizer::DeleteDigits()
     189             : {
     190             :   // free the digits array
     191           4 :   if (fDigitsArr) 
     192             :     {
     193           6 :       AliDebug(2, "Deleting fDigitsArr.");
     194           2 :       fDigitsArr->Clear("C");
     195           4 :       delete fDigitsArr;
     196           2 :       fDigitsArr = 0;
     197           2 :     }
     198           2 : }
     199             : 
     200             : //____________________________________________________________________________
     201             : void AliEMCALClusterizer::Calibrate(Float_t & amp, Float_t & time, const Int_t absId) 
     202             : {
     203             :   // Convert digitized amplitude into energy, calibrate time
     204             :   // Calibration parameters are taken from OCDB : OCDB/EMCAL/Calib/Data
     205             : 
     206             :   //Return energy with default parameters if calibration is not available
     207         460 :   if (!fCalibData && !fCaloPed) {
     208           0 :     if (fIsInputCalibrated == kTRUE)
     209             :     {
     210           0 :       AliDebug(10, Form("Input already calibrated!"));
     211             :       return ;
     212             :     }
     213             :     else{
     214           0 :       AliFatal("OCDB calibration and bad map parameters are not available");
     215           0 :       return;
     216             :     }   
     217             :   }
     218             :   
     219         230 :   if (fGeom==0)
     220           0 :     AliFatal("Did not get geometry from EMCALLoader") ;
     221             :     
     222         230 :   Int_t iSupMod = -1;
     223         230 :   Int_t nModule = -1;
     224         230 :   Int_t nIphi   = -1;
     225         230 :   Int_t nIeta   = -1;
     226         230 :   Int_t iphi    = -1;
     227         230 :   Int_t ieta    = -1;
     228             :     
     229         230 :   Bool_t bCell = fGeom->GetCellIndex(absId, iSupMod, nModule, nIphi, nIeta) ;
     230         460 :   if(!bCell) {
     231           4 :     fGeom->PrintGeometry();
     232           4 :     AliError(Form("Wrong cell id number : %i", absId));
     233             :     //assert(0); // GCB: This aborts reconstruction of raw simulations 
     234             :     //where simulation had more SM than default geometry, 
     235             :     //change to return 0, to avoid aborting good generations.
     236           4 :     amp  = 0;
     237           4 :     time = 0;
     238           4 :     return ;
     239             :   }
     240             :     
     241         456 :   fGeom->GetCellPhiEtaIndexInSModule(iSupMod,nModule,nIphi, nIeta,iphi,ieta);
     242             :           
     243             :   // Check if channel is bad (dead or hot), in this case return 0.      
     244             :   // Gustavo: 15-12-09 In case of RAW data this selection is already done, but not in simulation.
     245             :   // for the moment keep it here but remember to do the selection at the sdigitizer level 
     246             :   // and remove it from here
     247         226 :   if (fCaloPed) {
     248         226 :     Int_t channelStatus = (Int_t)(fCaloPed->GetDeadMap(iSupMod))->GetBinContent(ieta,iphi);
     249         226 :     if(channelStatus == AliCaloCalibPedestal::kHot || channelStatus == AliCaloCalibPedestal::kDead) {
     250           0 :       AliDebug(2,Form("Tower from SM %d, ieta %d, iphi %d is BAD : status %d !!!",iSupMod,ieta,iphi, channelStatus));
     251           0 :       amp  = 0 ;
     252           0 :       time = 0 ;
     253           0 :       return ;
     254             :     }
     255         226 :   }
     256             :     
     257         452 :   if (fIsInputCalibrated || !fCalibData)
     258             :   {
     259           0 :     AliDebug(10, Form("Input already calibrated!"));
     260           0 :     return ;
     261             :   }
     262             :           
     263             :   // Energy calibration
     264         226 :   fADCchannelECA  = fCalibData->GetADCchannel (iSupMod,ieta,iphi);
     265         226 :   fADCpedestalECA = fCalibData->GetADCpedestal(iSupMod,ieta,iphi);
     266             : 
     267         226 :   amp   = amp * fADCchannelECA - fADCpedestalECA ;  
     268             : 
     269             :   // Time calibration
     270         226 :   if(fCalibTime && fTimeCalibration)
     271             :   {
     272             :     Int_t bc = 0; // Get somehow the bunch crossing number
     273             : 
     274           0 :     fTimeECA        = fCalibTime->GetTimeChannel(iSupMod,ieta,iphi, bc) * 1e-9; // ns to s
     275             :   
     276           0 :     time -= fTimeECA ;
     277           0 :   }
     278         686 : }
     279             : 
     280             : //____________________________________________________________________________
     281             : void AliEMCALClusterizer::GetCalibrationParameters() 
     282             : {
     283             :   // Set calibration parameters:
     284             :   // If calibration database exists, they are read from database,
     285             :   // otherwise, they are taken from digitizer.
     286             :   // It is a user responsilibity to open CDB before reconstruction, 
     287             :   // for example: 
     288             :   // AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB");
     289             : 
     290          16 :   if (fIsInputCalibrated)
     291             :     return;
     292             :   
     293             :   // Check if energy calibration is stored in data base
     294           8 :   if(!fCalibData)
     295             :   {
     296           8 :     AliCDBEntry *entry = (AliCDBEntry*) 
     297           8 :     AliCDBManager::Instance()->Get("EMCAL/Calib/Data");
     298          16 :     if (entry) fCalibData =  (AliEMCALCalibData*) entry->GetObject();
     299           8 :   }
     300             :   
     301           8 :   if(!fCalibData)
     302           0 :     AliFatal("Energy calibration parameters not found in CDB!");
     303             :   
     304           8 :   if(fTimeCalibration)
     305             :   {
     306             :     // Check if energy calibration is stored in data base
     307           0 :     if(!fCalibTime)
     308             :     {
     309           0 :       AliCDBEntry *entry = (AliCDBEntry*) 
     310           0 :       AliCDBManager::Instance()->Get("EMCAL/Calib/Time");
     311           0 :       if (entry) fCalibTime =  (AliEMCALCalibTime*) entry->GetObject();
     312           0 :     }
     313             :     
     314           0 :     if(!fCalibTime)
     315           0 :       AliFatal("Time calibration parameters not found in CDB!");
     316             :   }
     317           8 : }
     318             : 
     319             : //____________________________________________________________________________
     320             : void AliEMCALClusterizer::GetCaloCalibPedestal() 
     321             : {
     322             :   // Set calibration parameters:
     323             :   // if calibration database exists, they are read from database,
     324             :   // otherwise, they are taken from digitizer.
     325             :   //
     326             :   // It is a user responsilibity to open CDB before reconstruction, 
     327             :   // for example: 
     328             :   // AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage("local://CalibDB");
     329             : 
     330          16 :   if (fIsInputCalibrated)
     331             :     return;
     332             :   
     333             :   // Check if calibration is stored in data base
     334           8 :   if(!fCaloPed)
     335             :     {
     336           8 :       AliCDBEntry *entry = (AliCDBEntry*) 
     337           8 :         AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
     338          16 :       if (entry) fCaloPed =  (AliCaloCalibPedestal*) entry->GetObject();
     339           8 :     }
     340             :   
     341           8 :   if(!fCaloPed)
     342           0 :     AliFatal("Pedestal info not found in CDB!");
     343           8 : }
     344             : 
     345             : //____________________________________________________________________________
     346             : void AliEMCALClusterizer::Init()
     347             : {
     348             :   // Make all memory allocations which can not be done in default constructor.
     349             :   // Attach the Clusterizer task to the list of EMCAL tasks
     350             :   
     351           0 :   AliRunLoader *rl = AliRunLoader::Instance();
     352           0 :   if (rl->GetAliRun()){
     353           0 :     AliEMCAL* emcal = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"));
     354           0 :     if(emcal)fGeom = emcal->GetGeometry();
     355           0 :   }
     356             :   
     357           0 :   if(!fGeom){ 
     358           0 :     fGeom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName());
     359           0 :   }
     360             :   
     361           0 :   AliDebug(1,Form("geom %p",fGeom));
     362             :   
     363           0 :   if(!gMinuit) 
     364           0 :     gMinuit = new TMinuit(100) ;
     365             :   
     366             :   Int_t i=0;
     367           0 :   for (i = 0; i < 8; i++)
     368           0 :     fSSPars[i] = 0.;
     369           0 :   for (i = 0; i < 3; i++) {
     370           0 :     fPar5[i] = 0.;
     371           0 :     fPar6[i] = 0.;
     372             :   }
     373           0 : }
     374             : 
     375             : //____________________________________________________________________________
     376             : void AliEMCALClusterizer::InitParameters()
     377             : { 
     378             :   // Initializes the parameters for the Clusterizer from AliEMCALReconstructor::GetRecParam().
     379             : 
     380          16 :   return InitParameters(AliEMCALReconstructor::GetRecParam());
     381             : }
     382             : 
     383             : //____________________________________________________________________________
     384             : void AliEMCALClusterizer::InitParameters(const AliEMCALRecParam* recParam)
     385             : { 
     386             :   // Initializes the parameters for the Clusterizer
     387             : 
     388          16 :   fNumberOfECAClusters = 0 ;
     389           8 :   fCalibData           = 0 ;
     390           8 :   fCalibTime           = 0 ;
     391           8 :   fCaloPed             = 0 ;
     392             :         
     393           8 :   if(!recParam) {
     394           0 :     AliFatal("Reconstruction parameters for EMCAL not set!");
     395           0 :   } 
     396             : 
     397           8 :   fECAClusteringThreshold = recParam->GetClusteringThreshold();
     398           8 :   fECAW0                  = recParam->GetW0();
     399           8 :   fMinECut                = recParam->GetMinECut();    
     400           8 :   fRejectBelowThreshold   = recParam->GetRejectBelowThreshold();
     401           8 :   fToUnfold               = recParam->GetUnfold();
     402           8 :   fECALocMaxCut           = recParam->GetLocMaxCut();
     403           8 :   fTimeCut                = recParam->GetTimeCut();
     404           8 :   fTimeMin                = recParam->GetTimeMin();
     405           8 :   fTimeMax                = recParam->GetTimeMax();
     406           8 :   fTimeCalibration        = recParam->IsTimeCalibrationOn();
     407             :   
     408             :   //For NxN
     409           8 :   SetNRowDiff(recParam->GetNRowDiff());
     410           8 :   SetNColDiff(recParam->GetNColDiff());
     411             :   
     412          24 :   AliDebug(1,Form("Reconstruction parameters: fECAClusteringThreshold=%.3f GeV, fECAW=%.3f, fMinECut=%.3f GeV, "
     413             :                   "fToUnfold=%d, fECALocMaxCut=%.3f GeV, "
     414             :                   "fTimeCut=%e s,fTimeMin=%e s,fTimeMax=%e s,"
     415             :                   "fTimeCalibration %d, fRejectBelowThreshold=%d",
     416             :                   fECAClusteringThreshold,fECAW0,fMinECut,fToUnfold,fECALocMaxCut,
     417             :                   fTimeCut, fTimeMin, fTimeMax, fTimeCalibration,fRejectBelowThreshold));
     418             : 
     419           8 :   if (fToUnfold) {
     420             :     Int_t i=0;
     421           0 :     for (i = 0; i < 8; i++) {
     422           0 :       fSSPars[i] = recParam->GetSSPars(i);
     423             :     } //end of loop over parameters
     424           0 :     for (i = 0; i < 3; i++) {
     425           0 :       fPar5[i] = recParam->GetPar5(i);
     426           0 :       fPar6[i] = recParam->GetPar6(i);
     427             :     } //end of loop over parameters
     428             :       
     429           0 :     InitClusterUnfolding();
     430             :       
     431           0 :     for (i = 0; i < 8; i++) {
     432           0 :       AliDebug(1,Form("unfolding shower shape parameters: fSSPars=%f \n",fSSPars[i]));
     433             :     }
     434           0 :     for (i = 0; i < 3; i++) {
     435           0 :       AliDebug(1,Form("unfolding parameter 5: fPar5=%f \n",fPar5[i]));
     436           0 :       AliDebug(1,Form("unfolding parameter 6: fPar6=%f \n",fPar6[i]));
     437             :     }
     438           0 :   } // to unfold
     439           8 : }
     440             : 
     441             : //____________________________________________________________________________
     442             : void AliEMCALClusterizer::Print(Option_t * /*option*/)const
     443             : {
     444             :   // Print clusterizer parameters
     445             :   
     446           0 :   TString message("\n") ; 
     447             :   
     448           0 :   if (strcmp(GetName(),"") == 0) {
     449           0 :     printf("AliEMCALClusterizer not initialized\n");
     450           0 :     return;
     451             :   }
     452             :     
     453             :   // Print parameters
     454           0 :   TString taskName(Version()) ;
     455             :     
     456           0 :   printf("--------------- "); 
     457           0 :   printf("%s",taskName.Data()) ; 
     458           0 :   printf(" "); 
     459           0 :   printf("Clusterizing digits: "); 
     460           0 :   printf("\n                       ECA Local Maximum cut    = %f", fECALocMaxCut); 
     461           0 :   printf("\n                       ECA Logarithmic weight   = %f", fECAW0); 
     462           0 :   if (fToUnfold) {
     463           0 :     printf("\nUnfolding on\n");
     464           0 :     printf("Unfolding parameters: fSSpars: \n");
     465             :     Int_t i=0;
     466           0 :     for (i = 0; i < 8; i++) {
     467           0 :       printf("fSSPars[%d] = %f \n", i, fSSPars[i]);
     468             :     }
     469           0 :     printf("Unfolding parameter 5 and 6: fPar5 and fPar6: \n");
     470           0 :     for (i = 0; i < 3; i++) {
     471           0 :       printf("fPar5[%d] = %f \n", i, fPar5[i]);
     472           0 :       printf("fPar6[%d] = %f \n", i, fPar6[i]);
     473             :     }
     474           0 :   }
     475             :   else
     476           0 :     printf("\nUnfolding off\n");
     477             :     
     478           0 :   printf("------------------------------------------------------------------"); 
     479           0 : }
     480             : 
     481             : //____________________________________________________________________________
     482             : void AliEMCALClusterizer::PrintRecPoints(Option_t * option)
     483             : {
     484             :   // Prints list of RecPoints produced at the current pass of AliEMCALClusterizer
     485             : 
     486           0 :   if (strstr(option,"deb")) {
     487           0 :     printf("PrintRecPoints: Clusterization result:") ; 
     488           0 :     printf("           Found %d ECA Rec Points\n ", 
     489           0 :            fRecPoints->GetEntriesFast()) ; 
     490           0 :   }
     491             :   
     492           0 :   if (strstr(option,"all")) {
     493           0 :     if (strstr(option,"deb")) {
     494           0 :       printf("\n-----------------------------------------------------------------------\n") ;
     495           0 :       printf("Clusters in ECAL section\n") ;
     496           0 :       printf("Index    Ene(GeV) Multi Module     GX    GY   GZ  lX    lY   lZ   Dispersion Lambda 1   Lambda 2  # of prim  Primaries list\n") ;
     497           0 :     }
     498             :     Int_t index; 
     499           0 :     for (index =  0 ; index < fRecPoints->GetEntries() ; index++) {
     500           0 :       AliEMCALRecPoint * rp = dynamic_cast<AliEMCALRecPoint * >(fRecPoints->At(index)) ; 
     501           0 :       if (!rp) 
     502           0 :         continue;
     503             : 
     504           0 :       TVector3  globalpos;  
     505             :       //rp->GetGlobalPosition(globalpos);
     506           0 :       TVector3  localpos;  
     507           0 :       rp->GetLocalPosition(localpos);
     508           0 :       Float_t lambda[2]; 
     509           0 :       rp->GetElipsAxis(lambda);
     510             :         
     511           0 :       Int_t nprimaries=0;
     512           0 :       Int_t * primaries = rp->GetPrimaries(nprimaries);
     513           0 :       if(strstr(option,"deb")) 
     514           0 :         printf("\n%6d  %8.4f  %3d     %4.1f    %4.1f %4.1f  %4.1f %4.1f %4.1f    %4.1f   %4f  %4f    %2d     : ", 
     515           0 :                rp->GetIndexInList(), rp->GetEnergy(), rp->GetMultiplicity(),
     516           0 :                globalpos.X(), globalpos.Y(), globalpos.Z(), localpos.X(), localpos.Y(), localpos.Z(), 
     517           0 :                rp->GetDispersion(), lambda[0], lambda[1], nprimaries) ; 
     518           0 :       if(strstr(option,"deb")){ 
     519           0 :         for (Int_t iprimary=0; iprimary<nprimaries; iprimary++) {
     520           0 :           printf("%d ", primaries[iprimary] ) ; 
     521             :         }
     522           0 :       }
     523           0 :     }
     524             :     
     525           0 :     if(strstr(option,"deb"))
     526           0 :       printf("\n-----------------------------------------------------------------------\n");
     527           0 :   }
     528           0 : }
     529             : 
     530             : //___________________________________________________________________
     531             : void  AliEMCALClusterizer::PrintRecoInfo()
     532             : {
     533             :   // Print reco version
     534             : 
     535           0 :   printf(" AliEMCALClusterizer::PrintRecoInfo() : version %s \n", Version() );
     536           0 : }
     537             : 
     538             : //____________________________________________________________________________
     539             : void AliEMCALClusterizer::SetInput(TTree *digitsTree)
     540             : {
     541             :   // Read the digits from the input tree
     542             : 
     543          16 :   TBranch *branch = digitsTree->GetBranch("EMCAL");
     544           8 :   if (!branch)
     545             :   {
     546           0 :     AliError("can't get the branch with the EMCAL digits !");
     547           0 :     return;
     548             :   }
     549             :   
     550          12 :   if (!fDigitsArr) fDigitsArr = new TClonesArray("AliEMCALDigit",100);
     551           6 :   else             fDigitsArr->Clear("C"); // avoid leak
     552             :     
     553           8 :   branch->SetAddress(&fDigitsArr);
     554           8 :   branch->GetEntry(0);
     555          16 : }
     556             : 
     557             : //____________________________________________________________________________
     558             : void AliEMCALClusterizer::SetOutput(TTree *clustersTree)
     559             : {
     560             :   // Read the digits from the input tree
     561             : 
     562          32 :   AliDebug(9, "Making array for EMCAL clusters");
     563          16 :   fRecPoints = new TObjArray(1000);
     564           8 :   if (clustersTree) {
     565           8 :     fTreeR = clustersTree;
     566             :     Int_t split = 0;
     567             :     Int_t bufsize = 32000;
     568           8 :     fTreeR->Branch("EMCALECARP", "TObjArray", &fRecPoints, bufsize, split);
     569           8 :   }
     570           8 : }
     571             : 
     572             : //___________________________________________________________________
     573             : void AliEMCALClusterizer::SetInputCalibrated(Bool_t val)
     574             : {
     575             :   // Flag to indicate that input is calibrated - the case when we run already on ESD
     576             : 
     577           0 :   fIsInputCalibrated = val;
     578           0 : }
     579             : 
     580             : //___________________________________________________________________
     581             : void AliEMCALClusterizer::SetJustClusters(Bool_t val)
     582             : {
     583             :   // Flag to indicate that we are running on ESDs, when calling 
     584             :   // rp->EvalAll(fECAW0,fDigitsArr,fJustClusters); in derived classes
     585             : 
     586           0 :   fJustClusters = val;
     587           0 : }

Generated by: LCOV version 1.11