//__________________________________________________________________________ Bool_t AnaESD(TString fileName) { // Analyze ESD from file fileName // calo track histograms ; TFile * out = new TFile("AOD.root", "RECREATE") ; TH1D * hCaloEnergyA = 0 ; TH1D * hCaloEnergyE = 0 ; TH1D * hCaloEnergyG = 0 ; TH1D * hCaloEnergyP = 0 ; TH1D * heta = 0 ; TH1D * hphi = 0 ; Double_t dist[3] ; AliPHOSGetter * gime = AliPHOSGetter::Instance(fileName) ; Int_t nEvent = gime->MaxEvent() ; Int_t event ; AliESD * esd = 0 ; for (event = 0 ; event < nEvent; event++) { cout << "AnaESD : Processing event # " << event << endl ; esd = gime->ESD(event) ; if (!esd) return kFALSE ; //esd->Print(); // Calorimeter tracks AliESDtrack * ct ; Int_t caloindex ; for (caloindex = 0 ; caloindex < esd->GetNumberOfTracks() ; caloindex++) { // get the tracks and check if it is from PHOS ct = esd->GetTrack(caloindex) ; if ( !ct->IsPHOS() ) continue ; Double_t energy = ct->GetPHOSsignal() ; // check if CPV bit is set (see AliPHOSFastRecParticle) Double_t type[AliESDtrack::kSPECIES+4] ; ct->GetPHOSpid(type) ; if ( (type[AliESDtrack::kElectron] == 1.0) || (type[AliESDtrack::kPhoton] == 1.0) ) { if(!hCaloEnergyA) { out->cd() ; hCaloEnergyA = new TH1D("CaloEnergyA", "Energy in calorimeter Electron/Photon like", 500, 0., 50.) ; } hCaloEnergyA->Fill(energy) ; } if ( type[AliESDtrack::kElectron] == 1.0 ) { if(!hCaloEnergyE) { out->cd() ; hCaloEnergyE = new TH1D("CaloEnergyE", "Energy in calorimeter Electron like", 500, 0., 50.) ; } hCaloEnergyE->Fill(energy) ; } if ( type[AliESDtrack::kPhoton] == 1.0 ) { if(!hCaloEnergyG) { out->cd() ; hCaloEnergyG = new TH1D("CaloEnergyG", "Energy in calorimeter Gamma like", 500, 0., 50.) ; } hCaloEnergyG->Fill(energy) ; } if ( type[AliESDtrack::kPi0] == 1.0 ) { if(!hCaloEnergyP) { out->cd() ; hCaloEnergyP = new TH1D("CaloEnergyP", "Energy in calorimeter Pi0 like", 500, 0., 100.) ; } hCaloEnergyP->Fill(energy) ; } AliESDtrack * cp ; Int_t cpindex ; for (cpindex = 0 ; cpindex < esd->GetNumberOfTracks() ; cpindex++) { // get the charged tracks from central tracking cp = esd->GetTrack(cpindex) ; if ( cp->IsPHOS() ) continue ; Match(ct, cp, dist) ; if (!heta && !hphi) { heta = new TH1D("Correta", "neutral-charged correlation in eta" , 100, 0., 360.) ; hphi = new TH1D("Corrphi", "neutral-charged correlation in phi" , 100, 0., 360.) ; } heta->Fill(dist[1]) ; hphi->Fill(dist[2]) ; } } } TBrowser * bs = new TBrowser("Root Memory Bowser", gROOT->FindObjectAny("AOD.root") ) ; bs->Show() ; out->Write() ; return kTRUE ; }
int main(int argc,char **argv) { uLib::MuonScatter u_mu; ROOT::Mutom::MuonScatter mu; ROOT::Mutom::Vector3f v3f(0,1,0); TFile *file = new TFile("test_file.root","RECREATE"); TTree *tree = getTree(file,"testing/dump","testing_tree"); TTree *tree2 = getTree(file,"new_dump","testing_tree"); tree->Branch("mu",&mu); tree->AddFriend(tree2); mu.in.origin = ROOT::Mutom::Vector3f(1,2,3); mu.in.direction = ROOT::Mutom::Vector3f(4,5,6); mu.p_in = 555; mu.p_out = 2368; tree->Fill(); u_mu.LineIn().origin << 3,3,3; u_mu.LineIn().direction << 5,5,5; u_mu.LineOut().origin << 1,2,3; u_mu.LineOut().direction << 4,5,6; u_mu.SetMomentum(555); u_mu.SetMomentumPrime(2368); mu << u_mu; tree->Fill(); tree2->Branch("vec",&v3f); tree2->Branch("p_in",&mu.p_in); tree2->Branch("p_out",&mu.p_out); mu.p_in = 1; mu.p_out = 2; tree2->Fill(); file->cd("/testing/dump"); tree->Write(); file->cd("/new_dump"); tree2->Write(); TText text(0,0,"this file contain a muon scatter event"); file->cd("/"); text.Write("content"); gApplication = new TApplication("Application", &argc, argv); TBrowser *tbr = new TBrowser("test"); tbr->Show(); gApplication->Run(); return 0; }