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
21 TTree* GetTreeD(Int_t ievent, const TString& detName, Int_t nfiles)
23 for (Int_t file =0; file<nfiles; file++) {
24 TString filename(detName);
26 filename += ".Digits.root";
29 filename += TString(Form(".Digits%d.root",file));
32 TFile* file0 = TFile::Open(filename.Data());
34 TTree* treeD = (TTree*)file0->Get(Form("Event%d/TreeD",ievent));
35 if (treeD) return treeD;
40 void digitsHMPID(Int_t nevents, Int_t nfiles){
43 TH1F *hadc = new TH1F("hadc","HMPID digit",200, -100., 3000.);
44 TH1F *hadclog = new TH1F("hadclog","HMPID digit",200, -0., 4.);
48 TClonesArray *digits =0x0;
50 for (Int_t event=0; event<nevents; event++) {
51 cout << "Event " << event << endl;
53 treeD = GetTreeD(event, "HMPID", nfiles);
55 cerr << "Event directory not found in " << nfiles << " files" << endl;
60 treeD->SetBranchAddress("HMPID4", &digits);
62 for(Int_t iev=0; iev<treeD->GetEntries(); iev++){
66 for (Int_t j = 0; j < digits->GetEntries(); j++) {
67 AliHMPIDDigit* dig = dynamic_cast<AliHMPIDDigit*> (digits->At(j));
69 if(dig->Q()>0.)hadclog->Fill(TMath::Log10(dig->Q()));
74 TFile fc("digits.HMPID.root","RECREATE");