Jpp  19.1.0
the software that should make you happy
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
JAANET::JMuonBundleCategory Struct Referencefinal

Class for muon bundle categories. More...

#include <JMuonBundleCategory.hh>

Inheritance diagram for JAANET::JMuonBundleCategory:
JLANG::JClonable< JClonable_t, JDerived_t >

Classes

struct  JMuonBundleCategoryHelper
 Auxiliary class for I/O of muon bundle category. More...
 

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

 JMuonBundleCategory ()
 Default constructor. More...
 
 JMuonBundleCategory (const int primaryType)
 Constructor. More...
 
 JMuonBundleCategory (const int primaryType, const JRange< double > &Erange, const JRange< double > &coszRange, const JRange< int > &Mrange, const double Rmax)
 Constructor. More...
 
 JMuonBundleCategory (const JHead &header)
 Constructor. More...
 
bool is_valid () const override final
 Check if muon bundle category is valid. More...
 
bool match (const JHead &header) const override final
 Check whether this event category matches with the given MC header. More...
 
bool match (const Evt &event) const override final
 Check whether given event matches with this event category. More...
 
bool less (const JEvtCategory &category) const override final
 Less-than method. More...
 
JProperties getProperties (const JEquationParameters &equation=JEvtCategory::getEquationParameters()) override final
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &equation=JEvtCategory::getEquationParameters()) const override final
 Get properties of this class. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Private Attributes

JRange< double > Erange
 energy range [GeV] More...
 
JRange< double > coszRange
 cosine zenith-angle range [-] More...
 
JRange< int > Mrange
 multiplicity range [-] More...
 
double Rmax
 maximum radial extent [m] More...
 

Detailed Description

Class for muon bundle categories.

Definition at line 80 of file JMuonBundleCategory.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
typedef JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Constructor & Destructor Documentation

◆ JMuonBundleCategory() [1/4]

JAANET::JMuonBundleCategory::JMuonBundleCategory ( )
inline

Default constructor.

Definition at line 86 of file JMuonBundleCategory.hh.

86  :
91  {}
static const JRange< int > DEFAULT_BUNDLE_MULTIPLICITY_RANGE
Default bundle multiplicity range [-].
static const JRange< double > DEFAULT_BUNDLE_ENERGY_RANGE
Default bundle energy range [GeV].
static const JRange< double > DEFAULT_BUNDLE_COSINE_ZENITH_ANGLE_RANGE
Default bundle cosine zenith angle range [-].
static const double DEFAULT_BUNDLE_RADIAL_EXTENT
Default bundle radial extent [m].
JRange< double > Erange
energy range [GeV]
JRange< double > coszRange
cosine zenith-angle range [-]
double Rmax
maximum radial extent [m]
JRange< int > Mrange
multiplicity range [-]

◆ JMuonBundleCategory() [2/4]

JAANET::JMuonBundleCategory::JMuonBundleCategory ( const int  primaryType)
inline

Constructor.

Parameters
primaryTypecosmic-ray primary PDG identifier

Definition at line 99 of file JMuonBundleCategory.hh.

99  :
104  {
105  this->primaryType = primaryType;
106 
107  check_validity();
108  }

◆ JMuonBundleCategory() [3/4]

JAANET::JMuonBundleCategory::JMuonBundleCategory ( const int  primaryType,
const JRange< double > &  Erange,
const JRange< double > &  coszRange,
const JRange< int > &  Mrange,
const double  Rmax 
)
inline

Constructor.

Parameters
primaryTypecosmic-ray primary PDG identifier
Erangeenergy range
coszRangecosine zenith-angle range
Mrangemultiplicity range
Rmaxmaximum radial extent

Definition at line 120 of file JMuonBundleCategory.hh.

124  :
125  Erange (Erange),
127  Mrange (Mrange),
128  Rmax (Rmax)
129  {
130  this->primaryType = primaryType;
131 
132  check_validity();
133  }

◆ JMuonBundleCategory() [4/4]

JAANET::JMuonBundleCategory::JMuonBundleCategory ( const JHead header)
inline

Constructor.

Parameters
headerMC header

Definition at line 141 of file JMuonBundleCategory.hh.

141  :
143  {
144  using namespace std;
145  using namespace JPP;
146 
147  if (is_mupage(header)) {
148  this->primaryType = PDG_MUONBUNDLE;
149  this->Erange = header.cut_in.E;
150  this->coszRange = header.cut_in.cosT;
151  } else if (is_corsika(header)) {
152  this->primaryType = header.primary.type;
153  this->Erange = header.cut_primary.E;
154  this->coszRange = header.cut_primary.cosT;
155  }
156 
157  check_validity();
158  }
JAANET::cut_in cut_in
Definition: JHead.hh:1595
JAANET::primary primary
Definition: JHead.hh:1611
JAANET::cut_primary cut_primary
Definition: JHead.hh:1593
bool is_corsika(const JHead &header)
Check for generator.
bool is_mupage(const JHead &header)
Check for generator.
Definition: JHeadToolkit.hh:85
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
JMuonBundleCategory()
Default constructor.
JRange_t cosT
Cosine zenith angle range
Definition: JHead.hh:420
JRange_t E
Energy range [GeV].
Definition: JHead.hh:419
int type
Particle type.
Definition: JHead.hh:1204
static const int PDG_MUONBUNDLE
muon bundle reached the can level (mupage)
Definition: trkmembers.hh:38

Member Function Documentation

◆ is_valid()

bool JAANET::JMuonBundleCategory::is_valid ( ) const
inlinefinaloverride

Check if muon bundle category is valid.

Returns
true if muon bundle category is valid; else false

Definition at line 166 of file JMuonBundleCategory.hh.

167  {
168  return (is_muon_bundle_primary(this->primaryType) &&
169  Erange .is_valid() &&
170  coszRange.is_valid() &&
171  Mrange.getLowerLimit() >= 0 &&
172  Mrange .is_valid() &&
173  Rmax > 0);
174  }
bool is_valid() const
Check validity of range.
Definition: JRange.hh:311
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
bool is_muon_bundle_primary(const int type)
Auxiliary function to check if given PDG code corresponds to a valid muon bundle primary type.
bool is_valid() const override final
Check if muon bundle category is valid.

◆ match() [1/2]

bool JAANET::JMuonBundleCategory::match ( const JHead header) const
inlinefinaloverride

Check whether this event category matches with the given MC header.

Parameters
headerheader
Returns
true if matching; else false

Definition at line 183 of file JMuonBundleCategory.hh.

184  {
185  if (is_mupage(header) || is_corsika(header)) {
186 
187  const JMuonBundleCategory cat(header);
188 
189  return (this->primaryType == cat.getPrimaryType() &&
190  this->Erange .overlap (cat.Erange) &&
191  this->coszRange.overlap (cat.coszRange));
192 
193  } else {
194 
195  return false;
196  }
197  }
Class for muon bundle categories.

◆ match() [2/2]

bool JAANET::JMuonBundleCategory::match ( const Evt event) const
inlinefinaloverride

Check whether given event matches with this event category.

Parameters
eventevent
Returns
true if matching; else false

Definition at line 206 of file JMuonBundleCategory.hh.

207  {
208  using namespace std;
209  using namespace JPP;
210 
211  const Trk& primary = get_primary(event);
212 
213  if (!(is_muonbundle(primary) || is_muon(primary)) ||
214  !Erange ( primary.E) ||
215  !coszRange(-primary.dir.z)) { return false; }
216 
218  Rmax == DEFAULT_BUNDLE_RADIAL_EXTENT) { return true; }
219 
220  const JTrack3E& tp = getTrack(primary);
221  const JDirection3D& dp = tp.getDirection();
222  const JPosition3D& pp = tp.getPosition();
223 
224  int multiplicity = 0;
225  double maxR = 0.0;
226 
227  for (vector<Trk>::const_iterator i = event.mc_trks.cbegin(); i != event.mc_trks.cend(); ++i) {
228  if (is_finalstate(*i) && is_muon(*i)) {
229 
230  const JTrack3E& ti = getTrack(*i);
231  const JPosition3D& pi = ti.getPosition();
232 
233  const double R = getCross<JVector3D>(dp, pi - pp).getLength();
234 
235  if (R > maxR) { maxR = R; }
236 
237  ++multiplicity;
238  }
239  }
240 
241  return (Mrange(multiplicity) && maxR < Rmax);
242  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:35
Data structure for position in three dimensions.
Definition: JPosition3D.hh:38
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
JVersor3D getDirection(const JVector3D &pos) const
Get photon direction of Cherenkov light on PMT.
Definition: JTrack3D.hh:147
3D track with energy.
Definition: JTrack3E.hh:32
double getLength() const
Get length.
Definition: JVector3D.hh:246
const Trk & get_primary(const Evt &evt)
Get primary.
JTrack3E getTrack(const Trk &track)
Get track.
bool is_muonbundle(const Trk &track)
Test whether given track is a (anti-)muon.
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition: Evt.hh:49
Primary particle.
Definition: JHead.hh:1174
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:15

◆ less()

bool JAANET::JMuonBundleCategory::less ( const JEvtCategory category) const
inlinefinaloverride

Less-than method.

Note: The energy, cosine zenith-angle and multiplicity ranges are compared based on the lower limit first.
If the lower limits are equal, the upper limits are compared.

Parameters
categoryevent category
Returns
true if first this event category less than given event category; else false

Definition at line 254 of file JMuonBundleCategory.hh.

255  {
256 #define RETURN_IF_DIFFERENT_RANGE(A, B) \
257  if (A != B) { return (A.getLowerLimit() == B.getLowerLimit() ? \
258  A.getUpperLimit() < B.getUpperLimit() : \
259  A.getLowerLimit() < B.getLowerLimit() ); }
260 
261  if (this->primaryType != category.getPrimaryType()) {
262  return this->primaryType < category.getPrimaryType();
263  }
264 
265  const JMuonBundleCategory* p = dynamic_cast<const JMuonBundleCategory*>(&category);
266 
267  if (p == NULL) { return false; }
268 
272 
273  return this->Rmax < p->Rmax;
274 
275 #undef RETURN_IF_DIFFERENT_RANGE
276  }
#define RETURN_IF_DIFFERENT_RANGE(A, B)
int getPrimaryType() const
Get primary PDG type of this event category.

◆ getProperties() [1/2]

JProperties JAANET::JMuonBundleCategory::getProperties ( const JEquationParameters equation = JEvtCategory::getEquationParameters())
inlinefinaloverride

Get properties of this class.

Parameters
equationequation parameters

Definition at line 284 of file JMuonBundleCategory.hh.

285  {
286  return JMuonBundleCategoryHelper(*this, equation);
287  }

◆ getProperties() [2/2]

JProperties JAANET::JMuonBundleCategory::getProperties ( const JEquationParameters equation = JEvtCategory::getEquationParameters()) const
inlinefinaloverride

Get properties of this class.

Parameters
equationequation parameters

Definition at line 295 of file JMuonBundleCategory.hh.

296  {
297  return JMuonBundleCategoryHelper(*this, equation);
298  }

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ Erange

JRange<double> JAANET::JMuonBundleCategory::Erange
private

energy range [GeV]

Definition at line 303 of file JMuonBundleCategory.hh.

◆ coszRange

JRange<double> JAANET::JMuonBundleCategory::coszRange
private

cosine zenith-angle range [-]

Definition at line 304 of file JMuonBundleCategory.hh.

◆ Mrange

JRange<int> JAANET::JMuonBundleCategory::Mrange
private

multiplicity range [-]

Definition at line 305 of file JMuonBundleCategory.hh.

◆ Rmax

double JAANET::JMuonBundleCategory::Rmax
private

maximum radial extent [m]

Definition at line 306 of file JMuonBundleCategory.hh.


The documentation for this struct was generated from the following file: