/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // $Id$ // Macro to generate histograms from digits // By E. Sicking, CERN TDirectoryFile* GetDirectory(Int_t ievent, const TString& detName, Int_t nfiles) { for (Int_t file =0; fileGet(Form("Event%d",ievent)); if (dir) return dir; } return 0; } void digitsSPD(Int_t nevents, Int_t nfiles) { TH1F * hadc = new TH1F ("hadc", "hadc",100, 0, 2); TH1F * hadclog = new TH1F ("hadclog", "hadclog",100, -1, 1); TDirectoryFile *tdf[100]; TDirectoryFile *tdfKine[100] ; TTree *ttree[100]; TTree *ttreeKine[100]; TClonesArray *arr= NULL; // //Run loader------------ TString name; name = "galice.root"; AliRunLoader* rlSig = AliRunLoader::Open(name.Data()); // gAlice rlSig->LoadgAlice(); gAlice = rlSig->GetAliRun(); // Now load kinematics and event header rlSig->LoadKinematics(); rlSig->LoadHeader(); cout << rlSig->GetNumberOfEvents()<< endl; //---------------------- //loop over events in the files for(Int_t event=0; eventGet("TreeD"); arr = NULL; ttree[event]->SetBranchAddress("ITSDigitsSPD", &arr); // Runloader -> gives particle Stack rlSig->GetEvent(event); AliStack * stack = rlSig->Stack(); //stack->DumpPStack(); // loop over tracks Int_t NumberPrim=0; for(Int_t iev=0; ievGetEntries(); iev++){ ttree[event]->GetEntry(iev); for (Int_t j = 0; j < arr->GetEntries(); j++) { AliITSdigit* digit = dynamic_cast (arr->At(j)); if (digit){ hadc->Fill(digit->GetSignal()); hadclog->Fill(TMath::Log10(digit->GetSignal())); } } } } TFile fc("digits.ITS.SPD.root","RECREATE"); fc.cd(); hadc->Write(); hadclog->Write(); fc.Close(); }