-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge production into production_singleElectron_0-20GeV
- Loading branch information
Showing
23 changed files
with
2,722 additions
and
4,568 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,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 |
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
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,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 |
Oops, something went wrong.