1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // Macro to generate histograms from digits
19 // By E. Sicking, CERN
22 void digitsPHOS(Int_t nevents, Int_t nfiles)
25 TH1F * hadc = new TH1F ("hadc", "hadc", 100, -10, 200);
26 TH1F * hadcLog = new TH1F ("hadclog", "hadclog", 100, -2, 4);
27 AliRunLoader* runLoader = AliRunLoader::Open("galice.root","Event","READ");
28 AliPHOSLoader * phosLoader = dynamic_cast<AliPHOSLoader*>(runLoader->GetLoader("PHOSLoader"));
30 for (Int_t ievent=0; ievent <nevents; ievent++) {
31 // for (Int_t ievent = 0; ievent < runLoader->GetNumberOfEvents(); ievent++) {
32 runLoader->GetEvent(ievent) ;
33 phosLoader->CleanDigits() ;
34 phosLoader->LoadDigits("READ") ;
35 TClonesArray * digits = phosLoader->Digits() ;
36 printf("Event %d contains %d digits\n",ievent,digits->GetEntriesFast());
39 for (Int_t j = 0; j < digits->GetEntries(); j++) {
41 AliPHOSDigit* dig = dynamic_cast<AliPHOSDigit*> (digits->At(j));
42 //cout << dig->GetEnergy() << endl;
43 hadc->Fill(dig->GetEnergy());
44 if(dig->GetEnergy()>0)
45 hadcLog->Fill(TMath::Log10(dig->GetEnergy()));
51 TFile fc("digits.PHOS.root","RECREATE");