Skip to content

Commit 4f84681

Browse files
DanielSamitzcoppedisffiondaBenedikt Volkel
authored
EM Cocktail: json files + Exodus (#15)
* Adding GeneratorSpectator: generator for spectator protons (#9) * Adding a test macro for GeneratorSpectators * Set pmax in def. constructor to avoid infinite loop in generation + small fixes * add GeneratorParamEMlib for LMee simulations (methods from AliGenEMlib) (#10) * Use VMC standalone if found * account for VMC standalone * implemented .json file format for parametrization files * added Exodus decayer * bugfix Exodus, updated use of PythiaDecayerConfig in GeneratorParam --------- Co-authored-by: Chiara <[email protected]> Co-authored-by: ffionda <[email protected]> Co-authored-by: Benedikt Volkel <[email protected]>
1 parent 16f18ba commit 4f84681

File tree

10 files changed

+1509
-168
lines changed

10 files changed

+1509
-168
lines changed

GeneratorCosmics/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ find_package(ROOT REQUIRED COMPONENTS EG)
1212
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
1313
include(${ROOT_USE_FILE})
1414

15+
#---VMC
16+
# set by VMC standalone, in ROOT case we don't use it
17+
set(VMC_LIBRARIES)
18+
if(NOT ROOT_vmc_FOUND)
19+
find_package(VMC REQUIRED)
20+
endif()
21+
1522
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.)
1623

1724
set(HEADERS GeneratorCosmics.h)
@@ -20,7 +27,7 @@ ROOT_GENERATE_DICTIONARY(G__GeneratorCosmics ${HEADERS} LINKDEF GeneratorCosmics
2027

2128
#---Create a shared library with geneated dictionary
2229
add_library(GeneratorCosmics SHARED GeneratorCosmics.cxx G__GeneratorCosmics.cxx)
23-
target_link_libraries(GeneratorCosmics ${ROOT_LIBRARIES})
30+
target_link_libraries(GeneratorCosmics ${ROOT_LIBRARIES} ${VMC_LIBRARIES})
2431

2532

2633
set_target_properties(GeneratorCosmics

GeneratorParam/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ find_package(ROOT REQUIRED COMPONENTS EG)
1212
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
1313
include(${ROOT_USE_FILE})
1414

15+
#---VMC
16+
# set by VMC standalone, in ROOT case we don't use it
17+
set(VMC_LIBRARIES)
18+
if(NOT ROOT_vmc_FOUND)
19+
find_package(VMC REQUIRED)
20+
endif()
21+
1522
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.)
1623

17-
set(HEADERS GeneratorParam.h GeneratorParamLibBase.h GeneratorParamMUONlib.h GeneratorParamEMlib.h GeneratorParamEMlibV2.h PythiaDecayerConfig.h)
24+
set(HEADERS GeneratorParam.h GeneratorParamLibBase.h GeneratorParamMUONlib.h GeneratorParamEMlib.h GeneratorParamEMlibV2.h PythiaDecayerConfig.h ExodusDecayer.h)
1825

1926
ROOT_GENERATE_DICTIONARY(G__GeneratorParam ${HEADERS} LINKDEF GeneratorParamLinkDef.h)
2027

2128
#---Create a shared library with geneated dictionary
22-
add_library(GeneratorParam SHARED GeneratorParam.cxx GeneratorParamLibBase.cxx GeneratorParamMUONlib.cxx GeneratorParamEMlib.cxx GeneratorParamEMlibV2.cxx PythiaDecayerConfig.cxx G__GeneratorParam.cxx)
23-
target_link_libraries(GeneratorParam ${ROOT_LIBRARIES})
29+
add_library(GeneratorParam SHARED GeneratorParam.cxx GeneratorParamLibBase.cxx GeneratorParamMUONlib.cxx GeneratorParamEMlib.cxx GeneratorParamEMlibV2.cxx PythiaDecayerConfig.cxx ExodusDecayer.cxx G__GeneratorParam.cxx)
30+
target_link_libraries(GeneratorParam ${ROOT_LIBRARIES} ${VMC_LIBRARIES})
2431

2532

2633
set_target_properties(GeneratorParam

GeneratorParam/ExodusDecayer.cxx

Lines changed: 728 additions & 0 deletions
Large diffs are not rendered by default.

GeneratorParam/ExodusDecayer.h

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#ifndef EXODUSDECAYER_H
2+
#define EXODUSDECAYER_H
3+
4+
// Copyright CERN and copyright holders of ALICE O2. This software is
5+
// distributed under the terms of the GNU General Public License v3 (GPL
6+
// Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// See http://alice-o2.web.cern.ch/license for full licensing information.
9+
//
10+
// In applying this license CERN does not waive the privileges and immunities
11+
// granted to it by virtue of its status as an Intergovernmental Organization
12+
// or submit itself to any jurisdiction.
13+
14+
//---------------------------------------------------------------------------------------------------
15+
//
16+
// Generate electron-pair mass distributions for Dalitz decays according
17+
// to the Kroll-Wada parametrization: N. Kroll, W. Wada: Phys. Rev 98(1955)1355
18+
// and generate electron-pair mass distributions for resonances according
19+
// to the Gounaris-Sakurai parametrization: G.J. Gounaris, J.J. Sakurai: Phys.Rev.Lett. 21(1968)244
20+
//
21+
// For the electromagnetic form factor the parameterization from
22+
// Lepton-G is used: L.G. Landsberg et al.: Phys. Rep. 128(1985)301
23+
//
24+
// Ralf Averbeck ([email protected])
25+
// Irem Erdemir ([email protected])
26+
//
27+
// adapted for O2: Daniel Samitz ([email protected])
28+
//
29+
//---------------------------------------------------------------------------------------------------
30+
31+
#include "TVirtualMCDecayer.h"
32+
#include <TLorentzVector.h>
33+
#include <TF1.h>
34+
#include <TH1.h>
35+
#include "TDatabasePDG.h"
36+
37+
//class TH1F;
38+
//class TClonesArray;
39+
40+
class ExodusDecayer : public TVirtualMCDecayer
41+
{
42+
public:
43+
ExodusDecayer();
44+
virtual ~ExodusDecayer();
45+
virtual void Init();
46+
virtual void Decay(Int_t idpart,TLorentzVector* pparent);
47+
virtual Int_t ImportParticles(TClonesArray *particles) {return -1;}
48+
virtual void SetForceDecay(Int_t) {;}
49+
virtual void ForceDecay() {;}
50+
virtual Float_t GetPartialBranchingRatio(Int_t /*ipart*/) {return -1;}
51+
virtual Float_t GetLifetime(Int_t /*kf*/) {return -1;}
52+
virtual void ReadDecayTable() {;}
53+
54+
virtual TH1F* ElectronPairMassHistoPion() {return fEPMassPion;}
55+
virtual TH1F* ElectronPairMassHistoEta() {return fEPMassEta;}
56+
virtual TH1F* ElectronPairMassHistoEtaPrime() {return fEPMassEtaPrime;}
57+
virtual TH1F* ElectronPairMassHistoEtaPrime_toOmega() {return fEPMassEtaPrime_toOmega;}
58+
virtual TH1F* ElectronPairMassHistoRho() {return fEPMassRho;}
59+
virtual TH1F* ElectronPairMassHistoOmega() {return fEPMassOmega;}
60+
virtual TH1F* ElectronPairMassHistoOmegaDalitz() {return fEPMassOmegaDalitz;}
61+
virtual TH1F* ElectronPairMassHistoPhi() {return fEPMassPhi;}
62+
virtual TH1F* ElectronPairMassHistoPhiDalitz() {return fEPMassPhiDalitz;}
63+
virtual TH1F* ElectronPairMassHistoPhiDalitz_toPi0() {return fEPMassPhiDalitz_toPi0;}
64+
virtual TH1F* ElectronPairMassHistoJPsi() {return fEPMassJPsi;}
65+
66+
virtual const TLorentzVector* Products_pion() const {return fProducts_pion;}
67+
virtual const TLorentzVector* Products_eta() const {return fProducts_eta;}
68+
virtual const TLorentzVector* Products_etaprime() const {return fProducts_etaprime;}
69+
virtual const TLorentzVector* Products_etaprime_toOmega() const {return fProducts_etaprime_toOmega;}
70+
virtual const TLorentzVector* Products_rho() const {return fProducts_rho;}
71+
virtual const TLorentzVector* Products_omega() const {return fProducts_omega;}
72+
virtual const TLorentzVector* Products_omega_dalitz() const {return fProducts_omega_dalitz;}
73+
virtual const TLorentzVector* Products_phi() const {return fProducts_phi;}
74+
virtual const TLorentzVector* Products_phi_dalitz() const {return fProducts_phi_dalitz;}
75+
virtual const TLorentzVector* Products_phi_dalitz_toPi0() const {return fProducts_phi_dalitz_toPi0;}
76+
virtual const TLorentzVector* Products_jpsi() const {return fProducts_jpsi;}
77+
78+
protected:
79+
// Histograms for electron pair mass
80+
TH1F* fEPMassPion;
81+
TH1F* fEPMassEta;
82+
TH1F* fEPMassEtaPrime;
83+
TH1F* fEPMassEtaPrime_toOmega;
84+
TH1F* fEPMassRho;
85+
TH1F* fEPMassOmega;
86+
TH1F* fEPMassOmegaDalitz;
87+
TH1F* fEPMassPhi;
88+
TH1F* fEPMassPhiDalitz;
89+
TH1F* fEPMassPhiDalitz_toPi0;
90+
TH1F* fEPMassJPsi;
91+
92+
TF1* fPol;
93+
94+
// Decay products
95+
TLorentzVector fProducts_pion[3];
96+
TLorentzVector fProducts_eta[3];
97+
TLorentzVector fProducts_etaprime[3];
98+
TLorentzVector fProducts_etaprime_toOmega[3];
99+
TLorentzVector fProducts_rho[2];
100+
TLorentzVector fProducts_omega[2];
101+
TLorentzVector fProducts_omega_dalitz[3];
102+
TLorentzVector fProducts_phi[2];
103+
TLorentzVector fProducts_phi_dalitz[3];
104+
TLorentzVector fProducts_phi_dalitz_toPi0[3];
105+
TLorentzVector fProducts_jpsi[2];
106+
107+
108+
Bool_t fInit;
109+
110+
private:
111+
Double_t GounarisSakurai(Float_t mass, Double_t vmass, Double_t vwidth, Double_t emass);
112+
Double_t RhoShapeFromNA60(Float_t mass, Double_t vmass, Double_t vwidth, Double_t emass);
113+
Double_t Lorentz(Float_t mass, Double_t vmass, Double_t vwidth);
114+
115+
ClassDef(ExodusDecayer, 1)
116+
};
117+
#endif

GeneratorParam/GeneratorParam.cxx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,18 @@ void GeneratorParam::Init() {
182182
//
183183
//
184184
// Initialize the decayer
185+
fDecayer->SetForceDecay(fForceDecay);
185186
fDecayer->Init();
186187
// initialise selection of decay products
187188
InitChildSelect();
188-
fDecayerConfig->Init(fForceDecay);
189189
}
190190

191191
void GeneratorParam::GenerateEvent() {
192192
//
193193
// Generate one event
194194
//
195195
fParticles->Clear();
196-
// ??? fDecayer->SetForceDecay(fForceDecay);
197-
fDecayer->Init();
198-
199-
//
196+
200197
Float_t polar[3] = {
201198
0, 0, 0}; // Polarisation of the parent particle (for GEANT tracking)
202199
Double_t origin0[3]; // Origin of the generated parent particle (for GEANT
@@ -243,7 +240,7 @@ void GeneratorParam::GenerateEvent() {
243240
// custom pdg codes to destinguish direct photons
244241
if ((pdg >= 220000) && (pdg <= 220001))
245242
pdg = 22;
246-
fChildWeight=(fDecayerConfig->GetPartialBranchingRatio(pdg))*fParentWeight;
243+
fChildWeight=(fDecayer->GetPartialBranchingRatio(pdg))*fParentWeight;
247244
TParticlePDG *particle = pDataBase->GetParticle(pdg);
248245
Float_t am = particle->Mass();
249246
gRandom->RndmArray(2, random);

GeneratorParam/GeneratorParam.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class GeneratorParam : public TGenerator {
9292
// force decay type
9393
virtual void SetDeltaPt(Float_t delta = 0.01) { fDeltaPt = delta; }
9494
virtual void SetDecayer(TVirtualMCDecayer *decayer) { fDecayer = decayer; }
95-
virtual void SetDecayerConfig(PythiaDecayerConfig *decayerconfig) {fDecayerConfig = decayerconfig; }
9695
virtual void SetForceGammaConversion(Bool_t force = kTRUE) {
9796
fForceConv = force;
9897
}
@@ -160,7 +159,6 @@ class GeneratorParam : public TGenerator {
160159
Bool_t fSelectAll = false; // Flag for transportation of Background while
161160
// using SetForceDecay()
162161
TVirtualMCDecayer *fDecayer = 0; // ! Pointer to virtual decyer
163-
PythiaDecayerConfig *fDecayerConfig = 0; // Pointer to decayer config
164162
Bool_t fForceConv = false; // force converson of gammas
165163
Bool_t fKeepParent =
166164
false; // Store parent even if it does not have childs within cuts

0 commit comments

Comments
 (0)