Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:18:19

0001 # ifndef EIC_PIM_H
0002 # define EIC_PIM_H
0003 
0004 #include <iostream>
0005 #include <string>
0006 
0007 #include "TFile.h"
0008 #include "TLorentzVector.h"
0009 #include "TTree.h"
0010 
0011 #include "TRandom.h"
0012 #include "TRandom2.h"
0013 #include "TRandom3.h"
0014 
0015 using std::vector;
0016 
0017 class pim {
0018 
0019 public:
0020   pim(); 
0021   pim(int);
0022 
0023   void Initilize();
0024   int CheckLaws(TLorentzVector P_E0, TLorentzVector P_t, TLorentzVector P_e, TLorentzVector P_pim, TLorentzVector P_pro);
0025   int CheckLaws(TLorentzVector P_E0, TLorentzVector P_t, TLorentzVector P_e, TLorentzVector P_pim, TLorentzVector P_pro, double fDiff_E);
0026   void setrootfile(std::string myRootFile );
0027   double fermiMomentum();
0028 
0029 private:
0030   Int_t gen_seed = 0;
0031     
0032   std::string pParticle;
0033   std::string pcharge;
0034 
0035   /* double correctedPhi(); */
0036   /* double correctedPhiS(); */
0037 
0038 };
0039 
0040 //extern TRandom2 *fRandom;                    
0041 
0042 extern TRandom3 *fRandom;                    
0043 
0044 extern TFile *f;
0045 
0046 extern TTree *t1;
0047 
0048 extern int gKinematics_type;
0049 extern TString gfile_name;
0050 extern TString gParticle;
0051 extern TString gHadron;
0052 extern bool gPi0_decay;
0053 extern bool UseSolve;
0054 
0055 extern std::string gDet_location;
0056 extern std::string gOutputType;
0057 extern std::string gBeamPart;
0058 extern float fProton_incidence_phi;
0059 
0060 extern int fSeed;
0061 
0062 extern bool allset;
0063 extern bool kCalcFermi;
0064 extern bool kCalcBremss;
0065 extern bool kCalcIon;
0066 extern bool kCalcBremssEle;
0067 extern bool kCalcIonEle;
0068 extern bool kSConserve;
0069 extern bool kFSI;
0070 extern bool kMSele;
0071 extern bool kMS;
0072 extern bool gROOTOut; // SJDK 30/04/24 - Added boolean to enable/disable ROOTfile output
0073 
0074 extern double fKaon_Mass;
0075 extern double fKaon_Mass_GeV;
0076 
0077 extern double fLambda_Mass;                             
0078 extern double fLambda_Mass_GeV;
0079 
0080 extern double fSigma_Mass;
0081 extern double fSigma_Mass_GeV;
0082 
0083 extern double fOmega_Mass; 
0084 extern double fOmega_Mass_GeV; 
0085 
0086 extern double fOmega_Theta_Col; 
0087 extern double fOmega_Phi_Col; 
0088 
0089 extern double fOmega_Theta_I; 
0090 extern double fOmega_Theta_F; 
0091 
0092 extern double fOmega_Energy_CM;    
0093 extern double fOmega_Mom_CM;       
0094 extern double fOmega_Energy_CM_GeV;
0095 extern double fOmega_Mom_CM_GeV;   
0096 
0097 extern double fPhi_Omega_LeptonPlane_RF;
0098 extern double fCos_Phi_Omega_LeptonPlane_RF; 
0099 extern double fSin_Phi_Omega_LeptonPlane_RF;
0100 extern double fTheta_Omega_Photon_RF;
0101 
0102 extern int fWLessShell;
0103 extern int fWLess1P9;
0104 extern int fSDiff;
0105 
0106 //extern long int fNEvents;
0107 
0108 extern unsigned long long int fNEvents;
0109 extern unsigned long long int fNRecorded;
0110 extern unsigned long long int fNGenerated;
0111 extern unsigned long long int fWSqNeg;
0112 extern unsigned long long int fNMomConserve;
0113 extern unsigned long long int fNSigmaNeg;
0114 extern unsigned long long int fNWeightNeg;
0115 
0116 extern unsigned long long int fNaN;
0117 extern unsigned long long int fConserve;
0118 
0119 extern unsigned long long int fNWeightUnphys;
0120 extern unsigned long long int fNWeightReject;
0121 
0122 extern unsigned long long int fSolveEvents_0Sol;
0123 extern unsigned long long int fSolveEvents_1Sol;
0124 extern unsigned long long int fSolveEvents_2Sol;
0125 
0126 extern unsigned long long int fNFile;
0127 
0128 extern double fK;
0129 extern double fm;
0130 extern double fElectron_Kin_Col_GeV;
0131 extern double fElectron_Kin_Col;
0132 extern double fRand;
0133 extern double fLumi;
0134 extern double fuBcm2;
0135 extern double fPI;
0136 extern double fDEG2RAD;
0137 extern double fRAD2DEG;
0138 extern double fEBeam;
0139 extern double fPBeam;
0140 // 13/09/23 - SJDK - New generic HBeam value (rather than proton beam)
0141 extern double fHBeam;
0142 extern double fScatElec_Theta_I;
0143 extern double fScatElec_Theta_F;
0144 extern double fPion_Theta_I; // SJDK 19/12/22 - These should be removed in future, specific to pion reaction cases. Should be generic MesonX
0145 extern double fPion_Theta_F;
0146 extern double fEjectileX_Theta_I;
0147 extern double fEjectileX_Theta_F;
0148 extern double fScatElec_E_Hi;
0149 extern double fScatElec_E_Lo;
0150 extern double fPSF;
0151 // SJDK 03/04/23 - New Variables for min/max allowed Q2/W, set by particle type - Add an override in .json file?
0152 extern double fQsq_Min;
0153 extern double fQsq_Max;
0154 extern double fW_Min;
0155 extern double fW_Max;
0156 extern double fT_Max;
0157 
0158 extern double fMandSConserve;
0159 extern double fTop_Pion_Mom;
0160 extern double fBot_Pion_Mom;
0161 extern double fPion_Mom_Same;
0162 extern double fEnergyConserve;
0163 extern double fXMomConserve;
0164 extern double fYMomConserve;
0165 extern double fZMomConserve;
0166 extern double fXMomConserve_RF;
0167 extern double fYMomConserve_RF;
0168 extern double fZMomConserve_RF;
0169 extern double fEnergyConserve_RF;
0170 
0171 extern double fDiff;
0172 extern double fRatio;
0173 extern double fPion_Alpha;
0174 extern double fPion_Beta;
0175 extern double fS_I_RF;
0176 extern double fS_F_RF;
0177 extern double fS_I_Col;
0178 extern double fS_F_Col;
0179 extern double fS_I_RF_GeV;
0180 extern double fS_F_RF_GeV;
0181 extern double fS_I_Col_GeV;
0182 extern double fS_F_Col_GeV;
0183 
0184 extern double fProton_Energy_Col;
0185 extern double fProton_Mom_Col;
0186 extern double fProton_Theta_Col;
0187 extern double fProton_Phi_Col;
0188 extern double fProton_MomZ_Col;
0189 extern double fProton_MomX_Col;
0190 extern double fProton_MomY_Col;
0191 extern double fProton_Energy_Col_GeV;
0192 extern double fProton_Mom_Col_GeV;
0193 extern double fProton_MomX_Col_GeV;
0194 extern double fProton_MomY_Col_GeV;
0195 extern double fProton_MomZ_Col_GeV;
0196 
0197 extern double fFSIProton_Energy_Col;
0198 extern double fFSIProton_Mom_Col;
0199 extern double fFSIProton_Theta_Col;
0200 extern double fFSIProton_Phi_Col;
0201 extern double fFSIProton_MomZ_Col;
0202 extern double fFSIProton_MomX_Col;
0203 extern double fFSIProton_MomY_Col;
0204 extern double fFSIProton_Energy_Col_GeV;
0205 extern double fFSIProton_Mom_Col_GeV;
0206 extern double fFSIProton_MomX_Col_GeV;
0207 extern double fFSIProton_MomY_Col_GeV;
0208 extern double fFSIProton_MomZ_Col_GeV;
0209 
0210 extern double fTarget_Energy_Col;
0211 extern double fTarget_Mom_Col;
0212 extern double fTarget_Theta_Col;
0213 extern double fTarget_Phi_Col;
0214 extern double fTarget_MomZ_Col;
0215 extern double fTarget_MomX_Col;
0216 extern double fTarget_MomY_Col;
0217 extern double fTarget_Energy_Col_GeV;
0218 extern double fTarget_Mom_Col_GeV;
0219 extern double fTarget_MomX_Col_GeV;
0220 extern double fTarget_MomY_Col_GeV;
0221 extern double fTarget_MomZ_Col_GeV;
0222 
0223 extern double fTarget_Pol0_Col;
0224 extern double fTarget_PolX_Col;
0225 extern double fTarget_PolY_Col;
0226 extern double fTarget_PolZ_Col;
0227 extern double fTarget_Pol0_RF;
0228 extern double fTarget_PolX_RF;
0229 extern double fTarget_PolY_RF;
0230 extern double fTarget_PolZ_RF;
0231 
0232 extern double fBetaX_Col_RF;
0233 extern double fBetaY_Col_RF;
0234 extern double fBetaZ_Col_RF;
0235 extern double fBeta_Col_RF;
0236 extern double fGamma_Col_RF;
0237 
0238 extern double fProton_MomX_RF;
0239 extern double fProton_MomY_RF;
0240 extern double fProton_MomZ_RF;
0241 extern double fProton_Mom_RF;
0242 extern double fProton_Energy_RF;
0243 extern double fProton_MomX_RF_GeV;
0244 extern double fProton_MomY_RF_GeV;
0245 extern double fProton_MomZ_RF_GeV;
0246 extern double fProton_Mom_RF_GeV;
0247 extern double fProton_Energy_RF_GeV;
0248 
0249 extern double fScatElec_Angle;    
0250 extern double fScatElec_Alpha_RF;    
0251 extern double fScatElec_Beta_RF;
0252 
0253 extern double fVertex_X;
0254 extern double fVertex_Y;
0255 extern double fVertex_Z;
0256 extern double fProton_Kin_Col_GeV;
0257 extern double fElectron_Mass;
0258 extern double fElectron_Mass_GeV;
0259 extern double fProton_Mass;
0260 extern double fProton_Mass_GeV;
0261 extern double fNeutron_Mass;
0262 extern double fNeutron_Mass_GeV;
0263 extern double fPion_Mass;
0264 extern double fPion_Mass_GeV;
0265 extern double fPiion_Phi;
0266 extern double fAlpha;
0267 extern double fPi;
0268 extern double fMom_Ratio;
0269 extern double fMom_Dif;
0270 extern double fPionEnergyCMLess;
0271 extern double fSNotEqual;
0272 extern double fMode_Epsi;
0273 extern double fRecoilProton_Mass;
0274 extern double fRecoilProton_Mass_GeV;
0275 
0276 extern double fElectron_Energy_Col;
0277 extern double fElectron_MomZ_Col;
0278 extern double fElectron_MomX_Col;
0279 extern double fElectron_MomY_Col;
0280 extern double fElectron_Theta_Col;
0281 extern double fElectron_Phi_Col;
0282 extern double fElectron_Mom_Col;
0283 
0284 extern double fElectron_MS_Energy_Col;
0285 extern double fElectron_MS_MomZ_Col;
0286 extern double fElectron_MS_MomX_Col;
0287 extern double fElectron_MS_MomY_Col;
0288 extern double fElectron_MS_Theta_Col;
0289 extern double fElectron_MS_Phi_Col;
0290 extern double fElectron_MS_Mom_Col;
0291 
0292 extern double fElectron_Energy_Col_GeV;
0293 extern double fElectron_Mom_Col_GeV;
0294 extern double fElectron_MomX_Col_GeV;
0295 extern double fElectron_MomY_Col_GeV;
0296 extern double fElectron_MomZ_Col_GeV;
0297 extern double fElectronEnergyLess;
0298 extern double fElectronThetaLess;
0299 extern double fRadiation_Lenght_Air;
0300 
0301 extern double fElectron_Targ_Thickness;
0302 extern double fElectron_Targ_Thickness_RadLen;
0303 extern double fElectron_Targ_BT;
0304 extern double fElectron_Targ_Bremss_Loss;
0305 extern double fElectron_Targ_Ion_Loss;
0306 extern double fElectron_TargWindow_Bremss_Loss;
0307 extern double fElectron_TargWindow_Ion_Loss;
0308 
0309 extern double fElectron_Air_Thickness;
0310 extern double fElectron_Air_Thickness_RadLen;
0311 extern double fElectron_Air_BT;
0312 extern double fElectron_Air_Bremss_Loss;
0313 extern double fElectron_Air_Ion_Loss;
0314 extern double fElectron_Corrected_Energy_Col;
0315 extern double fElectron_Corrected_Mom_Col;
0316 extern double fElectron_Corrected_MomX_Col;
0317 extern double fElectron_Corrected_MomY_Col;
0318 extern double fElectron_Corrected_MomZ_Col;
0319 extern double fElectron_Corrected_Theta_Col;
0320 extern double fElectron_Corrected_Phi_Col;
0321 extern double fElectron_Delta_Mom_Col;
0322 extern double fElectron_Corrected_Energy_Col_GeV;
0323 extern double fElectron_Corrected_Mom_Col_GeV;
0324 extern double fElectron_Corrected_MomX_Col_GeV;
0325 extern double fElectron_Corrected_MomY_Col_GeV;
0326 extern double fElectron_Corrected_MomZ_Col_GeV;
0327 extern double fElectron_Delta_Mom_Col_GeV;
0328 
0329 extern double fScatElec_MS_Energy_Col;
0330 extern double fScatElec_MS_MomZ_Col;
0331 extern double fScatElec_MS_MomX_Col;
0332 extern double fScatElec_MS_MomY_Col;
0333 extern double fScatElec_MS_Theta_Col;
0334 extern double fScatElec_MS_Phi_Col;
0335 extern double fScatElec_MS_Mom_Col;
0336 
0337 extern double fScatElec_Energy_Col;
0338 extern double fScatElec_MomZ_Col;
0339 extern double fScatElec_MomX_Col;
0340 extern double fScatElec_MomY_Col;
0341 extern double fScatElec_Theta_Col;
0342 extern double fScatElec_Phi_Col;
0343 extern double fScatElec_Mom_Col;
0344 extern double fScatElec_Energy_Col_GeV;
0345 extern double fScatElec_Mom_Col_GeV;
0346 extern double fScatElec_MomX_Col_GeV;
0347 extern double fScatElec_MomY_Col_GeV;
0348 extern double fScatElec_MomZ_Col_GeV;
0349 extern double fScatElecEnergyLess;
0350 extern double fScatElecThetaLess;
0351 extern double fScatElec_Targ_Thickness;
0352 extern double fScatElec_Targ_Thickness_RadLen;
0353 extern double fScatElec_Targ_BT;
0354 extern double fScatElec_Targ_Bremss_Loss;
0355 extern double fScatElec_Targ_Ion_Loss;
0356 extern double fScatElec_Air_Thickness;
0357 extern double fScatElec_Air_Thickness_RadLen;
0358 extern double fScatElec_Air_BT;
0359 extern double fScatElec_Air_Bremss_Loss;
0360 extern double fScatElec_Air_Ion_Loss;
0361 extern double fScatElec_Corrected_Energy_Col;
0362 extern double fScatElec_Corrected_Mom_Col;
0363 extern double fScatElec_Corrected_MomX_Col;
0364 extern double fScatElec_Corrected_MomY_Col;
0365 extern double fScatElec_Corrected_MomZ_Col;
0366 extern double fScatElec_Corrected_Theta_Col;
0367 extern double fScatElec_Corrected_Phi_Col;
0368 extern double fScatElec_Delta_Mom_Col;
0369 extern double fScatElec_Corrected_Energy_Col_GeV;
0370 extern double fScatElec_Corrected_Mom_Col_GeV;
0371 extern double fScatElec_Corrected_MomX_Col_GeV;
0372 extern double fScatElec_Corrected_MomY_Col_GeV;
0373 extern double fScatElec_Corrected_MomZ_Col_GeV;
0374 extern double fScatElec_Delta_Mom_Col_GeV;
0375 extern double fScatElec_TargWindow_Bremss_Loss;
0376 extern double fScatElec_TargWindow_Ion_Loss;
0377 extern double fTargWindow_Thickness;
0378 extern double fTargWindow_Thickness_RadLen;
0379 extern double fTargWindow_BT;
0380 
0381 extern double fPion_TargWindow_Ion_Loss;
0382 extern double fPion_Targ_Thickness;
0383 extern double fPion_Targ_Thickness_RadLen;
0384 extern double fPion_Targ_BT;
0385 extern double fPion_Targ_Bremss_Loss;
0386 extern double fPion_Targ_Ion_Loss;
0387 extern double fPion_Air_Thickness;
0388 extern double fPion_Air_Thickness_RadLen;
0389 extern double fPion_Air_BT;
0390 extern double fPion_Air_Bremss_Loss;
0391 extern double fPion_Air_Ion_Loss;
0392 
0393 extern double fPion_MS_Energy_Col;
0394 extern double fPion_MS_MomZ_Col;
0395 extern double fPion_MS_MomX_Col;
0396 extern double fPion_MS_MomY_Col;
0397 extern double fPion_MS_Theta_Col;
0398 extern double fPion_MS_Phi_Col;
0399 extern double fPion_MS_Mom_Col;
0400 
0401 extern double fPion_Theta_Col;
0402 extern double fPion_Phi_Col;
0403 extern double fPion_Energy_Col;
0404 extern double fPion_Mom_Col;
0405 extern double fPion_MomZ_Col;
0406 extern double fPion_MomX_Col;
0407 extern double fPion_MomY_Col;
0408 extern double fPion_Energy_Col_GeV;
0409 extern double fPion_Mom_Col_GeV;
0410 extern double fPion_MomX_Col_GeV;
0411 extern double fPion_MomY_Col_GeV;
0412 extern double fPion_MomZ_Col_GeV;
0413 
0414 extern double fPion_FSI_Theta_Col;
0415 extern double fPion_FSI_Phi_Col;
0416 extern double fPion_FSI_Energy_Col;
0417 extern double fPion_FSI_Mom_Col;
0418 extern double fPion_FSI_MomZ_Col;
0419 extern double fPion_FSI_MomX_Col;
0420 extern double fPion_FSI_MomY_Col;
0421 extern double fPion_FSI_Energy_Col_GeV;
0422 extern double fPion_FSI_Mom_Col_GeV;
0423 extern double fPion_FSI_MomX_Col_GeV;
0424 extern double fPion_FSI_MomY_Col_GeV;
0425 extern double fPion_FSI_MomZ_Col_GeV;
0426 
0427 extern double fPion_Corrected_Theta_Col;
0428 extern double fPion_Corrected_Phi_Col;
0429 extern double fPion_Corrected_Energy_Col;
0430 extern double fPion_Corrected_Mom_Col;
0431 extern double fPion_Corrected_MomX_Col;
0432 extern double fPion_Corrected_MomY_Col;
0433 extern double fPion_Corrected_MomZ_Col;
0434 extern double fPion_Delta_Mom_Col;
0435 extern double fPion_Corrected_Energy_Col_GeV;
0436 extern double fPion_Corrected_Mom_Col_GeV;
0437 extern double fPion_Corrected_MomX_Col_GeV;
0438 extern double fPion_Corrected_MomY_Col_GeV;
0439 extern double fPion_Corrected_MomZ_Col_GeV;
0440 extern double fPion_Delta_Mom_Col_GeV;
0441 
0442 extern double fKaon_Theta_Col; 
0443 extern double fKaon_Phi_Col;
0444 extern double fKaon_Energy_Col;
0445 extern double fKaon_Mom_Col;
0446 extern double fKaon_MomZ_Col;
0447 extern double fKaon_MomX_Col;    
0448 extern double fKaon_MomY_Col;
0449 extern double fKaon_Energy_Col_GeV;
0450 extern double fKaon_Mom_Col_GeV;
0451 extern double fKaon_MomX_Col_GeV;
0452 extern double fKaon_MomY_Col_GeV;   
0453 extern double fKaon_MomZ_Col_GeV;
0454 extern double fScathad_Theta_Col;
0455 extern double fScathad_Phi_Col;
0456 extern double fScathad_Energy_Col;
0457 extern double fScathad_Mom_Col;
0458 extern double fScathad_MomZ_Col;
0459 extern double fScathad_MomX_Col;
0460 extern double fScathad_MomY_Col;
0461 extern double fScathad_Energy_Col_GeV;
0462 extern double fScathad_Mom_Col_GeV;
0463 extern double fScathad_MomX_Col_GeV;  
0464 extern double fScathad_MomY_Col_GeV; 
0465 extern double fScathad_MomZ_Col_GeV;
0466 
0467 extern double fNeutron_MS_Energy_Col;
0468 extern double fNeutron_MS_MomZ_Col;
0469 extern double fNeutron_MS_MomX_Col;
0470 extern double fNeutron_MS_MomY_Col;
0471 extern double fNeutron_MS_Theta_Col;
0472 extern double fNeutron_MS_Phi_Col;
0473 extern double fNeutron_MS_Mom_Col;
0474 
0475 extern double fNeutron_TargWindow_Ion_Loss;
0476 extern double fNeutron_Targ_Thickness;
0477 extern double fNeutron_Targ_Thickness_RadLen;
0478 extern double fNeutron_Targ_BT;
0479 extern double fNeutron_Targ_Bremss_Loss;
0480 extern double fNeutron_Targ_Ion_Loss;
0481 extern double fNeutron_Air_Thickness;
0482 extern double fNeutron_Air_Thickness_RadLen;
0483 extern double fNeutron_Air_BT;
0484 extern double fNeutron_Air_Bremss_Loss;
0485 extern double fNeutron_Air_Ion_Loss;
0486 extern double fNeutron_Theta_Col;
0487 extern double fNeutron_Phi_Col;
0488 extern double fNeutron_Energy_Col;
0489 extern double fNeutron_Mom_Col;
0490 extern double fNeutron_MomZ_Col;
0491 extern double fNeutron_MomX_Col;
0492 extern double fNeutron_MomY_Col;
0493 extern double fNeutron_Energy_Col_GeV;
0494 extern double fNeutron_Mom_Col_GeV;
0495 extern double fNeutron_MomX_Col_GeV;
0496 extern double fNeutron_MomY_Col_GeV;
0497 extern double fNeutron_MomZ_Col_GeV;
0498 extern double fNeutron_Corrected_Theta_Col;
0499 extern double fNeutron_Corrected_Phi_Col;
0500 extern double fNeutron_Corrected_Energy_Col;
0501 extern double fNeutron_Corrected_Mom_Col;
0502 extern double fNeutron_Corrected_MomX_Col;
0503 extern double fNeutron_Corrected_MomY_Col;
0504 extern double fNeutron_Corrected_MomZ_Col;
0505 extern double fNeutron_Delta_Mom_Col;
0506 extern double fNeutron_Corrected_Energy_Col_GeV;
0507 extern double fNeutron_Corrected_Mom_Col_GeV;
0508 extern double fNeutron_Corrected_MomX_Col_GeV;
0509 extern double fNeutron_Corrected_MomY_Col_GeV;
0510 extern double fNeutron_Corrected_MomZ_Col_GeV;
0511 extern double fNeutron_Delta_Mom_Col_GeV;
0512 
0513 extern double fRecoilProton_Energy_RF;
0514 extern double fRecoilProton_Mom_RF;
0515 extern double fRecoilProton_MomX_RF;
0516 extern double fRecoilProton_MomY_RF;
0517 extern double fRecoilProton_MomZ_RF;
0518 extern double fRecoilProton_Energy_RF_GeV;
0519 extern double fRecoilProton_Mom_RF_GeV;
0520 extern double fRecoilProton_MomX_RF_GeV;
0521 extern double fRecoilProton_MomY_RF_GeV;
0522 extern double fRecoilProton_MomZ_RF_GeV;
0523 extern double fRecoilProton_Theta_RF;
0524 extern double fRecoilProton_Phi_RF;
0525 
0526 extern double fRecoilProton_Targ_Thickness;
0527 extern double fRecoilProton_Targ_Thickness_RadLen;
0528 extern double fRecoilProton_Targ_BT;
0529 extern double fRecoilProton_Targ_Bremss_Loss;
0530 extern double fRecoilProton_Targ_Ion_Loss;
0531 extern double fRecoilProton_Air_Thickness;
0532 extern double fRecoilProton_Air_Thickness_RadLen;
0533 extern double fRecoilProton_Air_BT;
0534 extern double fRecoilProton_Air_Bremss_Loss;
0535 extern double fRecoilProton_Air_Ion_Loss;
0536 extern double fRecoilProton_Theta_Col;
0537 extern double fRecoilProton_Phi_Col;
0538 extern double fRecoilProton_Energy_Col;
0539 extern double fRecoilProton_Mom_Col;
0540 extern double fRecoilProton_MomZ_Col;
0541 extern double fRecoilProton_MomX_Col;
0542 extern double fRecoilProton_MomY_Col;
0543 extern double fRecoilProton_Energy_Col_GeV;
0544 extern double fRecoilProton_Mom_Col_GeV;
0545 extern double fRecoilProton_MomX_Col_GeV;
0546 extern double fRecoilProton_MomY_Col_GeV;
0547 extern double fRecoilProton_MomZ_Col_GeV;
0548 extern double fRecoilProton_Corrected_Theta_Col;
0549 extern double fRecoilProton_Corrected_Phi_Col;
0550 extern double fRecoilProton_Corrected_Energy_Col;
0551 extern double fRecoilProton_Corrected_Mom_Col;
0552 extern double fRecoilProton_Corrected_MomX_Col;
0553 extern double fRecoilProton_Corrected_MomY_Col;
0554 extern double fRecoilProton_Corrected_MomZ_Col;
0555 extern double fRecoilProton_Delta_Mom_Col;
0556 extern double fRecoilProton_Corrected_Energy_Col_GeV;
0557 extern double fRecoilProton_Corrected_Mom_Col_GeV;
0558 extern double fRecoilProton_Corrected_MomX_Col_GeV;
0559 extern double fRecoilProton_Corrected_MomY_Col_GeV;
0560 extern double fRecoilProton_Corrected_MomZ_Col_GeV;
0561 extern double fRecoilProton_Delta_Mom_Col_GeV;
0562 
0563 extern double fSSAsym;
0564 extern double fSineAsym;
0565 extern double fInvariantDif;
0566 extern double fT_GeV;
0567 extern double fProton_Kin_Col;
0568 extern double fQsq_Value;
0569 extern double fQsq_Dif;
0570 extern double fQsq_GeV;
0571 extern double fQsq;
0572 extern double fW_GeV_Col;
0573 extern double fW_Col;
0574 extern double fW;
0575 extern double fW_GeV;
0576 extern double fW_Prime_GeV;
0577 extern double fW_Corrected_Prime_GeV;
0578 extern double fWSq;
0579 extern double fWSq_GeV;
0580 extern double fWSq_PiN;
0581 extern double fWSq_PiN_GeV;
0582 extern double fWSq_Top_PiN_GeV;
0583 extern double fWSq_Bot_PiN_GeV;
0584 
0585 extern double fElec_ScatElec_Theta_RF;
0586 extern double fScatElec_Cone_Phi_RF;
0587 extern double fScatElec_Theta_RF;
0588 extern double fScatElec_Phi_RF;
0589 extern double fScatElec_Mom_RF;
0590 extern double fScatElec_Energy_RF;
0591 extern double fScatElec_MomX_RF;
0592 extern double fScatElec_MomZ_RF;
0593 extern double fScatElec_MomY_RF;
0594 extern double fScatElec_Energy_RF_GeV;
0595 extern double fScatElec_Mom_RF_GeV;
0596 extern double fScatElec_MomX_RF_GeV;
0597 extern double fScatElec_MomY_RF_GeV;
0598 extern double fScatElec_MomZ_RF_GeV;
0599 
0600 extern double fElectron_Theta_RF;
0601 extern double fElectron_Phi_RF;
0602 extern double fElectron_Energy_RF;
0603 extern double fElectron_Mom_RF;
0604 extern double fElectron_MomX_RF;
0605 extern double fElectron_MomZ_RF;
0606 extern double fElectron_MomY_RF;
0607 extern double fElectron_Energy_RF_GeV;
0608 extern double fElectron_Mom_RF_GeV;
0609 extern double fElectron_MomX_RF_GeV;
0610 extern double fElectron_MomZ_RF_GeV;
0611 extern double fElectron_MomY_RF_GeV;
0612 
0613 extern double fPhoton_Energy_RF_GeV;
0614 extern double fPhoton_Mom_RF_GeV;
0615 extern double fPhoton_Energy_RF;
0616 extern double fPhoton_Mom_RF;
0617 
0618 extern double fProton_Energy_CM;
0619 extern double fProton_Mom_CM;
0620 extern double fProton_Energy_CM_GeV;
0621 extern double fProton_Mom_CM_GeV;
0622 extern double fPhoton_Energy_CM;
0623 extern double fPhoton_Mom_CM;
0624 extern double fPhoton_Energy_CM_GeV;
0625 extern double fPhoton_Mom_CM_GeV;
0626 extern double fPion_Theta_CM;
0627 extern double fPion_Phi_CM;
0628 extern double fPion_Energy_CM;
0629 extern double fPion_Mom_CM;
0630 extern double fPion_Energy_CM_GeV;
0631 extern double fPion_Mom_CM_GeV;
0632 extern double fNeutron_Theta_CM;
0633 extern double fNeutron_Phi_CM;
0634 extern double fNeutron_Energy_CM;
0635 extern double fNeutron_Energy_CM_GeV;
0636 extern double fNeutron_Mom_CM;
0637 extern double fNeutron_Mom_CM_GeV;
0638 
0639 extern double fBeta_CM_RF;
0640 extern double fGamma_CM_RF;
0641 
0642 extern double fPhoton_MomZ_RF;
0643 extern double fPhoton_MomX_RF;
0644 extern double fPhoton_MomY_RF;
0645 extern double fPhoton_Theta_RF;
0646 extern double fPhoton_Phi_RF;
0647 extern double fPion_Energy_RF;
0648 extern double fPion_Energy_RF_GeV;
0649 extern double fPiqVec_Theta_RF;
0650 extern double fPion_Mom_RF;
0651 extern double fPion_Mom_RF_GeV;
0652 extern double fPion_MomX_RF;
0653 extern double fPion_MomY_RF;
0654 extern double fPion_MomZ_RF;
0655 extern double fPion_Theta_RF;
0656 extern double fPion_Phi_RF;
0657 extern double fPion_MomX_RF_GeV;
0658 extern double fPion_MomY_RF_GeV;
0659 extern double fPion_MomZ_RF_GeV;
0660 
0661 extern double fT_Para;
0662 extern double fT_Para_GeV;
0663 extern double fT;
0664 extern double fEpsilon;
0665 extern double fx;
0666 extern double fy;
0667 extern double fz;
0668 extern double fNeutron_Energy_RF;
0669 extern double fNeutron_Energy_RF_GeV;
0670 extern double fNeutron_Mom_RF;
0671 extern double fNeutron_Mom_RF_GeV;
0672 extern double fNeutron_qVec_Theta_RF;
0673 extern double fNeutron_MomX_RF;
0674 extern double fNeutron_MomY_RF;
0675 extern double fNeutron_MomZ_RF;
0676 extern double fNeutron_Theta_RF;
0677 extern double fNeutron_Phi_RF;
0678 extern double fPhoton_MomX_RF_GeV;
0679 extern double fPhoton_MomY_RF_GeV;
0680 extern double fPhoton_MomZ_RF_GeV;
0681 extern double fNeutron_MomX_RF_GeV;
0682 extern double fNeutron_MomY_RF_GeV;
0683 extern double fNeutron_MomZ_RF_GeV;
0684 
0685 extern double fPhoton_Theta_Col;
0686 extern double fPhoton_Phi_Col;
0687 extern double fPhoton_Energy_Col;
0688 extern double fPhoton_Mom_Col;
0689 extern double fPhoton_MomX_Col;
0690 extern double fPhoton_MomZ_Col;
0691 extern double fPhoton_MomY_Col;
0692 extern double fPhoton_Energy_Col_GeV;
0693 extern double fPhoton_Mom_Col_GeV;
0694 extern double fPhoton_MomX_Col_GeV;
0695 extern double fPhoton_MomZ_Col_GeV;
0696 extern double fPhoton_MomY_Col_GeV;
0697 
0698 extern double fPhoton_Corrected_Theta_Col;
0699 extern double fPhoton_Corrected_Phi_Col;
0700 extern double fPhoton_Corrected_Energy_Col;
0701 extern double fPhoton_Corrected_Mom_Col;
0702 extern double fPhoton_Corrected_MomX_Col;
0703 extern double fPhoton_Corrected_MomZ_Col;
0704 extern double fPhoton_Corrected_MomY_Col;
0705 extern double fPhoton_Corrected_Energy_Col_GeV;
0706 extern double fPhoton_Corrected_Mom_Col_GeV;
0707 extern double fPhoton_Corrected_MomX_Col_GeV;
0708 extern double fPhoton_Corrected_MomZ_Col_GeV;
0709 extern double fPhoton_Corrected_MomY_Col_GeV;
0710 
0711 extern double fQsq_Corrected_GeV;
0712 extern double fQsq_Corrected;
0713 extern double fW_Corrected;
0714 extern double fW_Corrected_GeV;
0715 extern double fT_Corrected;
0716 extern double fT_Corrected_GeV;
0717 extern double fx_Corrected;
0718 extern double fy_Corrected;
0719 extern double fz_Corrected;
0720 
0721 extern double fWFactor;
0722 extern double fA;
0723 extern double fFlux_Factor_Col;
0724 extern double fFlux_Factor_RF;
0725 extern double fJacobian_CM;
0726 extern double fJacobian_CM_RF;
0727 extern double fJacobian_CM_Col;
0728 extern double fZASig_T;
0729 extern double fZASig_L;
0730 extern double fZASig_LT;
0731 extern double fZASig_TT;
0732 extern double ftestsig;
0733 extern double fZASig_L2;
0734 
0735 extern double fZASigma_UU;
0736 extern double fRorySigma_UT;
0737 extern double fSigma_Col;
0738 extern double fSigma_UUPara;
0739 extern double fSig_VR;
0740 extern double fSig_L;
0741 extern double fSig_T;
0742 
0743 extern double fSig_fpi_6GeV;
0744 
0745 extern double fSigmaPhiS;
0746 extern double fSigmaPhi_Minus_PhiS;
0747 extern double fSigma2Phi_Minus_PhiS;
0748 extern double fSigma3Phi_Minus_PhiS;
0749 extern double fSigmaPhi_Plus_PhiS;
0750 extern double fSigma2Phi_Plus_PhiS;
0751 extern double fSig_Phi_Minus_PhiS;
0752 extern double fSig_PhiS;
0753 extern double fSig_2Phi_Minus_PhiS;
0754 extern double fSig_Phi_Plus_PhiS;
0755 extern double fSig_3Phi_Minus_PhiS;
0756 extern double fSig_2Phi_Plus_PhiS;
0757 extern double fEventWeight;
0758 extern double fEventWeightMax;
0759 extern double fEventWeightCeil;  // SJDK 11/05/21 - This is the maximum value found with the old method that is used to get the new unit weight
0760 extern double fEventWeightRn;  // SJDK 11/05/21 - Random number to compare determined weight to
0761 extern double fZAWFactor;
0762 extern double fRR;
0763 extern double fPhaseSpaceWeight;
0764 extern double fPhaseShiftWeight;
0765 extern double fWilliamsWeight;
0766 extern double fDedrickWeight;
0767 extern double fCatchenWeight;
0768 extern double fPhi;
0769 extern double fPhiS;
0770 extern double fPhi_Corrected;
0771 extern double fPhiS_Corrected;
0772 
0773 extern double fElectron_Mom_Sq_RF;
0774 extern double fElectron_Mom_Sq_Col;
0775 extern double fProton_Mom_Sq_Col;
0776 extern double fProton_Mom_Sq_CM;
0777 extern double fProton_Mom_Sq_RF;
0778 extern double fPhoton_Mom_Sq_Col;
0779 extern double fPhoton_Mom_Sq_CM;
0780 extern double fPhoton_Mom_Sq_RF;
0781 extern double fPion_Mom_Sq_Col;
0782 extern double fPion_Mom_Sq_CM;
0783 extern double fPion_Mom_Sq_RF;
0784 extern double fNeutron_Mom_Sq_Col;
0785 extern double fNeutron_Mom_Sq_CM;
0786 extern double fNeutron_Mom_Sq_RF;
0787 extern double fScatElec_Mom_Sq_Col;
0788 extern double fScatElec_Mom_Sq_RF;
0789 
0790 extern double fAsymPhiMinusPhi_S;
0791 extern double fAsymPhi_S;
0792 extern double fAsym2PhiMinusPhi_S;
0793 extern double fAsymPhiPlusPhi_S;
0794 extern double fAsym3PhiMinusPhi_S;
0795 extern double fAsym2PhiPlusPhi_S;
0796 
0797 extern double fTerm_PhiMinusPhi_S;
0798 extern double fTerm_Phi_S;
0799 extern double fTerm_2PhiMinusPhi_S;
0800 extern double fTerm_PhiPlusPhi_S;
0801 extern double fTerm_3PhiMinusPhi_S;
0802 extern double fTerm_2PhiPlusPhi_S;
0803 
0804 extern double fAsymPhiMinusPhi_S_Col;
0805 extern double fAsymPhi_S_Col;
0806 extern double fAsym2PhiMinusPhi_S_Col;
0807 extern double fAsymPhiPlusPhi_S_Col;
0808 extern double fAsym3PhiMinusPhi_S_Col;
0809 extern double fAsym2PhiPlusPhi_S_Col;
0810 
0811 extern double fTerm_PhiMinusPhi_S_Col;
0812 extern double fTerm_Phi_S_Col;
0813 extern double fTerm_2PhiMinusPhi_S_Col;
0814 extern double fTerm_PhiPlusPhi_S_Col;
0815 extern double fTerm_3PhiMinusPhi_S_Col;
0816 extern double fTerm_2PhiPlusPhi_S_Col;
0817 
0818 extern double fPhi_Pion_LeptonPlane_RF;
0819 extern double fCos_Phi_Pion_LeptonPlane_RF;
0820 extern double fSin_Phi_Pion_LeptonPlane_RF;
0821 extern double fPhi_TargPol_LeptonPlane_RF;
0822 extern double fCos_Phi_TargPol_LeptonPlane_RF;
0823 extern double fSin_Phi_TargPol_LeptonPlane_RF;
0824 extern double fTheta_Pion_Photon_RF;
0825 extern double fPhi_Pion_LeptonPlane_Col;
0826 extern double fCos_Phi_Pion_LeptonPlane_Col;
0827 extern double fSin_Phi_Pion_LeptonPlane_Col;
0828 extern double fPhi_TargPol_LeptonPlane_Col;
0829 extern double fCos_Phi_TargPol_LeptonPlane_Col;
0830 extern double fSin_Phi_TargPol_LeptonPlane_Col;
0831 extern double fTheta_Pion_Photon_Col;
0832 
0833 extern double fZASigma_UU_Col;
0834 extern double fRorySigma_UT_Col;
0835 extern double fSig_Phi_Minus_PhiS_Col;
0836 extern double fSig_PhiS_Col;
0837 extern double fSig_2Phi_Minus_PhiS_Col;
0838 extern double fSig_Phi_Plus_PhiS_Col;
0839 extern double fSig_3Phi_Minus_PhiS_Col;
0840 extern double fSig_2Phi_Plus_PhiS_Col;
0841 
0842 extern double fepi1;
0843 extern double fepi2;
0844 extern double fradical;
0845 
0846 extern double fMomentum[300];
0847 extern double fProb[300];
0848 
0849 extern double conserve;      // 16/06/21 AU -> New Variables for conservation law checks. This is the number that PASS both conservation check
0850 extern double ene; // The number that FAIL due to failing energy conservation check ONLY
0851 extern double mom; // The number that FAIL due to failing the momentum conservation check ONLY
0852 extern double ene_mom; // The number that FAIL BOTH energy and momentum check
0853 
0854 extern double mom_px; // Number that fail due to px only
0855 extern double mom_py; // Number that fail due to py only
0856 extern double mom_pz; // Number that fail due to pz only
0857 extern double mom_pxpy; // Number that fail due to px and py
0858 extern double mom_pxpz; // Number that fail due to px and pz
0859 extern double mom_pypz; // Number that fail due to py and pz
0860 extern double mom_pxpypz; // Number that fail due to px, py and pz
0861 
0862 // 27/01/22 - Love Preet - Adding in vector of cross section parameters
0863 extern vector<vector<vector<vector<double>>>> SigPar;
0864 
0865 // Love Preet - Added for phase space factor calculations
0866 extern int psf_steps;
0867 extern double psf_ScatElec_E_Stepsize;
0868 extern double psf_ScatElec_Theta_Stepsize;
0869 extern double psf_ScatElec_Phi_Stepsize;
0870 extern double psf_ScatElec_E;
0871 extern double psf_ScatElec_Theta;
0872 extern double psf_ScatElec_Phi;
0873 extern double psf_ScalElec_Mom;
0874 extern double psf_Ejec_Theta_Stepsize;
0875 extern double psf_Ejectile_Theta;
0876 extern double psf_Ejectile_Phi;
0877 extern double psf_Q2, psf_W, psf_W2, psf_t;
0878 extern double psf_ScatElec_Theta_max, psf_ScatElec_Theta_min;
0879 extern double psf_ScatElec_E_max, psf_ScatElec_E_min;
0880 extern double psf_Ejectile_Theta_max, psf_Ejectile_Theta_min;
0881 
0882 // Love Preet - Added for actual phase space factor calculations
0883 extern double fScatElec_Energy_Col_max;
0884 extern double fScatElec_Energy_Col_min; 
0885 extern double fScatElec_Theta_Col_max; 
0886 extern double fScatElec_Theta_Col_min;
0887 extern double f_Ejectile_Theta_Col_max;
0888 extern double f_Ejectile_Theta_Col_min;
0889 extern double fPSF_org;
0890 
0891 //Love Preet - Added to be stored in the root tree
0892 extern double scat_e_px;
0893 extern double scat_e_py;
0894 extern double scat_e_pz;
0895 extern double scat_e_E;
0896 extern double ejec_px;
0897 extern double ejec_py;
0898 extern double ejec_pz;
0899 extern double ejec_E;
0900 extern double rclH_px;
0901 extern double rclH_py;
0902 extern double rclH_pz;
0903 extern double rclH_E;
0904 
0905 //Love Preet - Added for jacobian calculation in collider frame
0906 extern double fBeta_Col; 
0907 extern double fGamma_Col;
0908 extern double ftheta_Col;
0909 
0910 #endif