ATLAS Offline Software
Loading...
Searching...
No Matches
CosmicEventParser Class Reference

#include <CosmicEventParser.h>

Collaboration diagram for CosmicEventParser:

Public Member Functions

 CosmicEventParser ()
const CLHEP::HepLorentzVector & Vertex (void)
const CLHEP::HepLorentzVector & Momentum (void)
int pdgID (void)

Private Member Functions

std::istream & read (std::istream &is)
std::ostream & write (std::ostream &os) const

Private Attributes

CLHEP::HepLorentzVector m_vertex
CLHEP::HepLorentzVector m_momentum
int m_eventNumber
int m_pdgId

Friends

std::istream & operator>> (std::istream &is, CosmicEventParser &ev)
std::ostream & operator<< (std::ostream &os, const CosmicEventParser &ev)

Detailed Description

Definition at line 13 of file CosmicEventParser.h.

Constructor & Destructor Documentation

◆ CosmicEventParser()

CosmicEventParser::CosmicEventParser ( )
inline

Definition at line 15 of file CosmicEventParser.h.

Member Function Documentation

◆ Momentum()

const CLHEP::HepLorentzVector & CosmicEventParser::Momentum ( void )
inline

Definition at line 17 of file CosmicEventParser.h.

17{return m_momentum;}
CLHEP::HepLorentzVector m_momentum

◆ pdgID()

int CosmicEventParser::pdgID ( void )
inline

Definition at line 18 of file CosmicEventParser.h.

18{return m_pdgId;}

◆ read()

std::istream & CosmicEventParser::read ( std::istream & is)
inlineprivate

Definition at line 40 of file CosmicEventParser.h.

41{
42 int dummy;
43 int id;
44 CLHEP::Hep3Vector vert,mom;
45 double v_x,v_y,v_z;
46 is >> m_eventNumber >> dummy >> id >> v_x >> v_y >> v_z >> mom;
47
48 //
49 // rotate over pi in x-z plane
50 //
51 vert.setX(-v_x);
52 vert.setY( v_y);
53 vert.setZ(-v_z);
54
55 //
56 // convert to MeV's and mm units
57 //
58 mom = 1000*mom;
59 vert = 10*vert;
60
61
62 m_vertex.setVect(vert);
63 m_vertex.setE(0.);
64
65
66 m_momentum.setVect(mom);
67 double energy = sqrt(pow(ParticleConstants::muonMassInMeV,2)+mom.mag2());
68 m_momentum.setE(energy);
69
70 if(id == 5) m_pdgId = 13;
71 else m_pdgId = -13;
72
73 return is;
74}
constexpr int pow(int base, int exp) noexcept
CLHEP::HepLorentzVector m_vertex
constexpr double muonMassInMeV
the mass of the muon (in MeV)

◆ Vertex()

const CLHEP::HepLorentzVector & CosmicEventParser::Vertex ( void )
inline

Definition at line 16 of file CosmicEventParser.h.

16{return m_vertex;}

◆ write()

std::ostream & CosmicEventParser::write ( std::ostream & os) const
inlineprivate

Definition at line 77 of file CosmicEventParser.h.

78{
79 int dummy(1);
80 int id(5);
81 if(m_pdgId == -13) id = 6;
82 os << m_eventNumber << " " << dummy << " " << id << " "
83 << m_vertex.x() << " " << m_vertex.y() << " " << m_vertex.z() << " "
84 << m_momentum.x() << " " << m_momentum.y() << " " << m_momentum.z();
85
86 return os;
87}

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const CosmicEventParser & ev )
friend

Definition at line 35 of file CosmicEventParser.h.

35 {
36 return ev.write(os);
37}
int ev
Definition globals.cxx:25

◆ operator>>

std::istream & operator>> ( std::istream & is,
CosmicEventParser & ev )
friend

Definition at line 31 of file CosmicEventParser.h.

31 {
32 return ev.read(is);
33}

Member Data Documentation

◆ m_eventNumber

int CosmicEventParser::m_eventNumber
private

Definition at line 22 of file CosmicEventParser.h.

◆ m_momentum

CLHEP::HepLorentzVector CosmicEventParser::m_momentum
private

Definition at line 21 of file CosmicEventParser.h.

◆ m_pdgId

int CosmicEventParser::m_pdgId
private

Definition at line 23 of file CosmicEventParser.h.

◆ m_vertex

CLHEP::HepLorentzVector CosmicEventParser::m_vertex
private

Definition at line 20 of file CosmicEventParser.h.


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