-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bunch of files for LF production with trigger on nuclei after trasport
- Loading branch information
Showing
4 changed files
with
290 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#if !defined(__CINT__) || defined(__MAKECINT__) | ||
#include <Riostream.h> | ||
#include <AliRun.h> | ||
#include <TParticle.h> | ||
#include <TString.h> | ||
#include <TTree.h> | ||
#include <TArrayF.h> | ||
#include <AliStack.h> | ||
#include <AliRunLoader.h> | ||
#include <TMath.h> | ||
#include <AliHeader.h> | ||
#include <AliGenEventHeader.h> | ||
#include <TH1F.h> | ||
#include <TNtuple.h> | ||
#include <TFile.h> | ||
#include <AliESD.h> | ||
#include <AliESDVertex.h> | ||
#endif | ||
|
||
void ReadKine() | ||
{ | ||
if (gAlice) | ||
{ | ||
delete gAlice; | ||
gAlice = 0x0; | ||
} | ||
|
||
AliRunLoader *rl = AliRunLoader::Open("galice.root"); | ||
if (rl == 0x0) | ||
{ | ||
std::cerr << "Can not open session" << std::endl; | ||
return; | ||
} | ||
|
||
rl->LoadHeader(); | ||
rl->LoadKinematics(); | ||
Int_t nev = rl->GetNumberOfEvents(); | ||
int codes[4] = {AliPID::ParticleCode(AliPID::kDeuteron), AliPID::ParticleCode(AliPID::kTriton), AliPID::ParticleCode(AliPID::kHe3), AliPID::ParticleCode(AliPID::kAlpha)}; | ||
for (Int_t iev = 0; iev < nev; iev++) | ||
{ | ||
rl->GetEvent(iev); | ||
AliStack *stack = rl->Stack(); | ||
TArrayF mcVertex(3); | ||
rl->GetHeader()->GenEventHeader()->PrimaryVertex(mcVertex); | ||
TTree *treek = (TTree *)rl->TreeK(); | ||
Int_t entries = (Int_t)treek->GetEntries(); | ||
printf("Number of particles = %d\n", entries); | ||
for (Int_t i = 0; i < entries; i++) | ||
{ | ||
TParticle *part = (TParticle *)stack->Particle(i); | ||
Int_t pdgCode = part->GetPdgCode(); | ||
for (int iC = 0; iC < 4; ++iC) { | ||
if (pdgCode == codes[iC]) { | ||
if (stack->IsSecondaryFromMaterial(i)) { | ||
printf("Particle with pdg=%d FOUND IN KINE TREE\n",pdgCode); | ||
exit(EXIT_SUCCESS); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
exit(EXIT_FAILURE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* AliDPG - ALICE Experiment Data Preparation Group | ||
* Simulation steering script | ||
* | ||
*/ | ||
|
||
/*****************************************************************/ | ||
/*****************************************************************/ | ||
/*****************************************************************/ | ||
|
||
#if (!defined(__CLING__) && !defined(__CINT__)) || defined(__ROOTCLING__) || defined(__ROOTCINT__) | ||
#include "TSystem.h" | ||
#include "TROOT.h" | ||
#include "AliSimulation.h" | ||
#endif | ||
|
||
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) | ||
#include "SimulationConfig.C" | ||
#endif | ||
|
||
void Digitize() | ||
{ | ||
|
||
// number of events configuration | ||
Int_t nev = 200; | ||
if (gSystem->Getenv("CONFIG_NEVENTS")) | ||
nev = atoi(gSystem->Getenv("CONFIG_NEVENTS")); | ||
|
||
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) | ||
// in root5 the ROOT_VERSION_CODE is defined only in ACLic mode | ||
#else | ||
gROOT->LoadMacro("$ALIDPG_ROOT/MC/SimulationConfig.C"); | ||
#endif | ||
|
||
// simulation configuration | ||
ESimulation_t simulationConfig = kSimulationDefault; | ||
if (gSystem->Getenv("CONFIG_SIMULATION")) { | ||
Bool_t valid = kFALSE; | ||
for (Int_t isim = 0; isim < kNSimulations; isim++) | ||
if (strcmp(gSystem->Getenv("CONFIG_SIMULATION"), SimulationName[isim]) == 0) { | ||
simulationConfig = (ESimulation_t) isim; | ||
valid = kTRUE; | ||
break; | ||
} | ||
if (!valid) { | ||
printf(">>>>> Unknown simulation configuration: %s \n", gSystem->Getenv("CONFIG_SIMULATION")); | ||
abort(); | ||
} | ||
} | ||
|
||
/* initialisation */ | ||
Int_t error; | ||
TString config_macro = "$ALIDPG_ROOT/MC/Config.C"; | ||
if (gROOT->LoadMacro(Form("%s/Config.C", gSystem->pwd()), &error, kTRUE) == 0) { | ||
printf(">>>>> Config.C macro detected in CWD, using that one \n"); | ||
config_macro = Form("%s/Config.C", gSystem->pwd()); | ||
} | ||
gROOT->LoadMacro("$ALIDPG_ROOT/MC/Config_LoadLibraries.C"); | ||
gROOT->ProcessLine("Config_LoadLibraries();"); | ||
|
||
AliGeomManager::LoadGeometry("geometry.root"); | ||
AliRunLoader* rl = AliRunLoader::Open("galice.root"); | ||
rl->LoadgAlice(); | ||
AliRunLoader::Instance()->CdGAFile(); | ||
gAlice->InitLoaders(); | ||
AliRunLoader::Instance()->LoadKinematics(); | ||
AliRunLoader::Instance()->LoadTrackRefs(); | ||
AliRunLoader::Instance()->LoadHits(); | ||
|
||
|
||
AliSimulation sim(config_macro.Data()); | ||
/* configuration */ | ||
SimulationConfig(sim, simulationConfig); | ||
|
||
AliCDBManager::Instance()->SetSnapshotMode("OCDBsim.root"); | ||
AliCDBManager::Instance()->SetRun(atoi(gSystem->Getenv("CONFIG_RUN"))); | ||
AliGRPManager grpM; | ||
grpM.ReadGRPEntry(); | ||
grpM.SetMagField(); | ||
|
||
sim.SetRunGeneration(false); | ||
sim.SetRunSimulation(false); | ||
sim.Run(nev); | ||
|
||
|
||
// TString sdig = "TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO FMD AD"; | ||
// TString h2dig = "ITS TPC"; | ||
// sim.RunSDigitization(sdig.Data()); | ||
// sim.RunDigitization("ALL", h2dig.Data()); | ||
// sim.RunHitsDigitization(h2dig.Data()); | ||
// sim.RunTrigger(); | ||
// sim.RunHLT(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* AliDPG - ALICE Experiment Data Preparation Group | ||
* Simulation steering script | ||
* | ||
*/ | ||
|
||
/*****************************************************************/ | ||
/*****************************************************************/ | ||
/*****************************************************************/ | ||
|
||
#if (!defined(__CLING__) && !defined(__CINT__)) || defined(__ROOTCLING__) || defined(__ROOTCINT__) | ||
#include "TSystem.h" | ||
#include "TROOT.h" | ||
#include "AliSimulation.h" | ||
#endif | ||
|
||
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) | ||
#include "SimulationConfig.C" | ||
#endif | ||
|
||
void Generate() | ||
{ | ||
|
||
// number of events configuration | ||
Int_t nev = 200; | ||
if (gSystem->Getenv("CONFIG_NEVENTS")) | ||
nev = atoi(gSystem->Getenv("CONFIG_NEVENTS")); | ||
|
||
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) | ||
// in root5 the ROOT_VERSION_CODE is defined only in ACLic mode | ||
#else | ||
gROOT->LoadMacro("$ALIDPG_ROOT/MC/SimulationConfig.C"); | ||
#endif | ||
|
||
// simulation configuration | ||
ESimulation_t simulationConfig = kSimulationDefault; | ||
if (gSystem->Getenv("CONFIG_SIMULATION")) { | ||
Bool_t valid = kFALSE; | ||
for (Int_t isim = 0; isim < kNSimulations; isim++) | ||
if (strcmp(gSystem->Getenv("CONFIG_SIMULATION"), SimulationName[isim]) == 0) { | ||
simulationConfig = (ESimulation_t) isim; | ||
valid = kTRUE; | ||
break; | ||
} | ||
if (!valid) { | ||
printf(">>>>> Unknown simulation configuration: %s \n", gSystem->Getenv("CONFIG_SIMULATION")); | ||
abort(); | ||
} | ||
} | ||
|
||
/* initialisation */ | ||
Int_t error; | ||
TString config_macro = "$ALIDPG_ROOT/MC/Config.C"; | ||
if (gROOT->LoadMacro(Form("%s/Config.C", gSystem->pwd()), &error, kTRUE) == 0) { | ||
printf(">>>>> Config.C macro detected in CWD, using that one \n"); | ||
config_macro = Form("%s/Config.C", gSystem->pwd()); | ||
} | ||
gROOT->LoadMacro("$ALIDPG_ROOT/MC/Config_LoadLibraries.C"); | ||
gROOT->ProcessLine("Config_LoadLibraries();"); | ||
AliSimulation sim(config_macro.Data()); | ||
|
||
/* configuration */ | ||
SimulationConfig(sim, simulationConfig); | ||
|
||
/* run generation */ | ||
sim.SetMakeSDigits(""); | ||
sim.SetMakeDigits(""); | ||
sim.SetMakeDigitsFromHits(""); | ||
sim.SetWriteRawData(""); | ||
sim.SetRunHLT(""); | ||
sim.Run(nev); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters