59 outputParticleMass( 0 ), nucleusOutputParticleMass( 0 ),
60 useTableMass( false ), useMassCut( false ), massCutOPCenter( 0 ),
61 massCutNOPCenter( 0 ), massCutOPWidth( 0 ), massCutNOPWidth( 0 ),
62 massCutEllipseAngle( 0 ), useAbsorbedEnergyCut( false ),
63 absorbedEnergyCutCLCenter( 0 ), absorbedEnergyCutCRCenter( 0 ),
64 absorbedEnergyCutCLWidth( 0 ), absorbedEnergyCutCRWidth( 0 ),
65 absorbedEnergyCutEllipseAngle( 0 ), expectedMomentumAmp( -1 ),
67 hasMassCutTriggered( false ), hasAbsorbedEnergyCutTriggered( false ),
68 beamParticleIsInitialized( false ), particleGun( NULL ), messenger( NULL )
70 if ( ! productionModel )
79 static_cast< const CexmcPrimaryGeneratorAction * >(
82 const_cast< CexmcPrimaryGeneratorAction * >(
83 primaryGeneratorAction ) );
109 beamParticleIsInitialized =
true;
116 if ( ! beamParticleIsInitialized )
122 beamParticleIsInitialized =
true;
156 outputParticleMass = std::sqrt( 2 * calorimeterEDLeft *
157 calorimeterEDRight * ( 1 - cosTheAngle ) );
160 opdpLeftMomentum.
setMag( calorimeterEDLeft );
162 opdpRightMomentum.
setMag( calorimeterEDRight );
163 G4ThreeVector opMomentum( opdpLeftMomentum + opdpRightMomentum );
169 outputParticleMass );
178 G4double incidentParticleMomentumAmp( expectedMomentumAmp > 0 ?
180 incidentParticleMomentum *= incidentParticleMomentumAmp;
184 G4double incidentParticlePDGMass2( incidentParticlePDGMass *
185 incidentParticlePDGMass );
187 std::sqrt( incidentParticleMomentumAmp * incidentParticleMomentumAmp +
188 incidentParticlePDGMass2 ) );
191 incidentParticleMomentum, incidentParticleEnergy );
218 G4ThreeVector nopMomentum( incidentParticleMomentum - opMomentum );
219 G4double nopEnergy( incidentParticleEnergy + nucleusParticlePDGMass -
221 nucleusOutputParticleMass = std::sqrt( nopEnergy * nopEnergy -
222 nopMomentum.
mag2() );
226 G4double cosMassCutEllipseAngle( std::cos( massCutEllipseAngle ) );
227 G4double sinMassCutEllipseAngle( std::sin( massCutEllipseAngle ) );
229 if ( massCutOPWidth <= 0. || massCutNOPWidth <= 0. )
231 hasMassCutTriggered =
false;
235 G4double massCutOPWidth2( massCutOPWidth * massCutOPWidth );
236 G4double massCutNOPWidth2( massCutNOPWidth * massCutNOPWidth );
238 hasMassCutTriggered =
239 std::pow( ( outputParticleMass - massCutOPCenter ) *
240 cosMassCutEllipseAngle +
241 ( nucleusOutputParticleMass - massCutNOPCenter ) *
242 sinMassCutEllipseAngle, 2 ) / massCutOPWidth2 +
243 std::pow( - ( outputParticleMass - massCutOPCenter ) *
244 sinMassCutEllipseAngle +
245 ( nucleusOutputParticleMass - massCutNOPCenter ) *
246 cosMassCutEllipseAngle, 2 ) / massCutNOPWidth2 <
251 if ( useAbsorbedEnergyCut )
253 G4double cosAbsorbedEnergyCutEllipseAngle(
254 std::cos( absorbedEnergyCutEllipseAngle ) );
255 G4double sinAbsorbedEnergyCutEllipseAngle(
256 std::sin( absorbedEnergyCutEllipseAngle ) );
258 if ( absorbedEnergyCutCLWidth <= 0. || absorbedEnergyCutCRWidth <= 0. )
260 hasAbsorbedEnergyCutTriggered =
false;
265 absorbedEnergyCutCLWidth * absorbedEnergyCutCLWidth );
267 absorbedEnergyCutCRWidth * absorbedEnergyCutCRWidth );
269 hasAbsorbedEnergyCutTriggered =
270 std::pow( ( calorimeterEDLeft - absorbedEnergyCutCLCenter ) *
271 cosAbsorbedEnergyCutEllipseAngle +
272 ( calorimeterEDRight - absorbedEnergyCutCRCenter ) *
273 sinAbsorbedEnergyCutEllipseAngle, 2 ) /
274 absorbedEnergyCutCLWidth2 +
275 std::pow( - ( calorimeterEDLeft - absorbedEnergyCutCLCenter ) *
276 sinAbsorbedEnergyCutEllipseAngle +
277 ( calorimeterEDRight - absorbedEnergyCutCRCenter ) *
278 cosAbsorbedEnergyCutEllipseAngle, 2 ) /
279 absorbedEnergyCutCRWidth2 <
292 if ( useMassCut && ! hasMassCutTriggered )
294 if ( useAbsorbedEnergyCut && ! hasAbsorbedEnergyCutTriggered )
G4LorentzVector nucleusOutputParticleLAB
Hep3Vector boostVector() const
const G4ParticleDefinition * nucleusParticle
G4ThreeVector calorimeterEPLeftWorldPosition
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
void SetExpectedMomentumAmpDiff(G4double)
CLHEP::Hep3Vector G4ThreeVector
G4double calorimeterEDLeftAdjacent
G4double calorimeterEDLeft
void SetupBeamParticle(void)
const G4ParticleDefinition * incidentParticle
G4double calorimeterEDRight
G4double GetOrigMomentumAmp(void) const
G4ParticleDefinition * GetIncidentParticle(void) const
G4LorentzVector incidentParticleSCM
~CexmcChargeExchangeReconstructor()
G4LorentzVector incidentParticleLAB
void ReconstructAngle(void)
G4LorentzVector outputParticleLAB
G4LorentzVector outputParticleSCM
const G4ParticleDefinition * outputParticle
G4LorentzVector nucleusParticleLAB
G4LorentzVector nucleusOutputParticleSCM
G4ThreeVector targetEPWorldPosition
void ReconstructEntryPoints(const CexmcEnergyDepositStore *edStore)
const XML_Char int const XML_Char * value
CexmcChargeExchangeReconstructor(const CexmcProductionModel *productionModel)
void Reconstruct(const CexmcEnergyDepositStore *edStore)
HepLorentzVector & boost(double, double, double)
G4bool collectEDInAdjacentCrystals
G4bool HasFullTrigger(void) const
G4ParticleDefinition * GetOutputParticle(void) const
void ReconstructTargetPoint(void)
G4ThreeVector calorimeterEPRightWorldPosition
static G4RunManager * GetRunManager()
G4double GetPDGMass() const
G4ParticleDefinition * GetNucleusParticle(void) const
G4ParticleDefinition * GetParticleDefinition() const
CexmcParticleGun * GetParticleGun(void)
G4ParticleDefinition * GetNucleusOutputParticle(void) const
const G4ParticleDefinition * nucleusOutputParticle
const G4ThreeVector & GetOrigDirection(void) const
G4LorentzVector nucleusParticleSCM
CLHEP::HepLorentzVector G4LorentzVector
G4double calorimeterEDRightAdjacent