Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:06

0001 /**
0002    ROOT Macro using eic-smear library to 'smear' energy and momentum of MonteCarlo generated
0003    particles to reflect the performance of an EIC detector based on sPHENIX.
0004 
0005    See link for documentation of eic-smear package:
0006 
0007    https://wiki.bnl.gov/eic/index.php/Smearing
0008 */
0009 
0010 /** Convert pseudorapidity eta to polar angle theta */
0011 float eta2theta( double eta )
0012 {
0013   float theta = 2.0 * atan( exp( -1 * eta ) );
0014   return theta;
0015 }
0016 
0017 /** Build EIC detector
0018  */
0019 Smear::Detector BuildEicSphenix() {
0020 
0021   gSystem->Load("libeicsmear");
0022 
0023   /* CALORIMETER
0024    *
0025    * Calorimeter resolution usually given as sigma_E/E = const% + stocastic%/Sqrt{E}
0026    * EIC Smear needs absolute sigma: sigma_E = Sqrt{const*const*E*E + stoc*stoc*E}
0027    *
0028    * Genre == 1 (third argument) means only photons and electrons are smeared
0029    *
0030    * Accept.Charge( kAll ) seems not to be working properly
0031    */
0032 
0033   /* Create "electron-going" (backward) electromagnetic calorimeter (PbWO4)*/
0034   Smear::Acceptance::Zone zone_eemc( eta2theta( -1.55 ), eta2theta( -4.00 ) );
0035 
0036   Smear::Device eemcE(Smear::kE,  "sqrt(0.01*0.01*E*E + 0.025*0.025*E)");
0037   eemcE.Accept.SetGenre(Smear::kElectromagnetic);
0038   eemcE.Accept.AddZone(zone_eemc);
0039 
0040   /* Create "central rapidity" electromagnetic calorimeter (W-SciFi) */
0041   Smear::Acceptance::Zone zone_cemc( eta2theta(  1.24 ), eta2theta( -1.55 ) );
0042 
0043   Smear::Device cemcE(Smear::kE,  "sqrt(0.05*0.05*E*E + 0.16*0.16*E)");
0044   cemcE.Accept.SetGenre(Smear::kElectromagnetic);
0045   cemcE.Accept.AddZone(zone_cemc);
0046 
0047   /* Create "hadron-going" (forward) electromagnetic calorimeter (PbScint) */
0048   Smear::Acceptance::Zone zone_femc( eta2theta(  4.00 ), eta2theta(  1.24 ) );
0049 
0050   Smear::Device femcE(Smear::kE,  "sqrt(0.02*0.02*E*E + 0.08*0.08*E)");
0051   femcE.Accept.SetGenre(Smear::kElectromagnetic);
0052   femcE.Accept.AddZone(zone_femc);
0053 
0054   /* Create "central rapidity" hadron calorimeter (inner+outer) (Fe Scint + Steel Scint) */
0055   Smear::Acceptance::Zone zone_chcal( eta2theta(  1.10 ), eta2theta( -1.10 ) );
0056 
0057   Smear::Device chcalE(Smear::kE,  "sqrt(0.12*0.12*E*E + 0.81*0.81*E)");
0058   chcalE.Accept.SetGenre(Smear::kHadronic);
0059   chcalE.Accept.AddZone(zone_chcal);
0060 
0061   /* Create "hadron-going" (forward) hadron calorimeter (Fe Scint) */
0062   Smear::Acceptance::Zone zone_fhcal( eta2theta(  4.00 ), eta2theta(  1.24 ) );
0063 
0064   Smear::Device fhcalE(Smear::kE,  "sqrt(0.0*0.0*E*E + 0.70*0.70*E)");
0065   fhcalE.Accept.SetGenre(Smear::kHadronic);
0066   fhcalE.Accept.AddZone(zone_fhcal);
0067 
0068   /* TRACKING SYSTEM */
0069   /* Create our tracking capabilities, by a combination of mometum, theta and phi Devices.
0070    * The momentum parametrization (a*p + b) gives sigma_P/P in percent.
0071    * So Multiply through by P and divide by 100 to get absolute sigma_P
0072    * Theta and Phi parametrizations give absolute sigma in miliradians
0073    *
0074    * Note: eic-smear only saves smeared parameters for 'smeared' particle, i.e. if you want to
0075    * save e.g. the 'true' energy for particles measured with the tracker, you need to smear the
0076    * energy with '0' smearing for those particles.
0077    */
0078 
0079   /* Create tracking system. */
0080   /* @TODO Below numbers are for tracking with BeAST. We need to get the parametrization for EIC-sPHENIX!!! */
0081   Smear::Acceptance::Zone zone_tracking( eta2theta( 4 ), eta2theta( -4.00 ) );
0082 
0083   Smear::Device trackingMomentum(Smear::kP, "(P*P*(0.0182031 + 0.00921047*pow((-log(tan(theta/2.0))), 2) - 0.00291243*pow((-log(tan(theta/2.0))), 4) + 0.000264353*pow((-log(tan(theta/2.0))), 6)) + P*(0.209681 + 0.275144*pow((-log(tan(theta/2.0))), 2) - 0.0436536*pow((-log(tan(theta/2.0))), 4) + 0.00367412*pow((-log(tan(theta/2.0))), 6)))*0.01");
0084   trackingMomentum.Accept.SetCharge(Smear::kCharged);
0085   trackingMomentum.Accept.AddZone(zone_tracking);
0086 
0087   Smear::Device trackingTheta(Smear::kTheta, "((1.0/(1.0*P))*(0.752935 + 0.280370*pow((-log(tan(theta/2.0))), 2) - 0.0359713*pow((-log(tan(theta/2.0))), 4) + 0.00200623*pow((-log(tan(theta/2.0))), 6)) + 0.0282315 - 0.00998623*pow((-log(tan(theta/2.0))), 2) + 0.00117487*pow((-log(tan(theta/2.0))), 4) - 0.0000443918*pow((-log(tan(theta/2.0))), 6))*0.001");
0088   trackingTheta.Accept.SetCharge(Smear::kCharged);
0089   trackingTheta.Accept.AddZone(zone_tracking);
0090 
0091   Smear::Device trackingPhi(Smear::kPhi, "((1.0/(1.0*P))*(0.743977 + 0.753393*pow((-log(tan(theta/2.0))), 2) + 0.0634184*pow((-log(tan(theta/2.0))), 4) + 0.0128001*pow((-log(tan(theta/2.0))), 6)) + 0.0308753 + 0.0480770*pow((-log(tan(theta/2.0))), 2) - 0.0129859*pow((-log(tan(theta/2.0))), 4) + 0.00109374*pow((-log(tan(theta/2.0))), 6))*0.001");
0092   trackingPhi.Accept.SetCharge(Smear::kCharged);
0093   trackingPhi.Accept.AddZone(zone_tracking);
0094 
0095   /* Create mRICH detector parameterization */
0096   Smear::Acceptance::Zone zone_mRICH( eta2theta( 1.85 ), eta2theta( 1.242 ));
0097 
0098   Smear::ParticleID mRICH("mRICHPIDMatrix.dat");
0099   mRICH.Accept.AddZone(zone_mRICH);
0100 
0101   /* Create a DETECTOR and add the devices
0102    */
0103   Smear::Detector det;
0104 
0105   det.AddDevice(eemcE);
0106   det.AddDevice(cemcE);
0107   det.AddDevice(femcE);
0108 
0109   det.AddDevice(chcalE);
0110   det.AddDevice(fhcalE);
0111 
0112   det.AddDevice(trackingMomentum);
0113   det.AddDevice(trackingTheta);
0114   det.AddDevice(trackingPhi);
0115 
0116   det.AddDevice(mRICH);
0117 
0118   det.SetEventKinematicsCalculator("NM JB DA"); // The detector will calculate event kinematics from smeared values
0119 
0120   return det;
0121 }