CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ThePEG::LesHouchesInterface Class Reference
Inheritance diagram for ThePEG::LesHouchesInterface:

Public Member Functions

 LesHouchesInterface ()
 
 ~LesHouchesInterface () override
 

Static Public Member Functions

static void Init ()
 

Protected Member Functions

IBPtr clone () const override
 
IBPtr fullclone () const override
 

Private Member Functions

void close () override
 
bool doReadEvent () override
 
virtual double eventWeight ()
 
double getEvent () override
 
void open () override
 
virtual double reweight ()
 
long scan () override
 

Private Attributes

bool initialized
 
LHEProxy::ProxyID proxyID
 

Static Private Attributes

static ClassDescription< LesHouchesInterfaceinitLesHouchesInterface
 

Detailed Description

Definition at line 30 of file ThePEGLesHouchesInterface.cc.

Constructor & Destructor Documentation

LesHouchesInterface::LesHouchesInterface ( )

Definition at line 76 of file ThePEGLesHouchesInterface.cc.

76  :
77  initialized(false)
78 {
79 }
LesHouchesInterface::~LesHouchesInterface ( )
override

Definition at line 81 of file ThePEGLesHouchesInterface.cc.

82 {
83 }

Member Function Documentation

IBPtr ThePEG::LesHouchesInterface::clone ( void  ) const
inlineoverrideprotected

Definition at line 38 of file ThePEGLesHouchesInterface.cc.

38 { return new_ptr(*this); }
void LesHouchesInterface::close ( void  )
overrideprivate
bool LesHouchesInterface::doReadEvent ( )
overrideprivate

Definition at line 148 of file ThePEGLesHouchesInterface.cc.

References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, popcon2dropbox::copy(), ntuple::fillEvent(), spr::find(), mps_fire::i, lhef::HEPEUP::ICOLUP, lhef::HEPEUP::IDPRUP, lhef::HEPEUP::IDUP, initLesHouchesInterface, lhef::HEPEUP::ISTUP, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, proxyID, lhef::HEPEUP::PUP, reset(), lhef::HEPEUP::SCALUP, lhef::HEPEUP::SPINUP, and lhef::HEPEUP::VTIMUP.

Referenced by getEvent().

149 {
150  reset();
151 
152  boost::shared_ptr<LHEEvent> event =
153  LHEProxy::find(proxyID)->releaseEvent();
154  if (!event)
155  throw Stop();
156 
157  hepeup.XPDWUP.first = hepeup.XPDWUP.second = 0;
158 
159  const lhef::HEPEUP &orig = *event->getHEPEUP();
160 
161  hepeup.NUP = orig.NUP;
162  hepeup.IDPRUP = orig.IDPRUP;
163  hepeup.SCALUP = orig.SCALUP;
164  hepeup.AQEDUP = orig.AQEDUP;
165  hepeup.AQCDUP = orig.AQCDUP;
166 
167  //workaround, since Herwig++ is not passing LHE weights to the hepmc product anyways
168  //as currently run in CMSSW
169  hepeup.XWGTUP = 1.0;
170 
171  hepeup.resize();
172 
173  std::copy(orig.IDUP.begin(), orig.IDUP.end(), hepeup.IDUP.begin());
174  hepeup.ISTUP = orig.ISTUP;
175  hepeup.MOTHUP = orig.MOTHUP;
176  hepeup.ICOLUP = orig.ICOLUP;
177  hepeup.VTIMUP = orig.VTIMUP;
178  hepeup.SPINUP = orig.SPINUP;
179 
180  for(int i = 0; i < hepeup.NUP; i++)
181  std::copy(&orig.PUP[i].x[0], &orig.PUP[i].x[5],
182  hepeup.PUP[i].begin());
183 
184  fillEvent();
185 
186  return true;
187 }
def fillEvent(tree, event)
Definition: ntuple.py:16
std::vector< double > VTIMUP
Definition: LesHouches.h:254
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:236
std::vector< FiveVector > PUP
Definition: LesHouches.h:248
std::vector< double > SPINUP
Definition: LesHouches.h:261
std::vector< int > ISTUP
Definition: LesHouches.h:230
std::vector< int > IDUP
Definition: LesHouches.h:225
double AQCDUP
Definition: LesHouches.h:220
double AQEDUP
Definition: LesHouches.h:215
void reset(double vett[256])
Definition: TPedValues.cc:11
std::vector< std::pair< int, int > > ICOLUP
Definition: LesHouches.h:242
Definition: event.py:1
double SCALUP
Definition: LesHouches.h:210
double LesHouchesInterface::eventWeight ( )
privatevirtual

Definition at line 116 of file ThePEGLesHouchesInterface.cc.

117 {
118  return 1.0;
119 }
IBPtr ThePEG::LesHouchesInterface::fullclone ( ) const
inlineoverrideprotected

Definition at line 39 of file ThePEGLesHouchesInterface.cc.

39 { return new_ptr(*this); }
double LesHouchesInterface::getEvent ( )
overrideprivate

Definition at line 129 of file ThePEGLesHouchesInterface.cc.

References doReadEvent(), Exception, ntuple::fillEvent(), initialized, and reset().

130 {
131  reset();
132 
133  if (!doReadEvent())
134  return 0.0;
135 
136  if (!initialized && !checkPartonBin())
137  throw cms::Exception("ThePEGLesHouchesInterface")
138  << "Found event which cannot be handled by "
139  << "the assigned PartonExtractor." << std::endl;
140  initialized = true;
141 
142  fillEvent();
143  getSubProcess();
144 
145  return 1.0;
146 }
def fillEvent(tree, event)
Definition: ntuple.py:16
void reset(double vett[256])
Definition: TPedValues.cc:11
void LesHouchesInterface::Init ( void  )
static

Definition at line 193 of file ThePEGLesHouchesInterface.cc.

References proxyID.

193  {
194  typedef LHEProxy::ProxyID ProxyID;
195 
196  static ClassDocumentation<LesHouchesInterface> documentation
197  ("ThePEG::LesHouchesInterface interfaces with LHEInterface");
198 
199  static Parameter<LesHouchesInterface, ProxyID> interfaceProxyID
200  ("ProxyID", "The ProxyID.",
201  &LesHouchesInterface::proxyID, ProxyID(),
202  ProxyID(), ProxyID(), false, false, false);
203 
204  interfaceProxyID.rank(11);
205 }
unsigned long ProxyID
Definition: LHEProxy.h:14
void LesHouchesInterface::open ( )
overrideprivate

Definition at line 90 of file ThePEGLesHouchesInterface.cc.

References lhef::HEPRUP::EBMUP, spr::find(), lhef::LHERunInfo::getHEPRUP(), lhef::HEPRUP::IDBMUP, lhef::HEPRUP::LPRUP, lhef::HEPRUP::NPRUP, lhef::HEPRUP::PDFGUP, lhef::HEPRUP::PDFSUP, proxyID, lhef::HEPRUP::XERRUP, lhef::HEPRUP::XMAXUP, and lhef::HEPRUP::XSECUP.

91 {
92  const LHERunInfo *runInfo = LHEProxy::find(proxyID)->getRunInfo().get();
93  const lhef::HEPRUP &orig = *runInfo->getHEPRUP();
94 
95  heprup.IDBMUP = orig.IDBMUP;
96  heprup.EBMUP = orig.EBMUP;
97  heprup.PDFGUP = orig.PDFGUP;
98  heprup.PDFSUP = orig.PDFSUP;
99  heprup.NPRUP = orig.NPRUP;
100  heprup.LPRUP = orig.LPRUP;
101  heprup.XSECUP = orig.XSECUP;
102  heprup.XERRUP = orig.XERRUP;
103  heprup.XMAXUP = orig.XMAXUP;
104 
105  // We are cheating here, ThePEG does not need to know the real
106  // weighting method, as it complains about anything but 3 anyway.
107  // We just need to trick ThePEG into just processing each event
108  // passed without doing anything fancy with it (and shut up).
109  heprup.IDWTUP = 1;
110 }
std::pair< double, double > EBMUP
Definition: LesHouches.h:78
std::pair< int, int > IDBMUP
Definition: LesHouches.h:73
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::pair< int, int > PDFGUP
Definition: LesHouches.h:84
std::vector< double > XERRUP
Definition: LesHouches.h:114
std::vector< double > XMAXUP
Definition: LesHouches.h:119
const HEPRUP * getHEPRUP() const
Definition: LHERunInfo.h:52
std::pair< int, int > PDFSUP
Definition: LesHouches.h:90
std::vector< double > XSECUP
Definition: LesHouches.h:108
std::vector< int > LPRUP
Definition: LesHouches.h:124
double LesHouchesInterface::reweight ( )
privatevirtual

Definition at line 122 of file ThePEGLesHouchesInterface.cc.

123 {
124  preweight = 1.0;
125  return 1.0;
126 }
long LesHouchesInterface::scan ( )
overrideprivate

Definition at line 85 of file ThePEGLesHouchesInterface.cc.

86 {
87  return 1000000000;
88 }

Member Data Documentation

bool ThePEG::LesHouchesInterface::initialized
private

Definition at line 52 of file ThePEGLesHouchesInterface.cc.

Referenced by getEvent().

ClassDescription< LesHouchesInterface > LesHouchesInterface::initLesHouchesInterface
staticprivate

Definition at line 54 of file ThePEGLesHouchesInterface.cc.

Referenced by doReadEvent().

LHEProxy::ProxyID ThePEG::LesHouchesInterface::proxyID
private

Definition at line 51 of file ThePEGLesHouchesInterface.cc.

Referenced by doReadEvent(), Init(), and open().