ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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 12 of file CosmicEventParser.h.

Constructor & Destructor Documentation

◆ CosmicEventParser()

CosmicEventParser::CosmicEventParser ( )
inline

Definition at line 14 of file CosmicEventParser.h.

14 : m_eventNumber(0), m_pdgId(0) {};

Member Function Documentation

◆ Momentum()

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

Definition at line 16 of file CosmicEventParser.h.

16 {return m_momentum;}

◆ pdgID()

int CosmicEventParser::pdgID ( void  )
inline

Definition at line 17 of file CosmicEventParser.h.

17 {return m_pdgId;}

◆ read()

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

Definition at line 39 of file CosmicEventParser.h.

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

◆ Vertex()

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

Definition at line 15 of file CosmicEventParser.h.

15 {return m_vertex;}

◆ write()

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

Definition at line 76 of file CosmicEventParser.h.

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

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 34 of file CosmicEventParser.h.

34  {
35  return ev.write(os);
36 }

◆ operator>>

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

Definition at line 30 of file CosmicEventParser.h.

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

Member Data Documentation

◆ m_eventNumber

int CosmicEventParser::m_eventNumber
private

Definition at line 21 of file CosmicEventParser.h.

◆ m_momentum

CLHEP::HepLorentzVector CosmicEventParser::m_momentum
private

Definition at line 20 of file CosmicEventParser.h.

◆ m_pdgId

int CosmicEventParser::m_pdgId
private

Definition at line 22 of file CosmicEventParser.h.

◆ m_vertex

CLHEP::HepLorentzVector CosmicEventParser::m_vertex
private

Definition at line 19 of file CosmicEventParser.h.


The documentation for this class was generated from the following file:
CosmicEventParser::m_vertex
CLHEP::HepLorentzVector m_vertex
Definition: CosmicEventParser.h:19
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ev
int ev
Definition: globals.cxx:25
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
CosmicEventParser::m_eventNumber
int m_eventNumber
Definition: CosmicEventParser.h:21
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
CosmicEventParser::m_momentum
CLHEP::HepLorentzVector m_momentum
Definition: CosmicEventParser.h:20
CosmicEventParser::m_pdgId
int m_pdgId
Definition: CosmicEventParser.h:22
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15