CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ProtonTransport Class Reference

#include <ProtonTransport.h>

Public Member Functions

void addPartToHepMC (const HepMC::GenEvent *iev, HepMC::GenEvent *ev)
 
std::vector< LHCTransportLink > & getCorrespondenceMap ()
 
void process (const HepMC::GenEvent *ev, const edm::EventSetup &es, CLHEP::HepRandomEngine *engine)
 
 ProtonTransport (const edm::ParameterSet &iConfig, edm::ConsumesCollector iC)
 
 ~ProtonTransport ()=default
 

Private Attributes

std::unique_ptr
< BaseProtonTransport
instance_
 

Detailed Description

Definition at line 14 of file ProtonTransport.h.

Constructor & Destructor Documentation

ProtonTransport::ProtonTransport ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  iC 
)

Definition at line 11 of file ProtonTransport.cc.

References c, Exception, edm::ParameterSet::getParameter(), iConfig, instance_, and AlCaHLTBitMon_QueryRunRegistry::string.

11  {
12  std::string transportMethod_ = iConfig.getParameter<std::string>("TransportMethod");
13  for (auto &c : transportMethod_)
14  c = toupper(c); // just to on the safe side
15 
16  if (transportMethod_ == "HECTOR") {
17  instance_ = std::make_unique<HectorTransport>(iConfig, iC);
18  } else if (transportMethod_ == "TOTEM") {
19  instance_ = std::make_unique<TotemTransport>(iConfig);
20  } else if (transportMethod_ == "OPTICALFUNCTIONS") {
21  instance_ = std::make_unique<OpticalFunctionsTransport>(iConfig, iC);
22  } else {
23  throw cms::Exception("ProtonTransport")
24  << "Unknow transport method. Is must be either HECTOR, TOTEM or OPTICALFUNCTIONS (case insensitive)";
25  }
26 }
const edm::EventSetup & c
std::unique_ptr< BaseProtonTransport > instance_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ProtonTransport::~ProtonTransport ( )
default

Member Function Documentation

void ProtonTransport::addPartToHepMC ( const HepMC::GenEvent iev,
HepMC::GenEvent ev 
)
inline

Definition at line 23 of file ProtonTransport.h.

References instance_.

Referenced by PPSSimTrackProducer::produce().

23 { instance_->addPartToHepMC(iev, ev); }
std::unique_ptr< BaseProtonTransport > instance_
std::vector<LHCTransportLink>& ProtonTransport::getCorrespondenceMap ( )
inline

Definition at line 19 of file ProtonTransport.h.

References instance_.

Referenced by PPSSimTrackProducer::produce().

19 { return instance_->getCorrespondenceMap(); }
std::unique_ptr< BaseProtonTransport > instance_
void ProtonTransport::process ( const HepMC::GenEvent ev,
const edm::EventSetup es,
CLHEP::HepRandomEngine *  engine 
)
inline

Definition at line 20 of file ProtonTransport.h.

References instance_.

Referenced by PPSSimTrackProducer::produce().

20  {
21  instance_->process(ev, es, engine);
22  }
std::unique_ptr< BaseProtonTransport > instance_

Member Data Documentation

std::unique_ptr<BaseProtonTransport> ProtonTransport::instance_
private

Definition at line 26 of file ProtonTransport.h.

Referenced by addPartToHepMC(), getCorrespondenceMap(), process(), and ProtonTransport().