HighLAND
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
si_syst::ParticleSIManager Class Reference

Manager. More...

#include <SecondaryInteractionSystematic.hxx>

Inheritance diagram for si_syst::ParticleSIManager:
proton_si::ProtonSIManager

Public Member Functions

 ParticleSIManager ()
 ctor
 
virtual ~ParticleSIManager ()
 dtor
 
virtual void SetPropagator (ParticleSIPropagator *propagator)
 Set the propagator.
 
si_syst::ParticleSIPropagatorGetPropagator () const
 Get propagator.
 
si_syst::SISystInputCollectParticleInteractions (AnaTrueParticleB **, int, const SubDetId::SubDetEnum &) const
 Calculates the information needed to compute an event weight.
 

Protected Member Functions

virtual si_syst::SISystInputGetRelevantParticles (AnaTrueParticleB **, int) const
 

Protected Attributes

ParticleSIPropagator_propagator
 

Detailed Description

Manager.

Definition at line 433 of file SecondaryInteractionSystematic.hxx.

Member Function Documentation

§ GetRelevantParticles()

si_syst::SISystInput * si_syst::ParticleSIManager::GetRelevantParticles ( AnaTrueParticleB **  allTrajs,
int  nTrajs 
) const
protectedvirtual

Get relevant particles Given array of input true tracks, its size The propagator provides the information on relevant tracks, interactions and VOI, so one has to set them first Default method just splits between inelastic and no-interaction in VOI

Fill the interaction types

Definition at line 560 of file SecondaryInteractionSystematic.cxx.

560  {
561  //********************************************************************
562 
563 #ifdef DEBUG
564  std::cout << " ======= " << std::endl;
565  std::cout << " si_syst::ParticleSIManager::GetRelevantParticles " << std::endl;
566 #endif
567 
568  assert(GetPropagator());
569 
570  assert(GetPropagator()->IsInitialized());
571 
572 
574 
575  // We want to count all particles of interest (PDG) that originate in particular volume
576  // and group them (if exist) with the daughters of their probable interactions
577  si_syst::ParentsAndDaughters ParticlesAndInteractions;
578 
579  for (Int_t it = 0; it < nTrajs; it++){
580 
581  AnaTrueParticleB* track = allTrajs[it];
582 
583  // Should be inside PDGs of interest
584  // not using set::find here since then need to cast int to PdgEnum, not sure it will always succeed
585  bool ok = false;
586  std::set<ParticleId::PdgEnum>::const_iterator it_set = GetPropagator()->GetParticlePDGs().begin();
587 
588  for (; it_set != GetPropagator()->GetParticlePDGs().end(); it_set++){
589  if (*it_set == track->PDG){
590  ok = true;
591  break;
592  }
593  }
594 
595  if (!ok)
596  continue;
597 
598  // Should start in the VOI
599  if (!GetPropagator()->InVOI(track->Position)) continue;
600 
601  ParticlesAndInteractions.push_back(std::make_pair(track, std::vector<AnaTrueParticleB*>()));
602 
603  // Now loop over trajectories and find those that mention this particle as parent
604  // those daughtes should start in the volume of interest as well
605  for (Int_t jt = 0; jt < nTrajs; jt++){
606  AnaTrueParticleB* track2 = allTrajs[jt];
607 
608  if (track->ID == track2->ParentID &&
609  GetPropagator()->InVOI(track->Position)){
610 
611  // Add this trajectory to interaction list
612  ParticlesAndInteractions.back().second.push_back(track2);
613 
614  }
615 
616  } //second loop over true tracks
617  }//first loop over true tracks
618 
619  //now we have all primary particles grouped together with their possible daughters
620  //we can so arrange them into interactions
621 
622  result->nParticles = ParticlesAndInteractions.size();
623 
624  result->Particles = new si_syst::ParticleHistory[result->nParticles];
625 
626 
627  /// Fill the interaction types
628  for(Int_t i = 0; i < result->nParticles; i++){
629 
630  result->Particles[i] = si_syst::ParticleHistory(si_syst::kInelastic, *(ParticlesAndInteractions[i].first));
631 
632  // No interactions in the volume
633  if (ParticlesAndInteractions[i].second.size() == 0)
634  result->Particles[i].intType = si_syst::kNoInteraction;
635 
636  }
637 
638 #ifdef DEBUG
639  std::cout << " nParticles: " << result->nParticles << std::endl;
640 #endif
641 
642 #ifdef DEBUG
643  std::cout << " ======= " << std::endl;
644 #endif
645  return result;
646 }
std::vector< std::pair< AnaTrueParticleB *, std::vector< AnaTrueParticleB * > > > ParentsAndDaughters
Basic structures to be able to associate a track with its "relatives".
Int_t ID
The ID of the trueObj, which corresponds to the ID of the TTruthParticle that created it...
si_syst::ParticleSIPropagator * GetPropagator() const
Get propagator.
Representation of a true Monte Carlo trajectory/particle.
Int_t PDG
The PDG code of this particle.
const std::set< ParticleId::PdgEnum > & GetParticlePDGs() const
Get particle PDGs.
Int_t ParentID
The ID of this particle&#39;s immediate parent, or 0 if there is no parent.
Float_t Position[4]
The initial position of the true particle.
A simple class to provide the data for the systematic itself: a collection of particles with the rele...
virtual Bool_t InVOI(const TVector3 &) const =0
Is a point inside a volume of interest: the region where the propagation is relevant.

The documentation for this class was generated from the following files: