// Test Macro, shows how to load RecPoints, and how can we get // some of the parameters and variables. // Author: Gustavo Conesa void TestEMCALRecPoint() { // Getting EMCAL Detector and Geometry. AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read"); if (rl == 0x0) cout<<"Can not instatiate the Run Loader"<LoadgAlice();//Needed to get geometry AliEMCALLoader *emcalLoader = dynamic_cast (rl->GetDetectorLoader("EMCAL")); //TGeoManager::Import("geometry.root"); AliGeomManager::LoadGeometry("geometry.root"); AliRun * alirun = rl->GetAliRun(); // Needed to get Geometry AliEMCALGeometry * geom ; if(alirun){ AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL"); geom = emcal->GetGeometry(); } else { cout<<"alirun not available, instantiate"<LoadRecPoints("EMCAL"); //Get maximum number of events Int_t maxevent = rl->GetNumberOfEvents(); cout<<"Number of events "< Event " << iEvent << endl ; //Load Event rl->GetEvent(iEvent); // AliStack *sta=rl->Stack(); //Fill array of digits TObjArray *rpoints ;//= emcalLoader->RecPoints(); TTree *treeR = emcalLoader->TreeR(); TBranch * branchR = treeR->GetBranch("EMCALECARP"); branchR->SetAddress(&rpoints); branchR->GetEntry(0); if(!rpoints->GetEntries()) continue; cout << " ======> Event " << iEvent << endl ; cout<<">> Entries "<GetEntries()<GetEntries();irp++){ rp = static_cast(rpoints->At(irp)) ; //rp = emcalLoader->RecPoint(irp); if(rp != 0){ { energy = rp->GetEnergy(); //cluster energy cout<<"Energy "<GetPointEnergy()<GetGlobalPosition(gpos);//global ALICE xyz position Int_t primMult = 0; //Int_t *primInts = rp->GetPrimaries(primMult); //for (Int_t ipr=0; iprGetPrimaryIndex() ; // cout<<"Selected primary index "<0){ //TParticle *primary=sta->Particle(iprim); //cout<<"Primary phi "<Phi()*180/TMath::Pi()<<" Reconstructed phi "<Energy()<Fill((gpos.Phi()-primary->Phi())*180/TMath::Pi()); cout<<"rec point "<GetElipsAxis(lmb); cout<<"lmb0 "<