Skip to content

Commit

Permalink
Merge pull request alisw#19990 from Nikolajal/master
Browse files Browse the repository at this point in the history
Added mult Eta05, generalisation of variables and EPOS 7TeV Generator script
  • Loading branch information
alibuild authored Mar 10, 2022
2 parents 438c9ae + 0487a97 commit 5b37698
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 43 deletions.
23 changes: 23 additions & 0 deletions PWG/MCLEGO/CRMC/gen_eposlhc_lf_pp_7TeV.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#edited by [email protected]
set -e

if [[ $# -lt 1 ]]; then
echo "You must specify at least where to write output to as first parameter."
exit -1
fi

echo "running in `pwd`, writing HepMC to $1"

# prepare environment
source /cvmfs/alice.cern.ch/etc/login.sh
eval $(alienv printenv CRMC::v1.5.4-3)

# force path to requested output
sed -e s#__CRMC_BASEDIR__#"$CRMC_ROOT"# ${ALICE_PHYSICS}/PWG/MCLEGO/CRMC/crmc_template.param > crmc.param

# ${ALICE_PHYSICS}/PWG/MCLEGO/CRMC/crmc_template.param > crmc.param
# ${ALICE_PHYSICS}/PWGLF/CommonUtils/MConthefly/macros/crmc_template.param > crmc.param

# run CRMC
crmc -o hepmc -p 3500 -P-3500 -n 10000000 -m 0 -f $1
8 changes: 7 additions & 1 deletion PWGLF/RESONANCES/extra/AddAnalysisTask_Phi_MC.C
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// TODO: Set Trigger Mask to be set from the AddAnalysisTask argument list


AliAnalysisTask_Phi_MC* AddAnalysisTask_Phi_MC( Bool_t MCFlag, Bool_t PhiFlag, Bool_t KaonFlag, TString fName = "PhiCount_STD" )
AliAnalysisTask_Phi_MC* AddAnalysisTask_Phi_MC( TString fName = "PhiCount_STD", Long_t kParticlePDG = 333 )
{
// Analysis Manager
AliAnalysisManager *fAliAnlManager = AliAnalysisManager::GetAnalysisManager();
Expand All @@ -19,6 +19,12 @@ AliAnalysisTask_Phi_MC* AddAnalysisTask_Phi_MC( Bool_t MCFlag, Bool_t PhiFlag, B
if (!fAliAnlManager->GetInputEventHandler()) return 0x0;
if (!fAliAnlTask) return 0x0;

// Task settings
SetParticlePDG ( kParticlePDG );
SetSPCompute ( kFALSE ); // Not implemented
SetSPWighted ( kFALSE ); // Not implemented
SetRTCompute ( kFALSE ); // Not implemented

// Input
fAliAnlManager->ConnectInput(fAliAnlTask,0,fAliAnlManager->GetCommonInputContainer());

Expand Down
83 changes: 47 additions & 36 deletions PWGLF/RESONANCES/extra/AliAnalysisTask_Phi_MC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ using namespace std;

ClassImp(AliAnalysisTask_Phi_MC)

AliAnalysisTask_Phi_MC::AliAnalysisTask_Phi_MC() : AliAnalysisTaskSE(), kComputeSpherocity(0), kSpherocityPTWeight(0), kComputeRT(0), fIs_p_p(0), fIs_p_Pb(0), fIs_Pb_Pb(0), fRunName(0), fQC_Event_Enum_FLL(0), fMCD(0), AODMCTrackArray(0), fMultSelection(0), fCurrent_SPH(0), fCurrent_V0M(0), fCurrent_TRK(0), fCurrent_RT(0), fCurrent_Run(0), fTrueEventMask(0), tParticle_0333(0), fTNParticle_0333(0), lQCParticle_0333(0), lAnalysisOutputList(0) {
AliAnalysisTask_Phi_MC::AliAnalysisTask_Phi_MC() : AliAnalysisTaskSE(), kComputeSpherocity(0), kSpherocityPTWeight(0), kComputeRT(0), fIs_p_p(0), fIs_p_Pb(0), fIs_Pb_Pb(0), fRunName(0), fQC_Event_Enum_FLL(0), fMCD(0), AODMCTrackArray(0), fMultSelection(0), fCurrent_SPH(0), fCurrent_V0M(0), fCurrent_TRK(0), fCurrent_RT(0), fCurrent_Run(0), fTrueEventMask(0), tParticle(0), fTNParticle(0), lQCParticle(0), lAnalysisOutputList(0) {
}

//_____________________________________________________________________________

AliAnalysisTask_Phi_MC::AliAnalysisTask_Phi_MC(const char* name) : AliAnalysisTaskSE(name), kComputeSpherocity(0), kSpherocityPTWeight(0), kComputeRT(0), fIs_p_p(0), fIs_p_Pb(0), fIs_Pb_Pb(0), fRunName(0), fQC_Event_Enum_FLL(0), fMCD(0), AODMCTrackArray(0), fMultSelection(0), fCurrent_SPH(0), fCurrent_V0M(0), fCurrent_TRK(0), fCurrent_RT(0), fCurrent_Run(0), fTrueEventMask(0), tParticle_0333(0), fTNParticle_0333(0), lQCParticle_0333(0), lAnalysisOutputList(0) {
AliAnalysisTask_Phi_MC::AliAnalysisTask_Phi_MC(const char* name) : AliAnalysisTaskSE(name), kComputeSpherocity(0), kSpherocityPTWeight(0), kComputeRT(0), fIs_p_p(0), fIs_p_Pb(0), fIs_Pb_Pb(0), fRunName(0), fQC_Event_Enum_FLL(0), fMCD(0), AODMCTrackArray(0), fMultSelection(0), fCurrent_SPH(0), fCurrent_V0M(0), fCurrent_TRK(0), fCurrent_RT(0), fCurrent_Run(0), fTrueEventMask(0), tParticle(0), fTNParticle(0), lQCParticle(0), lAnalysisOutputList(0) {
// Define Input
DefineInput(0, TChain::Class());

Expand All @@ -70,10 +70,10 @@ AliAnalysisTask_Phi_MC::AliAnalysisTask_Phi_MC() : AliAnalysisTaskSE(), kCompute

AliAnalysisTask_Phi_MC::~AliAnalysisTask_Phi_MC() {
// Deleting TLists
if ( lQCParticle_0333 ) delete lQCParticle_0333;
if ( lQCParticle ) delete lQCParticle;
if ( lAnalysisOutputList ) delete lAnalysisOutputList;
// Deleting TTrees
if ( tParticle_0333 ) delete tParticle_0333;
if ( tParticle ) delete tParticle;
}

//_____________________________________________________________________________
Expand All @@ -86,50 +86,56 @@ void AliAnalysisTask_Phi_MC::UserCreateOutputObjects() {
PostData ( 1, lAnalysisOutputList );
//
// --- Particle QC Histograms List
lQCParticle_0333 = new TList();
lQCParticle_0333 -> SetOwner( kTRUE );
lQCParticle = new TList();
lQCParticle -> SetOwner( kTRUE );
//
fQC_Event_Enum_FLL = new TH1D("fQC_Event_Enum_FLL", "Event Selection", 29, -0.5, 28.5);
fQC_Event_Enum_FLL -> GetXaxis() -> SetTitle("");
fQC_Event_Enum_FLL -> GetYaxis() -> SetTitle("Accepted Events");
uSetEventCountLabels(fQC_Event_Enum_FLL);
lQCParticle_0333 -> Add(fQC_Event_Enum_FLL);
lQCParticle -> Add(fQC_Event_Enum_FLL);
//
fQC_Event_Enum_E05 = new TH1D("fQC_Event_Enum_E05", "Events with tracks in #eta < 0.5", 5000, 0., 5000.);
fQC_Event_Enum_E05 -> GetXaxis() -> SetTitle("N Tracks");
fQC_Event_Enum_E05 -> GetYaxis() -> SetTitle("Accepted Events");
lQCParticle -> Add(fQC_Event_Enum_E05);
//
fQC_Event_Enum_E08 = new TH1D("fQC_Event_Enum_E08", "Events with tracks in #eta < 0.8", 5000, 0., 5000.);
fQC_Event_Enum_E08 -> GetXaxis() -> SetTitle("N Tracks");
fQC_Event_Enum_E08 -> GetYaxis() -> SetTitle("Accepted Events");
lQCParticle_0333 -> Add(fQC_Event_Enum_E08);
lQCParticle -> Add(fQC_Event_Enum_E08);
//
fQC_Event_Enum_E10 = new TH1D("fQC_Event_Enum_E10", "Events with tracks in #eta < 1.0", 5000, 0., 5000.);
fQC_Event_Enum_E10 -> GetXaxis() -> SetTitle("N Tracks");
fQC_Event_Enum_E10 -> GetYaxis() -> SetTitle("Accepted Events");
lQCParticle_0333 -> Add(fQC_Event_Enum_E10);
lQCParticle -> Add(fQC_Event_Enum_E10);
//
fQC_Event_Enum_V0A = new TH1D("fQC_Event_Enum_V0A", "Events with tracks in V0A acceptance", 5000, 0., 5000.);
fQC_Event_Enum_V0A -> GetXaxis() -> SetTitle("N Tracks");
fQC_Event_Enum_V0A -> GetYaxis() -> SetTitle("Accepted Events");
lQCParticle_0333 -> Add(fQC_Event_Enum_V0A);
lQCParticle -> Add(fQC_Event_Enum_V0A);
//
fQC_Event_Enum_V0M = new TH1D("fQC_Event_Enum_V0M", "Events with tracks in V0M acceptance", 5000, 0., 5000.);
fQC_Event_Enum_V0M -> GetXaxis() -> SetTitle("N Tracks");
fQC_Event_Enum_V0M -> GetYaxis() -> SetTitle("Accepted Events");
lQCParticle_0333 -> Add(fQC_Event_Enum_V0M);
lQCParticle -> Add(fQC_Event_Enum_V0M);
//
PostData ( 2, lQCParticle_0333 );
PostData ( 2, lQCParticle );
//
// --- Particle Tree
OpenFile(3);
// --- --- Allocating tree and setting branches
tParticle_0333 = new TTree ( Form( "PhiCandidate_%s", fRunName.Data() ), "Data Tree for Phi Candidates" );
tParticle_0333 -> Branch ( "n0333", &fTNParticle_0333, "fTNParticle_0333/I");
tParticle_0333 -> Branch ( "E10", &fCurrent_E10, "fCurrent_E10/F" );
tParticle_0333 -> Branch ( "E05", &fCurrent_E08, "fCurrent_E08/F" );
tParticle_0333 -> Branch ( "V0A", &fCurrent_V0A, "fCurrent_V0A/F" );
tParticle_0333 -> Branch ( "V0M", &fCurrent_V0M, "fCurrent_V0M/F" );
tParticle_0333 -> Branch ( "Px", &fTPx, "fTPx[fTNParticle_0333]/F" );
tParticle_0333 -> Branch ( "Py", &fTPy, "fTPy[fTNParticle_0333]/F" );
tParticle_0333 -> Branch ( "Pz", &fTPz, "fTPz[fTNParticle_0333]/F" );
PostData(3, tParticle_0333);
tParticle = new TTree ( Form( "PhiCandidate_%s", fRunName.Data() ), "Data Tree for Phi Candidates" );
tParticle -> Branch ( "nPart", &fTNParticle, "fTNParticle/I");
tParticle -> Branch ( "Eta_10", &fCurrent_E10, "fCurrent_E10/F" );
tParticle -> Branch ( "Eta_08", &fCurrent_E08, "fCurrent_E08/F" );
tParticle -> Branch ( "Eta_05", &fCurrent_E08, "fCurrent_E05/F" );
tParticle -> Branch ( "V0A", &fCurrent_V0A, "fCurrent_V0A/F" );
tParticle -> Branch ( "V0M", &fCurrent_V0M, "fCurrent_V0M/F" );
tParticle -> Branch ( "Px", &fTPx, "fTPx[fTNParticle]/F" );
tParticle -> Branch ( "Py", &fTPy, "fTPy[fTNParticle]/F" );
tParticle -> Branch ( "Pz", &fTPz, "fTPz[fTNParticle]/F" );
PostData(3, tParticle);
}

//_____________________________________________________________________________
Expand All @@ -145,14 +151,14 @@ void AliAnalysisTask_Phi_MC::UserExec( Option_t* ) {
TParticle* fCurrent_Particle = static_cast<TParticle*>( fMCD->Particle(iTrack) );
//
// Check it is a requested particle
if ( !fCurrent_Particle ) continue;
if ( fCurrent_Particle->GetPdgCode() != 333 ) continue;
if ( !fCurrent_Particle ) continue;
if ( fCurrent_Particle->GetPdgCode() != kParticlePDG ) continue;
//
// --- Save Kinematics
fTPx[fTNParticle_0333] = fCurrent_Particle->Px();
fTPy[fTNParticle_0333] = fCurrent_Particle->Py();
fTPz[fTNParticle_0333] = fCurrent_Particle->Pz();
fTNParticle_0333++;
fTPx[fTNParticle] = fCurrent_Particle->Px();
fTPy[fTNParticle] = fCurrent_Particle->Py();
fTPz[fTNParticle] = fCurrent_Particle->Pz();
fTNParticle++;
}
// Saving output
fFillTrees();
Expand Down Expand Up @@ -189,7 +195,8 @@ bool AliAnalysisTask_Phi_MC::fIsEventCandidate () {
uFillEventEnumerate("Accepted");
//
// --- Zero all counters
fTNParticle_0333 = 0;
fTNParticle = 0;
fCurrent_E05 = 0;
fCurrent_E08 = 0;
fCurrent_E10 = 0;
fCurrent_V0A = 0;
Expand All @@ -213,20 +220,24 @@ bool AliAnalysisTask_Phi_MC::uIsEventMultiplicityAvailable ( )
if ( !fCurrent_Particle->GetPDG()) continue;
if ( fCurrent_Particle->GetPDG()->Charge() == 0 ) continue;
if ( !fMCD->IsPhysicalPrimary( iTrack ) ) continue;
if ( fCurrent_Particle->Pt() < 0.15 ) continue;
//
// --- #eta 0.8
// --- Eta Nch Estimators
// --- --- #eta 0.5
if ( fabs( fCurrent_Particle->Eta() ) < 0.5 ) fCurrent_E08++;
// --- --- #eta 0.8
if ( fabs( fCurrent_Particle->Eta() ) < 0.8 ) fCurrent_E08++;
//
// --- #eta 1.0
// --- --- #eta 1.0
if ( fabs( fCurrent_Particle->Eta() ) < 1.0 ) fCurrent_E10++;
//
// --- V0 Estimators
// --- --- V0A & M
if ( (fCurrent_Particle->Eta() < 5.1) && (fCurrent_Particle->Eta() > 2.8) ) { fCurrent_V0A++; fCurrent_V0M++; }
if ( (fCurrent_Particle->Eta() < +5.1) && (fCurrent_Particle->Eta() > +2.8) ) { fCurrent_V0A++; fCurrent_V0M++; }
// --- --- V0M
if ( (fCurrent_Particle->Eta() < -1.7) && (fCurrent_Particle->Eta() > -3.7) ) fCurrent_V0M++;
}
//
fQC_Event_Enum_E05 -> Fill( fCurrent_E05 );
fQC_Event_Enum_E08 -> Fill( fCurrent_E08 );
fQC_Event_Enum_E10 -> Fill( fCurrent_E10 );
fQC_Event_Enum_V0A -> Fill( fCurrent_V0A );
Expand All @@ -247,14 +258,14 @@ void AliAnalysisTask_Phi_MC::Terminate( Option_t* ) {
void AliAnalysisTask_Phi_MC::fPostData( ) {
// Post-data for TLists
PostData(1, lAnalysisOutputList );
PostData(2, lQCParticle_0333 );
if ( fTNParticle_0333 > 0 ) PostData(3, tParticle_0333 );
PostData(2, lQCParticle );
if ( fTNParticle > 0 ) PostData(3, tParticle );
}

//_____________________________________________________________________________

void AliAnalysisTask_Phi_MC::fFillTrees( ) {
if ( fTNParticle_0333 > 0 ) tParticle_0333->Fill();
if ( fTNParticle > 0 ) tParticle->Fill();
}

//_____________________________________________________________________________
Expand Down
16 changes: 10 additions & 6 deletions PWGLF/RESONANCES/extra/AliAnalysisTask_Phi_MC.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ AliAnalysisTask_Phi_MC : public AliAnalysisTaskSE {
AliAnalysisTask_Phi_MC& operator = ( const AliAnalysisTask_Phi_MC& );
//
// --- Setters & Getters
void SetParticlePDG ( Long_t PDGn ) { kParticlePDG = PDGn; };
void SetSPCompute ( Bool_t SPFlag ) { kComputeSpherocity = SPFlag; };
void SetSPWighted ( Bool_t SPWeightFlag ) { kSpherocityPTWeight = SPWeightFlag; };
void SetRTCompute ( Bool_t RTFlag ) { kComputeRT = RTFlag; };
Expand All @@ -46,6 +47,7 @@ AliAnalysisTask_Phi_MC : public AliAnalysisTaskSE {
bool uIsEventMultiplicityAvailable ( );
//
// --- --- Variables
Long_t kParticlePDG; // PDG Code for target
Bool_t kComputeSpherocity; // Spherocity Flag
Bool_t kSpherocityPTWeight; // Spherocity PT Weighted Flag
Bool_t kComputeRT; // RT Flag
Expand All @@ -54,6 +56,7 @@ AliAnalysisTask_Phi_MC : public AliAnalysisTaskSE {
Bool_t fIs_Pb_Pb; //! Collision system flag for PbPb
TString fRunName; // MultiRun name
TH1D* fQC_Event_Enum_FLL; //! Event count utility histogram
TH1D* fQC_Event_Enum_E05; //! Event Multiplicity utility histogram
TH1D* fQC_Event_Enum_E08; //! Event Multiplicity utility histogram
TH1D* fQC_Event_Enum_E10; //! Event Multiplicity utility histogram
TH1D* fQC_Event_Enum_V0A; //! Event Multiplicity utility histogram
Expand All @@ -66,6 +69,7 @@ AliAnalysisTask_Phi_MC : public AliAnalysisTaskSE {
TClonesArray* AODMCTrackArray; //! MC Tracks Array
AliPPVsMultUtils* fMultSelection; //! Multiplicity Utility
Float_t fCurrent_SPH; //! Event Spherocity
Float_t fCurrent_E05; //! Event E08 Multiplicity
Float_t fCurrent_E08; //! Event E08 Multiplicity
Float_t fCurrent_E10; //! Event E10 Multiplicity
Float_t fCurrent_V0A; //! Event V0A Multiplicity
Expand All @@ -76,13 +80,13 @@ AliAnalysisTask_Phi_MC : public AliAnalysisTaskSE {
UChar_t fTrueEventMask; //! True Event Mask
//
// --- --- Output Tree Variables
TTree* tParticle_0333; //! Output Tree for Signal
Int_t fTNParticle_0333; //! Number of Phis produced found
Float_t fTPx [2048]; //! Phi Px
Float_t fTPy [2048]; //! Phi Py
Float_t fTPz [2048]; //! Phi Pz
TTree* tParticle; //! Output Tree for Signal
Int_t fTNParticle; //! Number of Phis produced found
Float_t fTPx [2048]; //! Px
Float_t fTPy [2048]; //! Py
Float_t fTPz [2048]; //! Pz
//
TList* lQCParticle_0333; //! QC Histograms output list
TList* lQCParticle; //! QC Histograms output list
//
TList* lAnalysisOutputList; //! Analysis output list
//
Expand Down

0 comments on commit 5b37698

Please sign in to comment.