ALICE Offline Tutorial

Slides:



Advertisements
Similar presentations
May 10, ALICE Offline Tutorial Markus Oldenburg – CERN May 10, 2007 – University of Sao Paulo.
Advertisements

Charm and beauty with ALICE at LHC
High Level Trigger (HLT) for ALICE Bergen Frankfurt Heidelberg Oslo.
5/2/  Online  Offline 5/2/20072  Online  Raw data : within the DAQ monitoring framework  Reconstructed data : with the HLT monitoring framework.
High Level Trigger – Applications Open Charm physics Quarkonium spectroscopy Dielectrons Dimuons Jets.
Winter Workshop on Nuclear Dynamics, Heavy Ion Physics with CMS: Day-One Measurements Olga Barannikova for the CMS Collaboration.
Algorithms and Methods for Particle Identification with ALICE TOF Detector at Very High Particle Multiplicity TOF simulation group B.Zagreev ACAT2002,
ALICE EMCal Physics and Functional Requirements Overview.
Event Simulation Tools in ALICE Andreas Morsch Generator Mini-Workshop CERN, Geneva June 20, 2003.
THE PHYSICS OF THE ALICE INNER TRACKING SYSTEM Elena Bruna, for the ALICE Collaboration Yale University 24 th Winter Workshop on Nuclear Dynamics, South.
High-p T results from ALICE Marco van Leeuwen, Utrecht University, for the ALICE collaboration.
Framework for Raw Data Thomas Kuhr Offline Week 29/06/2004.
Matching between charged tracks and electromagnetic calorimeter (EMCAL) clusters in ALICE Alberto Pulvirenti University & INFN Catania ACAT 2007 Conference.
ALICE Simulation Framework Ivana Hrivnacova 1 and Andreas Morsch 2 1 NPI ASCR, Rez, Czech Republic 2 CERN, Geneva, Switzerland For the ALICE Collaboration.
Andreas Morsch, CERN EP/AIP CHEP 2003 Simulation in ALICE Andreas Morsch For the ALICE Offline Project 2003 Conference for Computing in High Energy and.
The ALICE Simulation Strategy Andreas Morsch For the ALICE Offline Group Joint STAR/ALICE Offline Meeting Brookhaven National Laboratory, Upton, NY April.
V4-20-Release P. Hristov 08/08/ Changes: v4-20-Rev-38 #85151 Memory leak in T0 DQM agent. From rev #85276 AliGRPPreprocessor.cxx: Port to.
November 06, ALICE Offline Tutorial F.Carminati, P.Christakoglou, J.F.Grosse-Oetringhaus, P.Hristov, A.Peters, P.Saiz CERN, November 06, 2006.
TOF, Status of the Code F. Pierella, Bologna University and INFN TOF Offline Group ALICE Offline Week, June 2002.
1 Behaviour of the Silicon Strip Detector modules for the Alice experiment: simulation and test with minimum ionizing particles Federica Benedosso Utrecht,
V4-16-Release: bug reports, committed fixes and proposed changes P. Hristov 14/05/2009 Weekly offline meeting.
Tracking, PID and primary vertex reconstruction in the ITS Elisabetta Crescio-INFN Torino.
1 ALICE OFFLINE :ORGANIZATION A user point of view Yves Schutz, SUBATECH, France (PHOS biased)
ALICE Offline Week, CERN, Andrea Dainese 1 Primary vertex with TPC-only tracks Andrea Dainese INFN Legnaro Motivation: TPC stand-alone analyses.
ALICE Offline Tutorial Alice Core Offline 27 nd August, 2009.
Normal text - click to edit HLT tracking in TPC Off-line week Gaute Øvrebekk.
CBM Software Meeting 1 CBM Simulation & Analysis Framework Geant3 / Gean4 configuration M. Al-Turany, D. Bertini.
CBM ECAL simulation status Prokudin Mikhail ITEP.
Prospects in ALICE for  mesons Daniel Tapia Takaki (Birmingham, UK) for the ALICE Collaboration International Conference on STRANGENESS IN QUARK MATTER.
HLT/AliRoot integration C.Cheshkov, P.Hristov 2/06/2005 ALICE Offline Week.
Status of global tracking and plans for Run2 (for TPC related tasks see Marian’s presentation) 1 R.Shahoyan, 19/03/14.
Features needed in the “final” AliRoot release P.Hristov 26/10/2006.
Particle Identification with TRD Prashant Shukla Institute of Physics University of Heidelberg Presentation at International Workshop on TRD 27 th September.
HLT Kalman Filter Implementation of a Kalman Filter in the ALICE High Level Trigger. Thomas Vik, UiO.
Javier Castillo 1 Muon Embedding Status & Open Issues PWG3 - CERN - 15/02/2011.
03/06/08Gustavo Conesa PWG4 1/14 Particle identification and Hadron/Jet correlations analysis framework Description, Status, HOW TO use and.
October 10-12, 1 AliRoot: I/O organisation ROOT in the ALICE experiment I/O Structure Run-Time Data-Exchange.
I. BelikovALICE Offline Week, CERN, 12 June ESD Classes and the Combined Reconstruction What is the ESD ? Two new classes AliESD and AliESDtrack.
July 27, 2002CMS Heavy Ions Bolek Wyslouch1 Heavy Ion Physics with the CMS Experiment at the Large Hadron Collider Bolek Wyslouch MIT for the CMS Collaboration.
V5-01-Release & v5-02-Release Peter Hristov 20/02/2012.
A. SarratILC TPC meeting, DESY, 15/02/06 Simulation Of a TPC For T2K Near Detector Using Geant 4 Antony Sarrat CEA Saclay, Dapnia.
1 Reconstruction tasks R.Shahoyan, 25/06/ Including TRD into track fit (JIRA PWGPP-1))  JIRA PWGPP-2: Code is in the release, need to switch setting.
AliRoot survey: Reconstruction P.Hristov 11/06/2013.
PWG4 analysis - Offline week 1/9 PWG4 Status Gustavo Conesa Balbastre INFN-Frascati.
Joe Foster 1 This talk extends the one I gave in 2006 called Visualizing Data with ROOT. –
Reconstruction tools for the study of short-lived resonances in ALICE pp collisions at the LHC startup 1.The ALICE 2.Short-lived resonances.
Event Display Meeting, CERN, Andrea Dainese 1 Visualisation of HF vertices HF vertices (D 0  K , J/y  ee, D  3prong, D  4prong) are not.
V4-19-Release P. Hristov 11/10/ Not ready (27/09/10) #73618 Problems in the minimum bias PbPb MC production at 2.76 TeV #72642 EMCAL: Modifications.
DIS 2011, Newport News, April 2011Joakim Nystrand, University of Bergen 1 Small-x and forward measurements in ALICE Joakim Nystrand University of.
Performance Evaluation for Open Charm and Beauty Measurement at LHC ALICE PID capability from λ and K s 0 measurement at LHC ALICE 筑波大学数理物質科学研究科 Kengo.
I.BelikovWeekly Offline Meeting, CERN, 14 Sep Common track parameterization for the barrel detectors.
Monthly video-conference, 18/12/2003 P.Hristov1 Preparation for physics data challenge'04 P.Hristov Alice monthly off-line video-conference December 18,
January 2009 offline detector review - 2 nd go 1 ● Offline – Geometry – Material budget – Simulation – Raw data – OCDB parameters – Reconstruction ● Calibration.
V4-18-Release P. Hristov 21/06/2010.
Data Formats and Impact on Federated Access
Code&Semantic Observations
Developments of the PWG3 muon analysis code
ALICE analysis preservation
v4-18-Release: really the last revision!
Commissioning of the ALICE HLT, TPC and PHOS systems
AliRoot status and PDC’04
ALICE Production and Analysis Software
Progress with MUON reconstruction
EMCal Offline Code Status: Introduction and tasks
Monte Carlo Tools in ALICE
Event generators.
Open heavy flavor analysis with the ALICE experiment at LHC
Use of Geant4 in experiment interactive frameworks AliRoot
Jet Measurements with the EMCal of ALICE
Geant4 in HARP V.Ivanchenko For the HARP Collaboration
Presentation transcript:

ALICE Offline Tutorial Alice Core Offline 3 March, 2010

Part I AliRoot

References AliRoot “Offline Bible“ Tutorial page http://aliceinfo.cern.ch/export/download/ OfflineDownload/OfflineBible.pdf Tutorial page http://aliceinfo.cern.ch/Offline/AliRoot/ Manual.html#tutorial

Outline The ALICE Offline Web Page Simulation Reconstruction Generators Configuration (Config.C) Reconstruction Classes for analysis ESD classes AOD classes Practical examples

The ALICE Offline Web Page

AliRoot: General Layout Root v5-26-00b Geant3 v1-11 AliRoot v4-18-Release General - Base classes - Steering - IO control Simulation - Interface classes - Event generators - Geometry & Materials Reconstruction - Clusterization - Tracking - PID Analysis - ESD/AOD classes - HBT - Charm, jets, etc. AliRoot classes General - STEER - EVGEN - ANALYSIS Detectors - ITS - TPC - TRD Generators - HIJING - PYTHIA6 - HERWIG “On-line” - HLT - RAW - Monitor. AliRoot modules

AliRoot Layout G R I D A L I E N Virtual MC STEER AliSimulation Fluka PDF HIJING G R I D A L I E N VZERO ACORDE STRUCT HLT Virtual MC PYTHIA6 T0 EVGEN DPMJET RAW Monit STEER AliSimulation AliReconstruction ESD/AOD classes PMD ISAJET Analysis OCDB TRIG FMD ITS TPC TRD TOF PHOS EMCAL HMPID MUON ZDC ROOT CINT GEOM HIST TREE PROOF IO MATH …

AliRoot: Execution Flow Initialization Event Generation Particle Transport Hits AliSimulation Clusters Digits/ Raw digits Event Merging (optional) Summable Digits AliReconstruction Tracking PID ESD AOD Analysis

Config.C: Steering the Simulation Void Config(){ gRandom->SetSeed(123456789); new TGeant3TGeo(“Transporter”); AliRunLoader *rl = AliRunLoader::Open(“galice.root”,defaultFileNames,”recreate ”); gAlice->SetRunLoader(rl); TVirtualMCDecayer *dec = AliDecayerPythia(); dec->Init(); gMC->SetExternalDecayer(dec); … gMC->SetCut(“CUTGAM”,1.e-3); AliGenHIJINGpara *gen = new AliGenHIJINGpara(100); gen->Init(); // Registers its self to gAlice gAlice->SetField(new AliMagFMaps(…); AliBody *BODY = new AliBODY(“BODY”,”Alice envelope”); // Registers itself to gAlice Sets random seed Creates transporter Creates RunLoader Add MC particle decay model (Pythia6) Set up transporter Creates and sets up event simulator Defines ALICE Magnetic Field Defines All materials and geometries/detectors The Run Loader calls in turn the detector loader and handles the IO: files, trees, folders. The object is stored in galice.root.

External Generators: HIJING HIJING (Heavy Ion Jet INteraction Generator) combines A QCD-inspired model of jet production with the Lund model for jet fragmentation Hard or semi-hard parton scatterings with transverse momenta of a few GeV are expected to dominate high energy heavy ion collisions The HIJING model has been developed with special emphasis on the role of mini jets in pp, pA and AA reactions at collider energies

HIJING Hijing used as Underlying event in HI Realistic fluctuations (N,E) from mini-jets Pessimistic multiplicity (dN/dy ~ 6000) Particle Correlation studies Inclusive And in reconstructed jets Nuclear effects Shadowing Quenching (parton energy loss)

pp Minimum Bias Hard Probes Pythia preconfigured processes Pythia, Herwig, Phojet Pythia with ATLAS (or newer) Tuning Hard Probes Pythia tuned to NLO (MNR) NLO topology Nuclear modification of structure functions via EKS in LHAPDF Pythia preconfigured processes See $ALICE_ROOT/PYTHIA6/PythiaProcesses.h EKS: Eskola-Kolhinen-Salgado MNR: Mangano-Nason-Ridolfi

Event Generator Interfaces Cocktail class to assemble events, for example: Underlying event + hard process Different muon sources pA + slow nucleons

Event Generator Interfaces: Parameterizations More examples in $ALICE_ROOT/macros/Config_PDC06_MUON.C // The cocktail generator AliGenCocktail ∗gener = new AliGenCocktail(); // Phi meson (10 particles) AliGenParam ∗phi = new AliGenParam(10,new AliGenMUONlib(),AliGenMUONlib::kPhi,"Vogt PbPb"); phi−>SetPtRange(0, 100); phi->SetYRange(-1., +1.); phi−>SetForceDecay(kDiElectron); // Omega meson (10 particles) AliGenParam ∗omega = new AliGenParam(10,new AliGenMUONlib(),AliGenMUONlib::kOmega,"Vogt PbPb"); omega−>SetPtRange(0, 100); omega−>SetYRange(−1., +1.); omega->SetForceDecay(kDiElectron); // Adding all the components of the cocktail gener −>AddGenerator(phi,"Phi",1); gener −>AddGenerator(omega,"Omega",1); // Settings, common for all components gener −>SetOrigin(0, 0, 0); // vertex position gener −>SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position gener −>SetCutVertexZ(1.); // Truncate at 1 sigma gener −>SetVertexSmear(kPerEvent); gener −>SetTrackingFlag(1); gener >Init();

Example: MUON Library Parameterisations (pt and y of given particle): kPhi, kOmega, kEta, kJpsi, kJpsiFamily, kPsiP, kJpsiFromB, kUpsilon, kUpsilonFamily, kUpsilonPP, kCharm, kBeauty, kPion, kKaon

Run MC: Particle Transport Particles are transported through geometry At each step, a call to StepManager of the class whose volume the particle is in Example: AliITSvPPRasymmFMD::StepManager If not sensitive volume return If not charged return Record Hit, particle Position (start & end of this step), Momentum, Energy lost during last step, Sub-detector in, Time of Flight, Status, Charge, and Track Number In the ITS, hits can also be “merged” Hits might be deleted after SDigitization

Simulation: Summable Digits Apply all detector response simulation which allows results to be “merged” Do not add noise Do not convert AtD Do not apply thresholds Some detectors use hits as SDigits For PHOS, EMCAL the hits are already summed HMPID saves rings/photons Change size Redo it

Digitization Adds noise Applies threshold Applies ADC-ing Random for SPD, SSD Correlated for SDD Applies threshold Simple threshold for SPD,SSD 2 level threshold for SDD Applies ADC-ing 10 bit for SDD, SSD 108 conversion for SDD Zero suppression 2 integer coordinates, 1 integer signal Simulation + info by detector type Take out the pictures

Reconstruction Possible inputs DATE DDL files (only for test) RAW DATE file (only for test) RAW rootified file (standard format) MC/Digit files (standard for simulated data) Local/Detector reconstruction (Files <DET>.RecPoints.root) Calibration Clusterisation Cluster splitting… Vertex finder: Fills ESD Primary vertex (Z coordinate) found in SPD, and/or T0. Tracking (HLT and/or Barrel), filling of ESD Gives final vertex from tracks and secondary vertexes. HLT uses Conformal mapping (or similar) or a fast Kalman filter Final tracking is a full Kalman filter In: {TPC→ITS}→ Out: {ITS→TPC →[TRD→TOF →(EMCAL|HMPID|PHOS)]}→ Refit: {TOF→TRD→TPC→ITS} MUON. Combined (Bayesian) PID: Fills ESD HLT rec.

The ESD Ideally: user@host> root.exe ……………………… AliESDVertex Estimated with SPD AliESDTZERO TZERO information AliESDVertex Estimated with ESD tracks AliESDVZERO VZERO infornation ESDCascade Cascade vertices AliESDEvent AliMultiplicity SPD tracklets ESDPmdTrack Tracks in PMD ESDKink Kinks ESDCaloClusters PHOS/EMCAL clusters ESDTrack Detailed information in central barrel ESDTrdTracks Triggered tracks in TRD Ideally: user@host> root.exe ……………………… root[0] gSystem->Load(“libTree”) root[1] gSystem->Load(“libVMC”) root[2] gSystem->Load(“libSTEERBase”) root[3] gSystem->Load(“libESD”) root[4] .x AnyAnalysisMacro.C AliESDMuonTrack Tracks in Muon arm ESDV0 V0 vertices ESDFMD FMD multiplicity

Common base classes for ESDs and AODs AliVEvent standard access to containers common getters and setters AliESDEvent AliAODEvent AliVHeader AliESDHeader AliAODHeader AliVParticle AliExternalTrackParam AliAODTrack … AliESDtrack

Current content of the standard AOD AliAODEvent contains an (extendable) TList event information TClonesArray of tracks TClonesArray of vertices TClonesArray of jets Container for SPD tracklets AliAODHeader AliAODTrack AliAODVertex AliAODJet AliAODTracklets

The ESD Layout AliESDEvent() Defines the interface to the ESD tree content Mainly contains a TList of pointers E.g. to TClonesArray of tracks Access to standard contents ...ReadFromTree(...) ...GetEntry(Int_t) AliESDEvent:: GetTrack(Int_t) Similar structure in the AODs Underline ReadFromTree

General idea: ESD & AOD Very simple… use a list UserInfo AliAODEvent TList AliAODHeader Standard part AliAODTrack AliAODVertex AliAODCaloCluster AliAODJet … position of these next 3 slides to be discussed (too complicated for the beginning) User part AliAODUser1 AliAODUser2 …

Extending the AOD Flexible and Extendable users can just use the standard AOD (S-AOD) or start from it to obtain more detailed results this new information (U-AOD) can be stored alongside the S-AOD in the TList (= in the same AOD) S-AOD GetList()->Add(Obj) … U1-AOD U1-AOD … S-AOD GetList()->Add(Obj) U2-AOD U1’-AOD U1’-AOD GetList()->Add(Obj) … The idea is that every user can extend the AODs with “non-standard” objects

Reading back void AliAODEvent::GetStdContent() const { // set pointers for standard content fHeader = (AliAODHeader*)fAODObjects->At(0); fTracks = (TClonesArray*)fAODObjects->At(1); fVertices = (TClonesArray*)fAODObjects->At(2); fClusters = (TClonesArray*)fAODObjects->At(3); fJets = (TClonesArray*)fAODObjects->At(4); } AliAODTrack* AliAODEvent::GetTrack(Int_t i) const { return (AliAODTrack*) fTracks->At(i); } AliAODEvent fHeader fTracks fVertices fClusters fJets UserInfo AliAODEvent TList AliAODHeader AliAODTrack AliAODVertex AliAODCluster AliAODJet … AliAODUser1 AliAODUser2 … AliAODJet …and the same user also can access the “non-standard” objects from the previous slide

AliESDEvent and AliESDtrack classes Accumulation and exchange of tracking information among the barrel detectors Contained in the ESD and used for physics analysis Class AliESDtrack : public AliExternalTrackParam final params reconstruction status flags length, time, combined PID vertex constrained params impact parameters & cov.matrix params at the outer TPC wall params at the inner TPC wall … detector specific info (chi2, num.of clusters, PID…)

ESD Example: Loop on the tracks void test1(const char * fname ="AliESDs.root") { TFile * file = TFile::Open(fname); TTree * tree = (TTree*)file->Get("esdTree"); AliESDEvent * esd = new AliESDEvent(); // The signal ESD object is put here esd->ReadFromTree(tree); Int_t nev = tree->GetEntries(); for (Int_t iev=0; iev<nev; iev++) { tree->GetEntry(iev); // Get ESD Int_t ntrk = esd->GetNumberOfTracks(); for(Int_t irec=0; irec<ntrk; irec++) { AliESDtrack * track = esd->GetTrack(irec); cout << "Pt: " << track->Pt() << endl; } file->Close(); more simple hands-on example needed that plots a single variable for 1 file

AOD Example: Loop on the tracks AliAODEvent *event= new AliAODEvent(); //The reconstructed events are TTree *aodTree = …; //stored in TTrees (and so can be “chained”) event->ReadFromTree(aodTree); //Sets the branch adresses for //AliAODEvent content Int_t i=0; while (aodTree->GetEvent(i++)) { //loop over the reconstructed events … //select run, event number etc… if (event->GetEventType() != … ) continue; //select the event type AliAODVertex *primary=event->GetPrimaryVertex(); if (/* some cuts on the primary vertex */) continue; Int_t ntracks=event->GetNumberOfTracks(); for (i=0; i<ntracks; i++) { //loop over ESD tracks (or kinks, V0s…) AliAODTrack *track=event->GetTrack(i); if (/* select tracks according to proper selection (quality) criteria */) { … //do whatever with the selected tracks }

ESD Example: PID AliESDEvent *event=new AliESDEvent(); //The reconstructed events are TTree *esdTree = …; //stored in TTrees (and so can be “chained”) event->ReadFromTree(esdTree); //Sets the branch adresses for AliESDEvent content Int_t i=0; while (esdTree->GetEvent(i++) { //loop over the reconstructed events … //event selection… Double_t priors[AliPID::kSPECIES]={…} //A set of a priori probabilities AliPID::SetPriors(priors); Int_t ntracks=event->GetNumberOfTracks(); for (i=0; i<ntracks; i++) { //loop over ESD tracks (or kinks, V0s …) AliESDtrack *track=event->GetTrack(i); ULong _t status=AliESDtrack::kTPCpid | AliESDtrack::kTOFpid; if ((track->GetStatus()&status) != status) continue; //select tracks with the proper status if ( … ) continue; //some other selection (quality) criteria Double_t probDensity[AliPID::kSPECIES]; track->GetESDpid(probDensity); AliPID pid(probDensity); Double_t pp=pid.GetProbablity(AliPID::kProton); // probability to be a proton Double_t pk=pid.GetProbability(AliPID::kKaon); // probability to be a kaon … if (pp > 1./AliPID::kSPECIES) { /* this is a proton */} } What is the main idea? No final result stored, it is up to the analysis to define the initial probabilities and final cuts

Pieces needed for simulation/reconstruction sim.C macro that runs the simulation AliSimulation sim; sim.Run(); rec.C macro that runs the reconstruction AliReconstruction rec; rec.Run(); Config.C macro that configures the simulation add short example of Config.C?

Files produced in Sim/Rec Simulation galice.root: Event header Kinematics.root: MC particles DET.Hits.root: Hits of MC particles in sensitive regions DET.(S)Digits.root: Induced signal in the electronics raw.root: Digits converted to the RAW data format (optional) Reconstruction DET.RecPoints.root: Clusters AliESDs.root: "Event Summary Data" Reconstruction output AliESDfriends.root: Reconstruction debugging information (optional) AliAOD.root: "Analysis Object Data" Condensed reconstruction output (optional)

Exercises from $ALICE_ROOT/test Particle gun (test/gun) Generation from a kinematics tree (test/genkine) Event merging (test/merge) Proton-proton benchmark (test/ppbench) Pb-Pb benchmark (test/PbPbbench) Proton-proton simulation and reconstruction loading the libraries in Root (test/pploadlibs)

Particle gun: $ALICE_ROOT/test/gun Cocktail generator AliGenCocktail *gener = new AliGenCocktail(); gener->SetPhiRange(0, 360); … gener->SetThetaRange(thmin,thmax); gener->SetOrigin(0, 0, 0); //vertex position gener->SetSigma(0, 0, 0); //Sigma in (X,Y,Z) (cm) on IP position Components AliGenFixed *pG1=new AliGenFixed(1); pG1->SetPart(2212); pG1->SetMomentum(2.5); pG1->SetTheta(109.5-3); pG1->SetPhi(10); gener->AddGenerator(pG1,"g1",1); Simulation AliSimulation sim; sim.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO"); sim.SetMakeDigitsFromHits("ITS TPC"); sim.SetWriteRawData("ALL","raw.root",kTRUE) Reconstruction from raw AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); AliTracker::SetFieldMap(field,kTRUE); AliReconstruction reco; reco.SetUniformFieldTracking(kFALSE); reco.SetWriteESDfriend(); reco.SetWriteAlignmentData(); AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam(); AliTPCReconstructor::SetRecoParam(tpcRecoParam); reco.SetInput("raw.root"); reco.SetWriteAOD(); reco.Run();

Exercise Modify the example to test the identification of muons in the barrel detectors Modify test.C to print only the muon tracks

Visualization Usage alieve http://aliceinfo.cern.ch/Offline/Activities/Visualisation/ Usage alieve .x visscan_local.C, visscan_raw.C, visscan_mcideal.C

Visualization – II Usage alieve .x alieve_init.C Use then the macros in the EVE folder in TBrowser Move it after the examples

Generation from a kinematics tree Creation of a kinematics tree: Pythia events containing D*D0  See test/genkine/gen/fastSim.C Selection of the specific decay modes via AliPythia * py= AliPythia::Instance(); py->SetMDME(737,1,0); //forbid D*+->D+ + pi0 py->SetMDME(738,1,0); //forbid D*+->D+ + gamma Selection of desired events in the event loop Simulation using the kinematic tree: see Config.C AliGenExtFile *gener = new AliGenExtFile(-1); AliGenReaderTreeK * reader = new AliGenReaderTreeK(); reader->SetFileName("galice.root"); reader->AddDir("../gen"); gener->SetReader(reader); Reconstruction

Exercise Modify the example to select Pythia events containing the decay c+pK Obtain the list of decays with AliPythia * py = AliPythia::Instance() py->Pylist(12); >> decays.txt It is also in PYTHIA6/AliDecayerPythia.cxx Generate raw data Reconstruct from raw data

Event merging: $ALICE_ROOT/test/merge Generate & reconstruct underlying events (./backgr) Simulation (full chain up to Digits) AliSimulation sim; sim.Run(2); Reconstruction AliReconstruction rec; rec.Run(); Generate, merge & reconstruct signal events (./signal) Simulation (with event merging) sim.MergeWith(“../backr/galice.root”,3); sim.Run(6);

Event merging: test.C Take it out void test(const char * sdir ="signal", const char * bdir ="backgr") { TStopwatch timer; timer.Start(); TString name; // Signal file, tree, and branch name = sdir; name += "/AliESDs.root"; TFile * fSig = TFile::Open(name.Data()); TTree * tSig = (TTree*)fSig->Get("esdTree"); AliESDEvent * esdSig = new AliESDEvent; // The signal ESD esdSig->ReadFromTree(tSig); // Run loader (signal events) name += "/galice.root"; AliRunLoader* rlSig = AliRunLoader::Open(name.Data()); // Run loader (underlying events) name = bdir; AliRunLoader* rlUnd = AliRunLoader::Open(name.Data(),"Underlying"); // gAlice rlSig->LoadgAlice(); rlUnd->LoadgAlice(); gAlice = rlSig->GetAliRun(); // Now load kinematics and event header rlSig->LoadKinematics(); rlSig->LoadHeader(); rlUnd->LoadKinematics(); rlUnd->LoadHeader(); // Loop on events: check that MC and data contain the same number of events Long64_t nevSig = rlSig->GetNumberOfEvents(); Long64_t nevUnd = rlUnd->GetNumberOfEvents(); Long64_t nSigPerUnd = nevSig/nevUnd; cout << nevSig << " signal events" << endl; cout << nevUnd << " underlying events" << endl; cout << nSigPerUnd << " signal events per one underlying" << endl; for (Int_t iev=0; iev<nevSig; iev++) { cout << "Signal event " << iev << endl; Int_t ievUnd = iev/nSigPerUnd; cout << "Underlying event " << ievUnd << endl; // Get signal ESD tSig->GetEntry(iev); // Get underlying kinematics rlUnd->GetEvent(ievUnd); // Particle stack AliStack * stackSig = rlSig->Stack(); Int_t nPartSig = stackSig->GetNtrack(); AliStack * stackUnd = rlUnd->Stack(); Int_t nPartUnd = stackUnd->GetNtrack(); Int_t nrec = esdSig->GetNumberOfTracks(); cout << nrec << " reconstructed tracks" << endl; for(Int_t irec=0; irec<nrec; irec++) { AliESDtrack * track = esdSig->GetTrack(irec); UInt_t label = TMath::Abs(track->GetLabel()); if (label>=10000000) { // Underlying event. 10000000 is the // value of fkMASKSTEP in AliRunDigitizer label %=10000000; if (label>=nPartUnd) continue; TParticle * part = stackUnd->Particle(label); } else { cout << " Track " << label << " from the signal event" << endl; if (label>=nPartSig) continue; TParticle * part = stackSig->Particle(label); if(part) part->Print(); fSig->Close(); timer.Stop(); timer.Print(); Take it out

PYTHIA preconfigured processes Heavy Flavors (open) kPyCharm, kPyBeauty kPyCharmUnforced, kPyBeautyUnforced kPyCharmPbPbMNR, kPyD0PbPbMNR, kPyDPlusPbPbMNR, kPyBeautyPbPbMNR, kPyCharmpPbMNR, kPyD0pPbMNR, kPyDPluspPbMNR, kPyBeautypPbMNR, kPyCharmppMNR, kPyD0ppMNR, kPyDPlusppMNR, kPyBeautyppMNR Heavy Flavor (resonances) kPyJpsi, kPyJpsiChi Minimum Bias kPyMb, kPyMbNonDiffr Jets and high-pT gammas kPyJets, kPyDirectGamma, W kPyW