-
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.
Merge pull request #423 from gconesab/master
Macros to run Pythia6 and EPOS with user defined trigger on MC events…
- Loading branch information
Showing
3 changed files
with
111 additions
and
0 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,31 @@ | ||
/// | ||
/// \file EPOS_UserTrigger.C | ||
/// \brief Configuration of EPOSLHC with external trigger user defined | ||
/// | ||
/// Generate EPOSLHC events, while the event is generated, check that | ||
/// the user trigger conditions on the event are fulfilled. The user trigger | ||
/// must be defined in macro UserTrigger.C | ||
/// | ||
/// \author Luca Micheletti <luca.micheletti@cern.ch> | ||
/// \author Gustavo Conesa Balbastre <gustavo.conesa.balbastre@cern.ch> | ||
|
||
#if !defined(__CINT__) || defined(__MAKECINT__) | ||
#include "UserTrigger.C" | ||
#endif | ||
|
||
//------ | ||
/// Main, configure EPOSLHC events via standard configuration in GeneratorConfig.C | ||
/// adding an external event trigger defined in UserTrigger.C | ||
//------ | ||
AliGenerator * GeneratorCustom() | ||
{ | ||
AliGenerator * generator = GeneratorEPOSLHC(); | ||
|
||
#if defined(__CINT__) | ||
gROOT->LoadMacro("UserTrigger.C+"); | ||
#endif | ||
|
||
UserTrigger(generator); | ||
|
||
return generator; | ||
} |
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,31 @@ | ||
/// | ||
/// \file Pythia6_UserTrigger.C | ||
/// \brief Configuration of Pythia6 with external trigger user defined | ||
/// | ||
/// Generate PYTHIA6 events, while the event is generated, check that | ||
/// the user trigger conditions on the event are fulfilled. The user trigger | ||
/// must be defined in macro UserTrigger.C | ||
/// | ||
/// \author Luca Micheletti <luca.micheletti@cern.ch> | ||
/// \author Gustavo Conesa Balbastre <gustavo.conesa.balbastre@cern.ch> | ||
|
||
#if !defined(__CINT__) || defined(__MAKECINT__) | ||
#include "UserTrigger.C" | ||
#endif | ||
|
||
//------ | ||
/// Main, configure PYTHIA6 events via standard configuration in GeneratorConfig.C | ||
/// adding an external event trigger defined in UserTrigger.C | ||
//------ | ||
AliGenerator * GeneratorCustom() | ||
{ | ||
AliGenerator * generator = GeneratorPythia6(); | ||
|
||
#if defined(__CINT__) | ||
gROOT->LoadMacro("UserTrigger.C+"); | ||
#endif | ||
|
||
UserTrigger(generator); | ||
|
||
return generator; | ||
} |
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,49 @@ | ||
/// | ||
/// \file UserTrigger.C | ||
/// \brief Example of user defined trigger, to be called by main CustomGenerator macro | ||
/// | ||
/// Example of user trigger with simple multiplicity event selection. | ||
/// In Root5 it must be compiled | ||
/// | ||
/// \author Luca Micheletti <luca.micheletti@cern.ch> | ||
/// \author Gustavo Conesa Balbastre <Gustavo.Conesa.Balbastre@cern.ch> | ||
|
||
|
||
#include "AliStack.h" | ||
#include "AliGenerator.h" | ||
|
||
//------ | ||
/// User trigger logic to accept the event | ||
/// Here simple multiplicity selection | ||
//------ | ||
Bool_t UserTriggerFunction(AliStack *stack) | ||
{ | ||
printf("____________________________\n"); | ||
printf("USER TRIGGER IMPLEMENTATION \n"); | ||
|
||
Int_t nTracks = stack->GetNtrack(); | ||
printf("n Tracks = %i \n",nTracks); | ||
|
||
if ( nTracks > 120 ) | ||
{ | ||
printf("\t accepted!\n"); | ||
return kTRUE; | ||
} | ||
else | ||
{ | ||
printf("\t rejected!\n"); | ||
return kFALSE; | ||
} | ||
} | ||
|
||
//------ | ||
/// Main, pass the generator and set the user trigger | ||
//------ | ||
void UserTrigger(AliGenerator * generator) | ||
{ | ||
Bool_t (*funcUserTrigger)(AliStack*) = UserTriggerFunction; | ||
|
||
//printf("*-*-*-* USER FUNC %p\n",funcUserTrigger); | ||
|
||
generator->SetUserTrigger(funcUserTrigger); | ||
} |