Index: trunk/include/eXevent.h
===================================================================
--- trunk/include/eXevent.h (revision 16)
+++ trunk/include/eXevent.h (revision 17)
@@ -1,86 +1,86 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2017
//
// This file is part of estarlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 263 $: revision of last commit
// $Author:: mlomnitz $: author of last commit
// $Date:: 02/28/2017 #$: date of last commit
//
// Description:
//
// Container for eXEvents
//
//
///////////////////////////////////////////////////////////////////////////
#ifndef eXEVENT_H
#define eXEVENT_H
#include
#include "starlightconstants.h"
#include "starlightparticle.h"
class eXEvent
{
public:
eXEvent();
eXEvent(starlightConstants::event &ev);
~eXEvent();
void addParticle(starlightParticle &part) { _particles.push_back(part); }
void addVertex(vector3 &vertex) { _vertices.push_back(vertex); }
void addGamma(lorentzVector gamma,float egamma, float Q2) { _gamma.push_back(gamma); _gammaEnergies.push_back(egamma); _gammaMasses.push_back(Q2); }
void addSourceElectron(lorentzVector &el){ _sources.push_back(el); }
void addScatteredTarget( lorentzVector &target, double t){ _target.push_back(target); _vertext.push_back(t);}
const std::vector * getParticles() const { return &_particles; }
const std::vector * getVertices() const { return &_vertices; }
const std::vector * getGammaEnergies() const { return &_gammaEnergies; }
const std::vector * getSources() const { return &_sources;}
const std::vector * getGammaMasses() const {return &_gammaMasses; }
const std::vector * getGamma() const { return &_gamma; }
const std::vector * getTarget() const{ return &_target; }
const std::vector * getVertext() const{ return &_vertext; }
eXEvent & operator=(const eXEvent&);
eXEvent & operator+(const eXEvent&);
void boost(double rapidity, double e_rapiditya);
- void flipZ();
+ void reflect();
private:
std::vector _particles;
std::vector _vertices;
std::vector _sources;
std::vector _target;
std::vector _vertext;
std::vector _gammaMasses;
std::vector _gammaEnergies;
std::vector _gamma;
};
#endif // UPCEVENT_H
Index: trunk/include/e_starlightStandalone.h
===================================================================
--- trunk/include/e_starlightStandalone.h (revision 16)
+++ trunk/include/e_starlightStandalone.h (revision 17)
@@ -1,81 +1,81 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 263 $: revision of last commit
// $Author:: butter $: author of last commit
// $Date:: 2016-06-04 23:03:58 +0100 #$: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#ifndef E_STARLIGHTSTANDALONE_H
#define E_STARLIGHTSTANDALONE_H
#include
class upcEvent;
class e_starlight;
class inputParameters;
class e_starlightStandalone {
public:
e_starlightStandalone();
~e_starlightStandalone();
bool init(); ///< reads configuration file and initializes startlight
bool run (); ///< creates output file and runs starlight
const std::string& baseFileName () const { return _baseFileName; }
const std::string& configFileName () const { return _configFileName; } ///< returns path to config file
const std::string& eventDataFileName() const { return _eventDataFileName; } ///< returns path to output file
void setBaseFileName (const std::string& baseFileName ) { _baseFileName = baseFileName; } ///< sets path to base file
void setConfigFileName (const std::string& configFileName ) { _configFileName = configFileName; } ///< sets path to config file
void setEventDataFileName(const std::string& eventDataFileName) { _eventDataFileName = eventDataFileName; } ///< sets path to output file
void boostEvent(eXEvent &e); ///< Boost event from beam CMS to lab system
- void flipZEvent(eXEvent &e); ///< flip z to -z for all output particles
+ void reflectEvent(eXEvent &e); ///< flip z to -z for all output particles
private:
std::string _baseFileName; ///< path to base filename
std::string _configFileName; ///< path to configuration file
std::string _eventDataFileName; ///< path to output file
e_starlight* _starlight; ///< pointer to starlight instance
inputParameters* _inputParameters; ///< pointer to parameter instance
unsigned int _nmbEventsTot; ///< total number of events to generate (taken from configuration file)
unsigned int _nmbEventsPerFile; ///< maximum number of events written to a single file (not yet implemented)
};
#endif // E_STARLIGHTSTANDALONE_H
Index: trunk/include/lorentzvector.h
===================================================================
--- trunk/include/lorentzvector.h (revision 16)
+++ trunk/include/lorentzvector.h (revision 17)
@@ -1,109 +1,110 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 213 $: revision of last commit
// $Author:: butter $: author of last commit
// $Date:: 2015-08-15 22:08:02 +0100 #$: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#ifndef LORENTZVECTOR_H
#define LORENTZVECTOR_H
#include "vector3.h"
#include
class lorentzVector
{
public:
lorentzVector();
virtual ~lorentzVector();
lorentzVector(double x, double y, double z, double t);
void SetXYZT(double x, double y, double z, double t);
void SetPxPyPzE(double px, double py, double pz, double e) { SetXYZT(px, py, pz, e); };
double GetPx() const { return fSpaceVec.GetVector()[0]; }
double GetPy() const { return fSpaceVec.GetVector()[1]; }
double GetPz() const { return fSpaceVec.GetVector()[2]; }
double GetE() const { return fTime; }
-
+ virtual void reflect(){fSpaceVec.SetVector(-1.0*fSpaceVec.X(),-1.0*fSpaceVec.Y(),-1.0*fSpaceVec.Z());};
+
lorentzVector& operator +=(const lorentzVector& vec)
{
fSpaceVec += vec.fSpaceVec;
fTime += vec.fTime;
return *this;
}
lorentzVector& operator -=(const lorentzVector& vec)
{
fSpaceVec -= vec.fSpaceVec;
fTime -= vec.fTime;
return *this;
}
double M2() const { return fTime * fTime - fSpaceVec.Mag2(); }
double M () const
{
const double mag2 = M2();
return (mag2 < 0) ? -sqrt(-mag2) : sqrt(mag2);
}
vector3 BoostVector() const
{ return vector3(fSpaceVec.X() / fTime, fSpaceVec.Y() / fTime, fSpaceVec.Z() / fTime); }
void Boost(const vector3& beta)
{
const double beta2 = beta.Mag2();
const double gamma = 1 / sqrt(1 - beta2);
const double betaTimesMom = beta.X() * fSpaceVec.X() + beta.Y() * fSpaceVec.Y() + beta.Z() * fSpaceVec.Z();
const double gamma2 = (beta2 > 0) ? (gamma - 1) / beta2 : 0;
SetXYZT(fSpaceVec.X() + gamma2 * betaTimesMom * beta.X() + gamma * beta.X() * fTime,
fSpaceVec.Y() + gamma2 * betaTimesMom * beta.Y() + gamma * beta.Y() * fTime,
fSpaceVec.Z() + gamma2 * betaTimesMom * beta.Z() + gamma * beta.Z() * fTime,
gamma * (fTime + betaTimesMom));
}
friend std::ostream& operator << (std::ostream& out,
const lorentzVector& vec)
{
out << "(" << vec.GetPx() << ", " << vec.GetPy() << ", " << vec.GetPz()
<< "; " << vec.GetE() << ")";
return out;
}
private:
vector3 fSpaceVec;
double fTime;
};
#endif // LORENTZVECTOR_H
Index: trunk/include/starlightparticle.h
===================================================================
--- trunk/include/starlightparticle.h (revision 16)
+++ trunk/include/starlightparticle.h (revision 17)
@@ -1,95 +1,102 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 263 $: revision of last commit
// $Author:: butter $: author of last commit
// $Date:: 2016-06-04 23:03:58 +0100 #$: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#ifndef STARLIGHTPARTICLE_H
#define STARLIGHTPARTICLE_H
#include "lorentzvector.h"
class starlightParticle : public lorentzVector
{
public:
starlightParticle();
starlightParticle ( double px, double py, double pz, double e, double mass, int pdgCode, short charge,
double vx = 0., double vy = 0, double vz = 0, double vt = 0,
int firstParent = 0, int lastParent = 0, int firstDaughter = 0, int lastDaughter = 0, int status = 0);
virtual ~starlightParticle();
void setPdgCode(int pdgCode) { _pdgCode = pdgCode; }
int getPdgCode() const { return _pdgCode; }
void setCharge(short charge) { _charge = charge; }
short getCharge() const { return _charge; }
void setMass(short mass) { _mass = mass; }
short getMass() const { return _mass; }
void setFirstParent(int parent) { _firstParent = parent; }
void setLastParent(int parent) { _lastParent = parent; }
int getFirstParent() const { return _firstParent; }
int getLastParent() const { return _lastParent; }
void setFirstDaughter(int first) { _firstDaughter = first; }
int getFirstDaughter() const { return _firstDaughter; }
void setLastDaughter(int first) { _lastDaughter = first; }
int getLastDaughter() const { return _lastDaughter; }
void setStatus(int status) { _status = status; }
int getStatus() const { return _status; }
void setVertex(lorentzVector v) { _vertex = v; }
lorentzVector getVertex() const { return _vertex; }
+
+ void reflect()
+ {
+ this->SetXYZT(-1.0*this->GetPx(),-1.0*this->GetPy(),-1.0*this->GetPz(),this->GetE());
+ _vertex.reflect();
+ };
+
private:
lorentzVector _vertex;
int _pdgCode;
short _charge;
double _mass;
int _firstParent;
int _lastParent;
int _firstDaughter;
int _lastDaughter;
int _status;
};
#endif // STARLIGHTPARTICLE_H
Index: trunk/src/hepmc3writer.cpp
===================================================================
--- trunk/src/hepmc3writer.cpp (revision 16)
+++ trunk/src/hepmc3writer.cpp (revision 17)
@@ -1,73 +1,83 @@
#include "HepMC3/GenVertex.h"
#include "HepMC3/GenVertex_fwd.h"
#include "HepMC3/FourVector.h"
#include "HepMC3/GenEvent.h"
#include "HepMC3/GenParticle.h"
#include "HepMC3/WriterAscii.h"
#include "HepMC3/Print.h"
#include "inputParameters.h"
#include "eXevent.h"
#include "hepmc3writer.h"
using HepMC3::FourVector;
using HepMC3::Print;
hepMC3Writer::hepMC3Writer()
{
}
int hepMC3Writer::initWriter(const inputParameters ¶m)
{
std::string hepmc3_filename = param.baseFileName() + ".hepmc";
/** need to pass the parameters to HepMC3 **/
param.beam1Z(); //just do something for now
_hepmc3_output = new HepMC3::WriterAscii(hepmc3_filename);
return 0;
}
int hepMC3Writer::writeEvent(const eXEvent &event, int eventnumber)
{
/** Make HepMC3 Event and Vertex ... Currently only 1 Vertex per Event **/
HepMC3::GenEvent hepmc3_evt(HepMC3::Units::GEV , HepMC3::Units::MM);
HepMC3::GenVertexPtr hepmc3_vertex_to_write = std::make_shared(FourVector(0,0,0,0));
/** Get starlight particle vector **/
const std::vector * particle_vector = event.getParticles();
lorentzVector gamma_lorentzVec = (*event.getGamma())[0];
FourVector hepmc3_gamma_four_vector = FourVector(gamma_lorentzVec.GetPx(),
gamma_lorentzVec.GetPy(),
gamma_lorentzVec.GetPz(),
gamma_lorentzVec.GetE());
HepMC3::GenParticlePtr hepmc3_gamma = std::make_shared( hepmc3_gamma_four_vector, 22, 0 ); // status currently set to 0... need to double check
hepmc3_vertex_to_write->add_particle_in( hepmc3_gamma );
/** Takes e_starlight events and converts to hepmc3 format **/
for ( std::vector::const_iterator particle_iter = (*particle_vector).begin();
particle_iter != (*particle_vector).end();
++particle_iter)
{
int hepmc3_pid = (*particle_iter).getPdgCode();
/** pass to HepMC3 FourVector **/
FourVector hepmc3_four_vector = FourVector( (*particle_iter).GetPx(),
(*particle_iter).GetPy(),
(*particle_iter).GetPz(),
(*particle_iter).GetE());
HepMC3::GenParticlePtr hepmc3_particle = std::make_shared( hepmc3_four_vector, hepmc3_pid, 0 ); // status currently set to 0... need to double check
hepmc3_vertex_to_write->add_particle_out( hepmc3_particle );
}
+ lorentzVector electron_lorentzVec = (*event.getSources())[0];
+ FourVector hepmc3_electron_four_vector = FourVector(electron_lorentzVec.GetPx(),
+ electron_lorentzVec.GetPy(),
+ electron_lorentzVec.GetPz(),
+ electron_lorentzVec.GetE());
+
+ HepMC3::GenParticlePtr hepmc3_electron = std::make_shared( hepmc3_electron_four_vector, 11, 0 ); // status currently set to 0... need to double check
+
+ hepmc3_vertex_to_write->add_particle_out( hepmc3_electron );
+
/** add vertex to HepMC3 Event**/
hepmc3_evt.add_vertex( hepmc3_vertex_to_write );
_hepmc3_output->write_event(hepmc3_evt);
// Print::listing(hepmc3_evt);
// Print::content(hepmc3_evt);
hepmc3_evt.clear();
return eventnumber;
}
Index: trunk/src/eXevent.cpp
===================================================================
--- trunk/src/eXevent.cpp (revision 16)
+++ trunk/src/eXevent.cpp (revision 17)
@@ -1,141 +1,148 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright 2017
//
// This file is part of estarlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 263 $: revision of last commit
// $Author:: mlomnitz $: author of last commit
// $Date:: 02/28/2017 #$: date of last commit
//
// Description:
//
// Container for eX eventrs
//
//
///////////////////////////////////////////////////////////////////////////
#include "eXevent.h"
eXEvent::eXEvent() :
_particles(0)
,_vertices(0)
{ }
eXEvent::eXEvent(starlightConstants::event &ev) :
_particles(0)
,_vertices(0)
{
for(int i = 0; i < ev._numberOfTracks; i++)
{
starlightParticle p(
ev.px[i],
ev.py[i],
ev.pz[i],
starlightConstants::UNKNOWN,
starlightConstants::UNKNOWN,
ev._fsParticle[i],
ev._charge[i]
);
addParticle(p);
}
}
eXEvent::~eXEvent()
{ }
eXEvent& eXEvent::operator=(const eXEvent& rhs)
{
if(this != &rhs)
{
this->_particles = rhs._particles;
this->_vertices = rhs._vertices;
this->_gammaEnergies = rhs._gammaEnergies;
this->_sources = rhs._sources;
this->_target = rhs._target;
this->_vertext = rhs._vertext;
}
return *this;
}
eXEvent& eXEvent::operator+(const eXEvent& ev)
{
for(unsigned int n = 0; n < ev._particles.size(); n++)
{
this->_particles.push_back(ev._particles.at(n));
}
for(unsigned int n = 0; n < ev._vertices.size(); n++)
{
this->_vertices.push_back(ev._vertices.at(n));
}
for(unsigned int n = 0; n < ev._gammaEnergies.size(); n++)
{
this->_gammaEnergies.push_back(ev._gammaEnergies.at(n));
}
for(unsigned int n = 0; n_sources.push_back(ev._sources.at(n));
}
for(unsigned int n = 0; n_target.push_back(ev._target.at(n));
}
for(unsigned int n = 0; n_vertext.push_back(ev._vertext.at(n));
}
return *this;
}
void eXEvent::boost(double rapidity, double e_rapidity)
{
vector3 boostVector(0, 0, tanh(rapidity));
vector3 electron_boostVector(0, 0, tanh(e_rapidity));
//
std::vector::iterator part = _particles.begin();
for (part = _particles.begin(); part != _particles.end(); part++)
{
(*part).Boost(boostVector);
}
std::vector::iterator ele = _sources.begin();
for( ele = _sources.begin(); ele != _sources.end(); ++ele){
(*ele).Boost(electron_boostVector);
}
std::vector::iterator target = _target.begin();
for( target = _target.begin(); target != _target.end(); ++target){
(*target).Boost(boostVector);
}
}
-void eXEvent::flipZ()
+void eXEvent::reflect()
{
-
- std::vector::iterator part = _particles.begin();
-
- for (part = _particles.begin(); part != _particles.end(); part++)
- {
- lorentzVector v = (*part).getVertex();
- (*part).SetXYZT( -1.0*(*part).GetPx(), -1.0*(*part).GetPy() , -1.0*(*part).GetPz() ,(*part).GetE() );
- (*part).setVertex( lorentzVector(-1.0*v.GetPx(),-1.0*v.GetPy(),-1.0*v.GetPz(),v.GetE()) );
-
- }
-
+ //Flip decay leptons
+ std::vector::iterator part = _particles.begin();
+
+ for (part = _particles.begin(); part != _particles.end(); part++)
+ {
+ lorentzVector v = (*part).getVertex();
+ (*part).reflect();
+ }
+
+ //Flip gamma
+ _gamma[0].reflect();
+
+ //Flip outgoing electron
+ _sources[0].reflect();
+
+ //Flip target
+ _target[0].reflect();
+
}
Index: trunk/src/e_starlightStandalone.cpp
===================================================================
--- trunk/src/e_starlightStandalone.cpp (revision 16)
+++ trunk/src/e_starlightStandalone.cpp (revision 17)
@@ -1,188 +1,188 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright 2010
//
// This file is part of starlight.
//
// starlight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// starlight is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with starlight. If not, see .
//
///////////////////////////////////////////////////////////////////////////
//
// File and Version Information:
// $Rev:: 270 $: revision of last commit
// $Author:: jnystrand $: author of last commit
// $Date:: 2016-07-08 16:31:51 +0100 #$: date of last commit
//
// Description:
//
//
//
///////////////////////////////////////////////////////////////////////////
#include
#include
#include "reportingUtils.h"
#include "e_starlight.h"
#include "inputParameters.h"
#include "eventfilewriter.h"
#include "e_starlightStandalone.h"
using namespace std;
e_starlightStandalone::e_starlightStandalone()
: _configFileName ("slight.in"),
_starlight (0),
_nmbEventsTot (1),
_nmbEventsPerFile (_nmbEventsTot)
{ }
e_starlightStandalone::~e_starlightStandalone()
{ }
bool
e_starlightStandalone::init()
{
_inputParameters = new inputParameters();
// read input parameters from config file
_inputParameters->configureFromFile(_configFileName);
if (!_inputParameters->init()) {
printWarn << "problems initializing input parameters. cannot initialize starlight." << endl;
return false;
}
// copy input file to one with baseFileName naming scheme
std::string inputCopyName, _baseFileName;
_baseFileName = _inputParameters->baseFileName();
if (_baseFileName != "slight") {
inputCopyName = _baseFileName +".in";
ofstream inputCopyFile;
inputCopyFile.open(inputCopyName.c_str());
std::ifstream infile(_configFileName.c_str());
if ((!infile) || (!infile.good()))
{
return -1;
}
int lineSize = 256;
char tmp[lineSize];
while (!infile.getline(tmp, lineSize).eof())
{
cout << tmp << endl;
inputCopyFile << tmp << endl;
}
inputCopyFile.close();
}
// get the number of events
// for now we write everything to one file
_nmbEventsTot = _inputParameters->nmbEvents();
_nmbEventsPerFile = _nmbEventsTot;
// create the starlight object
_starlight = new e_starlight();
// give starlight the input parameters
_starlight->setInputParameters(_inputParameters);
// initialize starlight
return _starlight->init();
}
bool
e_starlightStandalone::run()
{
if (!_starlight) {
printWarn << "null pointer to starlight object. make sure that init() was called. "
<< "cannot generate events." << endl;
return false;
}
// open output file
eventFileWriter fileWriter;
fileWriter.writeFullPythiaInfo(_inputParameters->pythiaFullEventRecord());
fileWriter.writeFullHepMC3Info(_inputParameters->hepmc3FullEventRecord());
_baseFileName = _inputParameters->baseFileName();
_eventDataFileName = _baseFileName +".out";
fileWriter.open(_eventDataFileName);
//
fileWriter.writeInit(*_inputParameters);
//
printInfo << "generating events:" << endl;
unsigned int nmbEvents = 0;
std::chrono::steady_clock::time_point begin= std::chrono::steady_clock::now();
while (nmbEvents < _nmbEventsTot) {
for (unsigned int iEvent = 0; (iEvent < _nmbEventsPerFile) && (nmbEvents < _nmbEventsTot);
++iEvent, ++nmbEvents) {
progressIndicator(iEvent, _nmbEventsTot, true, 4);
eXEvent event = _starlight->produceEvent();
// Boost event from back to lab reference frame
boostEvent(event);
- flipZEvent(event);
+ reflectEvent(event);
fileWriter.writeEvent(event, iEvent);
}
}
std::chrono::steady_clock::time_point end= std::chrono::steady_clock::now();
float running_total = 1E-3*std::chrono::duration_cast(end - begin).count();
cout<<"Total time "<nmbAttempts() == 0 )return true;
double _branchingRatio = _inputParameters->inputBranchingRatio();
printInfo << "number of attempts = " << _starlight->nmbAttempts() << ", "
<< "number of accepted events = " << _starlight->nmbAccepted() << endl;
double selectedCrossSection =
((double)_starlight->nmbAccepted()/_starlight->nmbAttempts())*_branchingRatio*_starlight->getTotalCrossSection();
if (selectedCrossSection > 1.){
cout<< " The cross section of the generated sample is "< 1.){
cout<< " The cross section of the generated sample is "<<1.E3*selectedCrossSection<<" mb."< 1.){
cout<< " The cross section of the generated sample is "<<1.E6*selectedCrossSection<<" microbarn."< 1.){
cout<< " The cross section of the generated sample is "<<1.E9*selectedCrossSection<<" nanobarn."< 1.){
cout<< " The cross section of the generated sample is "<<1.E12*selectedCrossSection<<" picobarn."<beam1LorentzGamma());
double rap2 = -acosh(_inputParameters->beam2LorentzGamma());
double boost = (rap1+rap2)/2.;
event.boost(boost, rap2); // Boost back to laboratory reference frame. Electron initially in target frame and V.M. in CMS
// Assuming electron is beam1
}
-void e_starlightStandalone::flipZEvent(eXEvent &event)
+void e_starlightStandalone::reflectEvent(eXEvent &event)
{
- event.flipZ(); //Change all z to -z
+ event.reflect(); //Change all z to -z
}