1 #ifndef SecondaryInteractionSystematic_h 2 #define SecondaryInteractionSystematic_h 4 #include "AnalysisUtils.hxx" 6 #include "HEPConstants.hxx" 10 #include "GeometryManager.hxx" 11 #include <TGeoManager.h> 13 #include <TGeoVolume.h> 14 #include <TGeoMaterial.h> 15 #include "ParticleId.hxx" 16 #include "CoreUtils.hxx" 33 const TVector3
field = TVector3(0.2, 0., 0.);
36 const Double_t
K = 0.307075;
98 Pos = anaUtils::ArrayToTLorentzVector(track.
Position).Vect();
99 Dir = anaUtils::ArrayToTVector3(track.
Direction);
102 Mass = units::pdgBase->GetParticle(track.
PDG)->Mass() * units::GeV;
163 XSecDataReference(0, 0){}
171 XSecDataReference(0, 0){
184 stateCurrent = stateStart;
188 propSteps.reserve(200);
191 propStepsReference.clear();
192 propStepsReference.reserve(200);
243 typedef std::vector<std::pair<AnaTrueParticleB*, std::vector<AnaTrueParticleB*> > >::iterator ParentsAndDaughtersIt;
282 _initialized =
false;
284 _det = SubDetId::kInvalid;
287 _computeReWeightInfo =
false;
295 if (_initialized)
return;
309 virtual Bool_t InVOI(
const TVector3&)
const = 0;
316 virtual Double_t GetCrossSection(
const si_syst::InteractionType&,
const Float_t&,
const Int_t&, TGeoNode*)
const = 0;
322 TGeoNode *node = ND::hgman().GeoManager()->FindNode(state.Pos.X(), state.Pos.Y(), state.Pos.Z());
324 return GetCrossSection(type, state.Momentum, PDG, node);
330 virtual Double_t GetCrossSectionError(
const si_syst::InteractionType&,
const Float_t&,
const Int_t&, TGeoNode*)
const = 0;
335 TGeoNode *node = ND::hgman().GeoManager()->FindNode(state.Pos.X(), state.Pos.Y(), state.Pos.Z());
337 return GetCrossSectionError(type, state.Momentum, PDG, node);
343 std::cout <<
" si_syst::ParticleSIPropagator::GetReferenceCrossSection() - the function has to be properly implemented " <<
344 " in the derived class if the re-weighting is needed " << std::endl;
351 TGeoNode *node = ND::hgman().GeoManager()->FindNode(state.Pos.X(), state.Pos.Y(), state.Pos.Z());
353 return GetReferenceCrossSection(type, state.Momentum, PDG, node);
363 return _particlePDGs;
368 _intTypes.insert(type);
373 _particlePDGs.insert(pdg);
389 _computeReWeightInfo = status;
394 return _computeReWeightInfo;
402 virtual void SetParameters() = 0;
406 virtual Double_t DScattCenters(TGeoNode*)
const;
455 _propagator = propagator;
481 std::ostream& operator<<(std::ostream& os,
const TVector3& vect);
482 std::ostream& operator<<(std::ostream& os,
const TLorentzVector& vect);
std::vector< std::pair< AnaTrueParticleB *, std::vector< AnaTrueParticleB * > > > ParentsAndDaughters
Basic structures to be able to associate a track with its "relatives".
si_syst::SIXSecData XSecDataReference
Store data for reference cross-section.
ParticleState stateStart
Initial state of the particle.
std::vector< StepInfo > propStepsReference
std::set< si_syst::InteractionType > _intTypes
Relevant interaction types to be considered while propagating.
bool _computeReWeightInfo
Whether to caculate weight for re-weighting (using the reference cross-section)
SubDetId::SubDetEnum GetDetector() const
Get detector of interest.
std::vector< SIXSecData > StepInfo
void Initialize()
Initialization.
virtual void SetPropagator(ParticleSIPropagator *propagator)
Set the propagator.
Double_t GetCrossSectionError(const si_syst::InteractionType &type, const ParticleState &state, const Int_t &PDG)
Same but given the state.
Double_t _lengthStepSize
The step size in terms of length.
Double_t GetIMaterial(TGeoNode *node)
si_syst::SIXSecData XSecData
Store both the cross-section and error.
Float_t Momentum
The initial momentum of the true particle.
ParticleHistory(const InteractionType &type, const AnaTrueParticleB &track)
A ctor given the interaction type and true particle.
bool IsInitialized()
Whether the propagator was initialized.
const std::set< si_syst::InteractionType > & GetInteractionTypes() const
Get interaction types.
Double_t _momStepSize
The step size in terms of monetum.
Double_t GetCrossSection(const si_syst::InteractionType &type, const ParticleState &state, const Int_t &PDG)
Same but given the state.
std::set< ParticleId::PdgEnum > _particlePDGs
PDG of relevant particles, keep here for the moment.
void AddInteractionType(si_syst::InteractionType type)
Add an interaction type.
si_syst::ParticleSIPropagator * GetPropagator() const
Get propagator.
void AddParticlePDG(ParticleId::PdgEnum pdg)
Add particle PDG.
Representation of a true Monte Carlo trajectory/particle.
A simple structure to repesent a pair: xsection value and its uncertainty.
const TVector3 field
Constants.
SubDetEnum
Enumeration of all detector systems and subdetectors.
Int_t PDG
The PDG code of this particle.
Float_t Weight
Weight for this particle, to be applied to correspond to a reference cross-section.
const AnaTrueParticleB * trueTrack
A pointer to the original true track.
MaterialEnum GetMaterialEnum(const std::string &)
Get the material enum given a material name.
const Double_t K
Bethe-Bloch constants.
A simple structure to represent a state object: position, direction, momentum, charge.
Double_t GetReferenceCrossSection(const si_syst::InteractionType &type, const si_syst::ParticleState &state, const Int_t &PDG)
Same but given the state.
void TakeSmallStep(ParticleState &, const Double_t &)
Propagate a state in a small step.
Double_t BetheBloch(const ParticleState &)
void SetComputeReWeightStatus(bool status)
Whether to calculate correction weight, w.r.t to reference cross-section.
std::vector< StepInfo > propSteps
Vector of steps considered with the corresponding info.
void Reset()
Reset the history of the particle.
const std::set< ParticleId::PdgEnum > & GetParticlePDGs() const
Get particle PDGs.
virtual ~ParticleSIManager()
dtor
Double_t GetIElement(Int_t Z)
Float_t Position[4]
The initial position of the true particle.
void SetDetector(const SubDetId::SubDetEnum &det)
Set detector of interest.
bool GetComputeReWeightStatus() const
Whether to calculate correction weight, w.r.t to reference cross-section.
virtual Double_t GetReferenceCrossSection(const si_syst::InteractionType &, const Float_t &, const Int_t &, TGeoNode *) const
Double_t GetZoverAMaterial(TGeoNode *)
Float_t Charge
The true charge of the particle.
void Print()
Dump the history.
Float_t Direction[3]
The initial direction of the true particle.
SubDetId::SubDetEnum _det
Keep the relevant sub-detector here for the moment.
ParticleHistory()
A default ctor.
ParticleState stateCurrent
Current state of the particle.