SLIDE 10 Analysis class example
//_________________________________________________ TList * AliAnaExample::GetCreateOutputObjects() { // Create histograms to be saved in output file and // store them in fOutputContainer
y p
AliDebug(1,"Init parton histograms"); TList * outputContainer = new TList() ;
- utputContainer->SetName("GammaExampleHistos") ;
//__________________________________________________________________ void AliAnaExample::MakeAnalysisFillAOD() { fhPt = new TH1F ("hPt","p_T distribution", 100,0,100); fhPt->SetXTitle("p_{T} (GeV/c)");
- utputContainer->Add(fhPt);
fhPhi = new TH1F ("hPhi","#phi distribution", 100,0,TMath::TwoPi()); { //Do analysis and fill aods ConnectAODCaloClusters(); //Do Only when filling AODCaloClusters //Get vertex for photon momentum calculation Double_t v[3] ; //vertex ; 100,0,TMath::TwoPi()); fhPhi->SetXTitle("#phi (rad)");
- utputContainer->Add(fhPhi);
… return outputContainer; } GetReader()->GetVertex(v); //Fill AODCaloClusters and AODParticleCorrelation with aods PHOS for(Int_t i = 0; i < GetAODPHOS()->GetEntries(); i++){ AliAODCaloCluster * calo = dynamic_cast<AliAODCaloCluster*> (GetAODPHOS()->At(i)); (GetAODPHOS()->At(i)); … do whatever selection with the clusters //Fill AODCaloClusters AddAODCaloCluster(*calo); //Fill AODPhoton after some selection //________________________________________________________ void AliAnaExample::MakeAnalysisFillHistograms() { //Do analysis and fill histograms TLorentzVector mom ; calo->GetMomentum(mom,v); Double_t pid[10]; calo->GetPID(pid); Int t pdg = GetCaloPID()->GetPdg("PHOS",pid,mom.E()); //Loop on stored AOD photons Int_t naod = GetAODBranch()->GetEntriesFast(); if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod); for(Int_t iaod = 0; iaod < naod ; iaod++){ AliAODPhoton* ph = _ p g () g( ,p , ()); Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"PHOS") ; if(GetDebug() > 0) printf("pT %3.2f, in %d, pdg %d\n",mom.Pt(), in,pdg); if(mom.Pt() > fPtMin && in && pdg ==AliCaloPID::kPhoton) { AliAODParticleCorrelation ph = AliAODParticleCorrelation(mom); ph SetLabel(calo >GetLabel(0)); dynamic_cast<AliAODPhoton*> (GetAODBranch()- >At(iaod)); fhPt->Fill(ph->Pt()); fhPhi->Fill(ph->Phi()); 03/06/08 Gustavo Conesa Balbastre @ PWG4
10/14
ph.SetLabel(calo->GetLabel(0)); ph.SetPdg(pdg); AddAODParticleCorrelation(ph); } … } }