#include "AliPHOSGetter.h" #include "TH2.h" #include "TH1.h" #include "TFile.h" #include "TTree.h" #include "TBranch.h" #include "TClonesArray.h" #include "TCanvas.h" #include "TSystem.h" #include "AliPHOSHit.h" #include "TF1.h" #include "TFormula.h" #include "TFolder.h" #include "TStopwatch.h" #include "TObjArray.h" #include "AliPHOSGeometry.h" void testsimexam (Int_t nevent=1, const char *config="testconfig.C") { // // Simple macro to run aliroot in a batch mode // cerr<<" __________________________________________________________________ "< Beginning of the simulation examination."<Event(0,"Q"); Int_t maxevent = gime->MaxEvent() ; // Examine the alarms TObjArray * alahm = (TObjArray*)(gime->Alarms()->FindObject("HitsM")); Float_t ratiohm = 100.0*(Float_t)alahm->GetEntries()/(Float_t)maxevent ; TObjArray * alaet = (TObjArray*)(gime->Alarms()->FindObject("TotEn")); Float_t ratioet = 100.0*(Float_t)alaet->GetEntries()/(Float_t)maxevent ; // Define the alarms per block and examine them char namemul[80], namen[80]; TObjArray* alahmb[5]; TObjArray* alaenb[5]; Float_t ratiohmb[5], ratioenb[5]; for (Int_t i = 0 ; i < 5 ; i++) { sprintf(namemul,"HitsMB%d",i+1); sprintf(namen,"TotEnB%d",i+1); alahmb[i] = (TObjArray*) (gime->Alarms()->FindObject(namemul)); ratiohmb[i] = 100.0*(Float_t)alahmb[i]->GetEntries()/(Float_t)maxevent; alaenb[i] = (TObjArray*)(gime->Alarms()->FindObject(namen)); ratioenb[i] = 100.0*(Float_t)alaenb[i]->GetEntries()/(Float_t)maxevent; if (ratiohmb[i]>maxAlaHitsMB){ boolala = 1; cerr<<" _____________________________________________________________ "< Examination detected an error in "<maxAlaTotEnB) { boolala = 1; cerr<<" _____________________________________________________________ "< Examination detected an error in "<maxAlaHitsM){ boolala = 1; cerr<<" _____________________________________________________________ "< Examination detected an error in HitsM." << endl ; cerr<<" _____________________________________________________________ "<maxAlaTotEn){ boolala = 1; cerr<<" _____________________________________________________________ "< Examination detected an error in TotEn." << endl ; cerr<<" _____________________________________________________________ "< Examination sets up the file that will be sent to PHOS director (30s). " << endl ; cerr<<" _____________________________________________________________ "<Event(index) ; // get the number of cells reached during this event and fill the total multiplicity histogram Int_t n = gime->Hits()->GetEntries() ; nhits += n ; his->Fill(n) ; // Get the data per block TClonesArray * hita = (TClonesArray *) gime -> Hits(); TIter next(hita); Float_t Et = 0.; Int_t id = 0, block = 0; Int_t nhit[6], rid[4]; Float_t etblock[6]; for ( Int_t i = 0; i < 6 ; i++) { nhit[i] = 0 ; etblock[i] = 0 ; } while ( (hit = (AliPHOSHit *) next()) ) { id = hit->GetId(); if (geom->IsInEMC(id) ) { Et += ( hit -> GetEnergy()); geom->AbsToRelNumbering(id,rid) ; block = rid[0]; nhit[block]++ ; etblock[block] += ( hit -> GetEnergy()); } } //Fill all the histograms but total multiplicity, already done hist = static_cast(hisba.At(block)) ; hist->Fill(nhit[block]) ; histnrg = static_cast(hisbanrg.At(block)) ; histnrg->Fill(etblock[block]); hisnrg -> Fill(Et); hbiz->Fill(n,Et); } nhits /= maxevent ; cerr << "av = " << nhits << endl ; TFile * file = gROOT -> GetFile("testPHOS.root"); file -> Write(); his->Draw() ; hisnrg->Draw() ; hbiz->Draw(); //Put the histograms in the root file for (Int_t i = 0 ; i < 6 ; i++) { hist = static_cast(hisba.At(i)) ; histnrg = static_cast(hisbanrg.At(i)); // cout << hist << endl << i << endl ; hist->Draw(); histnrg->Draw(); } file->Write() ; hisba.Delete() ; hisbanrg.Delete() ; file->Close(); // gSystem->Exec("uuencode $ALICE_ROOT/PHOS/testPHOS.root testPHOS.root | mail -s 'PHOS INSTALLATION ERROR ' schutz@in2p3.fr"); } cerr<<" _____________________________________________________________ "< Examination ended successfully. " << endl ; cerr<<" _____________________________________________________________ "<