Skip to content

Commit

Permalink
Adapting Rubens custom macros for Run3 geometry simulations
Browse files Browse the repository at this point in the history
- probably not the nicest solution but closest to what Ruben proposed in custom macros
- additionally adding a first generator macro with HIJING + QED electrons
  • Loading branch information
miweberSMI authored and chiarazampolli committed Apr 16, 2018
1 parent be6382a commit 9eb943f
Show file tree
Hide file tree
Showing 8 changed files with 601 additions and 5 deletions.
20 changes: 17 additions & 3 deletions MC/CreateSnapshot.C
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,25 @@ const Char_t *snapshotName[2] = {
CreateSnapshot(Int_t mode)
{

gROOT->LoadMacro("$ALIDPG_ROOT/MC/OCDBConfig.C");
TString ocdbRun3 = gSystem->Getenv("CONFIG_OCDBRUN3");

#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
// in root5 the ROOT_VERSION_CODE is defined only in ACLic mode
#else
if(ocdbRun3.IsNull())
gROOT->LoadMacro("$ALIDPG_ROOT/MC/OCDBConfig.C");
else
gROOT->LoadMacro("$ALIDPG_ROOT/MC/OCDBRun3.C");
#endif

OCDBConfig(kOCDBDefault, mode);
if(!ocdbRun3.IsNull()){
gROOT->ProcessLine(Form("OCDBRun3(%d);",mode));
}
else{
TString ocdbCustom = gSystem->Getenv("CONFIG_OCDBCUSTOM");
OCDBConfig(ocdbCustom.IsNull() ? kOCDBDefault : kOCDBCustom, mode);
}
CreateSnapshot(snapshotName[mode]);

}

void CreateSnapshot(const char* snapshotName, const char* rawdata)
Expand Down
21 changes: 21 additions & 0 deletions MC/CustomGenerators/Upgrade/Hijing_QED.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
AliGenerator *
GeneratorCustom(TString opt = "")
{

//-----------------------------------------------
// Cocktail
AliGenCocktail *ctl = GeneratorCocktail("Run3_Generators_HIJING_with_QED");

//-----------------------------------------------
// HIJING
AliGenerator *hij = GeneratorHijing();
ctl->AddGenerator(hij,"Hijing",1);

//-----------------------------------------------
// QED electrons (numbers to be fixed)
AliGenerator *qed = GeneratorQED();
ctl->AddGenerator(qed,"QED",1);

//-----------------------------------------------
return ctl;
}
267 changes: 265 additions & 2 deletions MC/DetectorConfig.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum EDetector_t {
kDetectorMuon,
kDetectorPhosOnly,
kDetectorNoZDC,
kDetectorRun3,
kDetectorCustom,
kNDetectors
};
Expand All @@ -22,6 +23,7 @@ const Char_t *DetectorName[kNDetectors] = {
"Muon",
"PhosOnly",
"NoZDC",
"Run3",
"Custom"
};

Expand Down Expand Up @@ -69,6 +71,11 @@ Int_t iTRD = 1;
Int_t iVZERO = 1;
Int_t iZDC = 1;

void DetectorDefault();
void DetectorMuon();
void DetectorInit(Int_t tag);
void DetectorInitRun3(Int_t tag);

/*****************************************************************/

void
Expand All @@ -95,6 +102,11 @@ DetectorConfig(Int_t tag)
DetectorDefault();
iZDC = 0;
break;

// kDetectorRun3
case kDetectorRun3:
DetectorRun3();
break;

// kDetectorCustom
case kDetectorCustom:
Expand All @@ -108,8 +120,10 @@ DetectorConfig(Int_t tag)

}

DetectorInit(tag);

if( tag == kDetectorRun3 )
DetectorInitRun3(tag);
else
DetectorInit(tag);
}

/*****************************************************************/
Expand Down Expand Up @@ -193,6 +207,45 @@ DetectorMuon()

/*****************************************************************/

void DetectorRun3()
{
/*
* Detector configuration for Run3 MC
*
*/

Int_t year = atoi(gSystem->Getenv("CONFIG_YEAR"));
UInt_t mask = strtol(gSystem->Getenv("CONFIG_DETECTORMASK"), 0, 16);

iABSO = 1;
iACORDE = 0;
iAD = 0;
iDIPO = 1;
iEMCAL = 1;
iFMD = 0;
iFRAME = 1;
iHALL = 1;
iITS = 1;
iMAG = 1;
iMUON = 1;
iPHOS = 1;
iPIPE = 1;
iPMD = 0;
iHMPID = 1;
iSHIL = 1;
iT0 = 0;
iTOF = 1;
iTPC = 1;
iTRD = 1;
iVZERO = 0;
iZDC = 1;
iMFT = 1;
iFIT = 1;

}

/*****************************************************************/

void
DetectorInit(Int_t tag)
{
Expand Down Expand Up @@ -483,3 +536,213 @@ DetectorInit(Int_t tag)

}

/*****************************************************************/

void DetectorInitRun3(Int_t tag)
{
/*
* DetectorInit
* initialise the detectors to the default
* configuration automatically according to year/period
*
*/

Int_t year = atoi(gSystem->Getenv("CONFIG_YEAR"));


//=================== Alice BODY parameters =============================
AliBODY *BODY = new AliBODY("BODY", "Alice envelop");


if (iMAG)
{
//=================== MAG parameters ============================
// --- Start with Magnet since detector layouts may be depending ---
// --- on the selected Magnet dimensions ---
AliMAG *MAG = new AliMAG("MAG", "Magnet");
}


if (iABSO)
{
//=================== ABSO parameters ============================
AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
}

if (iDIPO)
{
//=================== DIPO parameters ============================

AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
}

if (iHALL)
{
//=================== HALL parameters ============================

AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
}


if (iFRAME)
{
//=================== FRAME parameters ============================

if (year < 2015) {
AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
FRAME->SetHoles(1);
}
else {
AliFRAMEv3 *FRAME = new AliFRAMEv3("FRAME", "Space Frame");
FRAME->SetHoles(1);
}
}

if (iSHIL)
{
//=================== SHIL parameters ============================

AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
}


if (iPIPE)
{
//=================== PIPE parameters ============================

AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
}

if (iITS)
{
//=================== ITS parameters ============================
// CreateITSUv2ALP3();
gROOT->ProcessLine(".x $ALICE_ROOT/ITSMFT/ITS/itsuTestBench/CreateITSUv2ALP3.C");
}

if (iTPC)
{
//============================ TPC parameters =====================

AliTPC *TPC = new AliTPCv2("TPC", "Default");
if (isGeant4) TPC->SetPrimaryIonisation(1);
}


if (iTOF)
{
//=================== TOF parameters ============================

AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
}


if (iHMPID)
{
//=================== HMPID parameters ===========================

AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
}


if (iZDC)
{
//=================== ZDC parameters ============================

AliZDC *ZDC;
if (year == 2010) {
ZDC = new AliZDCv3("ZDC", "normal ZDC");
ZDC->SetSpectatorsTrack();
ZDC->SetLumiLength(0.);
}
else if (year < 2015) {
ZDC = new AliZDCv3("ZDC", "normal ZDC");
//Collimators aperture
ZDC->SetVCollSideCAperture(0.85);
ZDC->SetVCollSideCCentre(0.);
ZDC->SetVCollSideAAperture(0.75);
ZDC->SetVCollSideACentre(0.);
//Detector position
ZDC->SetYZNC(1.6);
ZDC->SetYZNA(1.6);
ZDC->SetYZPC(1.6);
ZDC->SetYZPA(1.6);
}
else {
ZDC = new AliZDCv4("ZDC", "normal ZDC");
ZDC->SetLumiLength(0.);
ZDC->SetVCollSideCAperture(2.8);
ZDC->SetVCollSideCApertureNeg(2.8);
}
}

if (iTRD)
{
//=================== TRD parameters ============================

AliTRDgeometry *geoTRD;
if (isGeant4) {
AliTRDtestG4 *TRD = new AliTRDtestG4("TRD", "TRD slow simulator");
TRD->SetScaleG4(1.11);
geoTRD = TRD->GetGeometry();
}
else
{
AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
geoTRD = TRD->GetGeometry();
}
}

if (iMUON)
{
//=================== MUON parameters ===========================
// New MUONv1 version (geometry defined via builders)
AliMUON *MUON = new AliMUONv1("MUON", "default");
// activate trigger efficiency by cells
MUON->SetTriggerEffCells(1); // backward compatibility
MUON->SetTriggerResponseV1(2); // backward compatibility
}

if (iPHOS)
{
//=================== PHOS parameters ===========================

if (year < 2015) {
AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
}
else {
AliPHOS *PHOS = new AliPHOSv1("PHOS", "Run2");
}

}

if (iEMCAL)
{
//=================== EMCAL parameters ============================

//Cannot use EMCAL as name since it collides with EMCAL namespace definition
AliEMCAL *EMCAL_DET = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE12SMV1_DCAL_8SM");
// by default Run2 configuration name but the proper geometry name is taken
// automatically depending on the anchor run
// 2010 - 4 SM, 2011 - 10 SM, 2012 - 12 SM, >2014 - 20 SM

}

if (iACORDE)
{
//=================== ACORDE parameters ============================

AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
}

if (iMFT)
{
AliMFT *MFT = new AliMFT("MFT", "normal MFT");
}

if(iFIT)
{
AliFIT *fit = new AliFITv7("FIT","FIT");
}

}
Loading

0 comments on commit 9eb943f

Please sign in to comment.