CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ProtonTransport Class Reference

#include <ProtonTransport.h>

Public Member Functions

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

Private Attributes

BaseProtonTransportinstance_
 

Detailed Description

Definition at line 12 of file ProtonTransport.h.

Constructor & Destructor Documentation

◆ ProtonTransport()

ProtonTransport::ProtonTransport ( const edm::ParameterSet iConfig)

Definition at line 11 of file ProtonTransport.cc.

11  : instance_(nullptr) {
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_ = new HectorTransport(iConfig);
18  } else if (transportMethod_ == "TOTEM") {
19  instance_ = new TotemTransport(iConfig);
20  } else if (transportMethod_ == "OPTICALFUNCTIONS") {
21  instance_ = new OpticalFunctionsTransport(iConfig);
22  } else {
23  throw cms::Exception("ProtonTransport")
24  << "Unknow transport method. Is must be either HECTOR, TOTEM or OPTICALFUNCTIONS (case insensitive)";
25  }
26 }

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

◆ ~ProtonTransport()

ProtonTransport::~ProtonTransport ( )
inline

Definition at line 15 of file ProtonTransport.h.

15  {
16  if (instance_)
17  delete instance_;
18  };

References instance_.

Member Function Documentation

◆ getCorrespondenceMap()

std::vector<LHCTransportLink>& ProtonTransport::getCorrespondenceMap ( )
inline

Definition at line 20 of file ProtonTransport.h.

20 { return instance_->getCorrespondenceMap(); }

References BaseProtonTransport::getCorrespondenceMap(), and instance_.

Referenced by PPSSimTrackProducer::produce().

◆ process()

void ProtonTransport::process ( const HepMC::GenEvent ev,
const edm::EventSetup es,
CLHEP::HepRandomEngine *  engine 
)
inline

Definition at line 21 of file ProtonTransport.h.

21  {
22  instance_->process(ev, es, engine);
23  instance_->addPartToHepMC(const_cast<HepMC::GenEvent*>(ev));
24  }

References BaseProtonTransport::addPartToHepMC(), ev, instance_, and BaseProtonTransport::process().

Referenced by PPSSimTrackProducer::produce().

Member Data Documentation

◆ instance_

BaseProtonTransport* ProtonTransport::instance_
private

Definition at line 27 of file ProtonTransport.h.

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

HectorTransport
Definition: HectorTransport.h:35
BaseProtonTransport::process
virtual void process(const HepMC::GenEvent *ev, const edm::EventSetup &es, CLHEP::HepRandomEngine *engine)=0
BaseProtonTransport::addPartToHepMC
void addPartToHepMC(HepMC::GenEvent *)
Definition: BaseProtonTransport.cc:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ProtonTransport::instance_
BaseProtonTransport * instance_
Definition: ProtonTransport.h:27
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
TotemTransport
Definition: TotemTransport.h:23
BaseProtonTransport::getCorrespondenceMap
std::vector< LHCTransportLink > & getCorrespondenceMap()
Definition: BaseProtonTransport.h:22
OpticalFunctionsTransport
Definition: OpticalFunctionsTransport.h:22