Skip to content

Commit

Permalink
Merge production into production_singleElectron_0-20GeV
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 10, 2021
2 parents 3ec0ece + cca98c1 commit 1f3554d
Show file tree
Hide file tree
Showing 23 changed files with 2,722 additions and 4,568 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This is the standard macros respository for [ECCE](https://www.ecce-eic.org/). Following is the 10-min tutorial on using the default macros.

[![Build Status](https://web.sdcc.bnl.gov/jenkins-sphenix/buildStatus/icon?job=sPHENIX/sPHENIX_CoreSoftware_MasterBranch)](https://web.sdcc.bnl.gov/jenkins-sphenix/job/sPHENIX/job/sPHENIX_CoreSoftware_MasterBranch/)
[![Tutorials](https://img.shields.io/badge/Tutorials-Doc-green.svg)](https://ecce-eic.github.io/)
[![Doxygen](https://img.shields.io/badge/code%20reference-Doxygen-green.svg)](https://ecce-eic.github.io/doxygen/)
[![Singularity](https://img.shields.io/badge/container-Singularity%20via%20CVMFS-green.svg)](https://github.com/ECCE-EIC/Singularity)

Expand Down
2,404 changes: 116 additions & 2,288 deletions common/ECCEStyle.C

Large diffs are not rendered by default.

1,903 changes: 17 additions & 1,886 deletions common/ECCEStyle.h

Large diffs are not rendered by default.

142 changes: 142 additions & 0 deletions common/G4_B0ECAL.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#ifndef MACRO_G4B0ECAL_C
#define MACRO_G4B0ECAL_C

#include <GlobalVariables.C>

//include our own B0 Raw Tower Builder
#include <eicg4b0ecal/B0RawTowerBuilderByHitIndex.h>

#include <g4calo/RawTowerDigitizer.h>

#include <g4eiccalos/PHG4ForwardCalCellReco.h>
// Use Forward Cal Cell Reco .

#include <eicg4b0ecal/EICG4B0ECALSubsystem.h>
// Include our Subsystem

//Standard RawTowerDefs.h is modified

#include <g4eval/CaloEvaluator.h>

#include <g4main/PHG4Reco.h>

#include <eiccaloreco/RawClusterBuilderkMA.h>
#include <eiccaloreco/RawClusterBuilderHelper.h>

#include <caloreco/RawClusterBuilderFwd.h>
#include <caloreco/RawClusterBuilderTemplate.h>
#include <caloreco/RawTowerCalibration.h>

#include <fun4all/Fun4AllServer.h>

R__LOAD_LIBRARY(libcalo_reco.so)
R__LOAD_LIBRARY(libg4calo.so)
R__LOAD_LIBRARY(libg4eiccalos.so)
R__LOAD_LIBRARY(libg4eval.so)

namespace Enable
{
bool B0ECAL = false;
bool B0ECAL_ABSORBER = false;
bool B0ECAL_CELL = false;
bool B0ECAL_TOWER = false;
bool B0ECAL_CLUSTER = false;
bool B0ECAL_EVAL = false;
bool B0ECAL_OVERLAPCHECK = false;
int B0ECAL_VERBOSITY = 0;
} // namespace Enable


namespace G4B0ECAL
{

double minz = 678;
double maxz = 698;
double radius = 20;

// Default set to B0 Ecal position at IP6

// Digitization (default photon digi):
RawTowerDigitizer::enu_digi_algorithm TowerDigi = RawTowerDigitizer::kNo_digitization;
// directly pass the energy of sim tower to digitized tower
// kNo_digitization
// simple digitization with photon statistics, single amplitude ADC conversion and pedestal
// kSimple_photon_digitization
// digitization with photon statistics on SiPM with an effective pixel N, ADC conversion and pedestal
// kSiPM_photon_digitization

} // namespace G4B0ECAL

void B0ECALInit()
{
}

void B0ECALSetup(PHG4Reco *g4Reco)
{
//Done in G4_hFarFwdBeamLine.C
}

void B0ECAL_Cells(int verbosity = 0)
{
return;
}

void B0ECAL_Towers()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::B0ECAL_VERBOSITY);

Fun4AllServer *se = Fun4AllServer::instance();

ostringstream mapping_b0ecal;
mapping_b0ecal << getenv("CALIBRATIONROOT") << "/B0Ecal/mapping/B0ECAL_mapping_v1.txt";
//mapping_b0ecal << "B0ECAL_mapping_v1.txt";

B0RawTowerBuilderByHitIndex *tower_B0ECAL = new B0RawTowerBuilderByHitIndex("TowerBuilder_B0ECAL");
tower_B0ECAL->Detector("B0ECAL");
tower_B0ECAL->set_sim_tower_node_prefix("SIM");
tower_B0ECAL->GeometryTableFile(mapping_b0ecal.str());

se->registerSubsystem(tower_B0ECAL);


RawTowerDigitizer *TowerDigitizer = new RawTowerDigitizer("B0ECALRawTowerDigitizer");
TowerDigitizer->Detector("B0ECAL");
TowerDigitizer->Verbosity(verbosity);
TowerDigitizer->set_digi_algorithm(RawTowerDigitizer::kNo_digitization);
se->registerSubsystem(TowerDigitizer);

RawTowerCalibration *TowerCalibration = new RawTowerCalibration("B0ECALRawTowerCalibration");
TowerCalibration->Detector("B0ECAL");
TowerCalibration->Verbosity(verbosity);
TowerCalibration->set_calib_algorithm(RawTowerCalibration::kSimple_linear_calibration);
TowerCalibration->set_calib_const_GeV_ADC(1. );
TowerCalibration->set_pedstal_ADC(0);
se->registerSubsystem(TowerCalibration);
}

void B0ECAL_Clusters()
{
int verbosity = std::max(Enable::VERBOSITY, Enable::B0ECAL_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();

RawClusterBuilderFwd *ClusterBuilder = new RawClusterBuilderFwd("B0ECALRawClusterBuilderFwd");
ClusterBuilder->Detector("B0ECAL");
ClusterBuilder->Verbosity(verbosity);
ClusterBuilder->set_threshold_energy(0.100);
se->registerSubsystem(ClusterBuilder);

return;
}

void B0ECAL_Eval(const std::string &outputfile)
{
int verbosity = std::max(Enable::VERBOSITY, Enable::B0ECAL_VERBOSITY);
Fun4AllServer *se = Fun4AllServer::instance();

CaloEvaluator *eval = new CaloEvaluator("B0ECALEVALUATOR", "B0ECAL", outputfile.c_str());
eval->Verbosity(verbosity);
se->registerSubsystem(eval);

return;
}
#endif
8 changes: 6 additions & 2 deletions common/G4_BECAL.C
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace G4BECAL
double minz = -453;
double maxz = 371;
double topradius = 138;
double radius = 85;
double radius = 80;

// this is default set to -1.5<eta<1.24 for 2018 Letter of Intent
// if the user changes these, the z position of the
Expand Down Expand Up @@ -80,8 +80,12 @@ double BECALSetup(PHG4Reco *g4Reco)
bool AbsorberActive = Enable::ABSORBER || Enable::BECAL_ABSORBER;
bool OverlapCheck = Enable::OVERLAPCHECK || Enable::BECAL_OVERLAPCHECK;

// Update IR of BCAL to R~80cm
// From Nathaly Santiesteban:
// https://raw.githubusercontent.com/eic/fun4all_eiccalibrations/main/BarrelEcal/mapping/towerMap_BEMC_v002.txt
// It uses IR of 80.3.
ostringstream mapping_becal;
mapping_becal << getenv("CALIBRATIONROOT") << "/BarrelEcal/mapping/towerMap_BEMC_v001.txt";
mapping_becal << getenv("CALIBRATIONROOT") << "/BarrelEcal/mapping/towerMap_BEMC_v002.txt";

PHG4BarrelEcalSubsystem *becal = new PHG4BarrelEcalSubsystem("BECAL");
becal->set_string_param("mapping_file", mapping_becal.str());
Expand Down
125 changes: 125 additions & 0 deletions common/G4_BMMG.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#ifndef MACRO_G4BMMG_C
#define MACRO_G4BMMG_C

#include <GlobalVariables.C>

#include <fun4all/Fun4AllServer.h>
#include <g4barrelmmg/CreateCZHitContainer.h>
#include <g4barrelmmg/PHG4CylinderStripSubsystem.h>
#include <g4main/PHG4Reco.h>
#include <g4trackfastsim/PHG4TrackFastSim.h>

R__LOAD_LIBRARY(libg4barrelmmg.so)
R__LOAD_LIBRARY(libfun4all.so)
R__LOAD_LIBRARY(libg4testbench.so)
R__LOAD_LIBRARY(libg4detectors.so)

namespace Enable
{
bool BMMG = false;
bool use_2Dreadout = true;
bool BMMG_OVERLAPCHECK = true;
int BMMG_VERBOSITY = 0;
} // namespace Enable

namespace BMMG
{
const int n_layer = 3;

const double rad[BMMG::n_layer] = {45., 47.4, 67.4}; // approximate radial location
const double len[BMMG::n_layer] = {140, 150, 280.0};
} // namespace BMMG

void BMMGInit(int verbosity = 1)
{
BlackHoleGeometry::max_radius = std::max(BlackHoleGeometry::max_radius, BMMG::rad[BMMG::n_layer - 1] / 10. + 0.7);
BlackHoleGeometry::max_z = std::max(BlackHoleGeometry::max_z, BMMG::len[BMMG::n_layer - 1] / 2.0 + 1.0);
BlackHoleGeometry::min_z = std::min(BlackHoleGeometry::min_z, -BMMG::len[BMMG::n_layer - 1] / 2.0 - 10.);
}

void BMMGSetup(PHG4Reco* g4Reco)
{
int verbosity = std::max(Enable::VERBOSITY, Enable::BMMG_VERBOSITY);
Fun4AllServer* se = Fun4AllServer::instance();
se->Verbosity(verbosity);

bool OverlapCheck = Enable::OVERLAPCHECK || Enable::BMMG_OVERLAPCHECK;

gSystem->Load("libfun4all");
gSystem->Load("libg4detectors.so");
gSystem->Load("libg4testbench.so");
gSystem->Load("libg4trackfastsim.so");

PHG4CylinderStripSubsystem* barrel_mmg;
double gap_betweenCZ = 1.5;
double Gap_betweenlayer = 1.5;
double thickness = 0.36499;
int nCZlayer = 2;
if (Enable::use_2Dreadout)
{
gap_betweenCZ = 0;
nCZlayer = 1;
}

const double prapidity = 1;

for (int ilayer = 0; ilayer < BMMG::n_layer; ilayer++)
{
barrel_mmg = new PHG4CylinderStripSubsystem(Form("BMT_%d", ilayer), ilayer);
barrel_mmg->set_double_param("radius", BMMG::rad[ilayer]);
barrel_mmg->set_string_param("gas", "myMMGas");
//barrel_mmg->set_double_param("steplimits", 300e-4);
barrel_mmg->set_double_param("phi0", 15 * ilayer);
barrel_mmg->set_double_param("gap", gap_betweenCZ);
barrel_mmg->SetActive();
barrel_mmg->SuperDetector("BMT");
barrel_mmg->set_int_param("lengthviarapidity", 0);
barrel_mmg->set_double_param("gas1thickness", 0.15);
barrel_mmg->set_double_param("length", BMMG::len[ilayer]);
barrel_mmg->set_double_param("deadzone", 0.2);
barrel_mmg->set_int_param("nhit", 1);
barrel_mmg->OverlapCheck(true);
barrel_mmg->set_int_param("use_2Dreadout", Enable::use_2Dreadout);
g4Reco->registerSubsystem(barrel_mmg);
} // ilayer loop

if (TRACKING::FastKalmanFilter)
{
if (Enable::use_2Dreadout)
{
TRACKING::FastKalmanFilter->add_phg4hits(
"G4HIT_BMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5 / 2 / sqrt(12), //1./sqrt(12), // radial-resolution , only used for Vertical Plane Detector Type
75e-4, //150e-4, // azimuthal-resolution [cm]
75e-4, //150e-4, // z-resolution [cm]
1, // efficiency,
0); // noise hits
}
else
{
TRACKING::FastKalmanFilter->add_phg4hits(
"G4HIT_CZBMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5 / 2 / sqrt(12), //1/sqrt(12), // radial-resolution [cm], only used for Vertical Plane Detector Type
75e-4, //150e-4, // azimuthal-resolution [cm]
75e-4, //150e-4, // z-resolution [cm]
1, // efficiency,
0); // noise hits
}
}

return;
}

void BMMGT_Reco()
{
gSystem->Load("libfun4all.so");
gSystem->Load("libg4detectors.so");

int verbosity = std::max(Enable::VERBOSITY, Enable::BMMG_VERBOSITY);
Fun4AllServer* se = Fun4AllServer::instance();

return;
}
#endif
Loading

0 comments on commit 1f3554d

Please sign in to comment.