CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
virtual ~LesHouchesInterface ()
 

Static Public Member Functions

static void Init ()
 

Protected Member Functions

virtual IBPtr clone () const
 
virtual IBPtr fullclone () const
 

Private Member Functions

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

Private Attributes

bool initialized
 
LHEProxy::ProxyID proxyID
 

Static Private Attributes

static ClassDescription
< LesHouchesInterface
initLesHouchesInterface
 

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 ( )
virtual

Definition at line 81 of file ThePEGLesHouchesInterface.cc.

82 {
83 }

Member Function Documentation

virtual IBPtr ThePEG::LesHouchesInterface::clone ( void  ) const
inlineprotectedvirtual

Definition at line 38 of file ThePEGLesHouchesInterface.cc.

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

Definition at line 148 of file ThePEGLesHouchesInterface.cc.

References lhef::HEPEUP::AQCDUP, lhef::HEPEUP::AQEDUP, filterCSVwithJSON::copy, event(), spr::find(), i, lhef::HEPEUP::ICOLUP, lhef::HEPEUP::IDPRUP, lhef::HEPEUP::IDUP, 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 }
int i
Definition: DBlmapReader.cc:9
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:7
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
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
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
double SCALUP
Definition: LesHouches.h:210
double LesHouchesInterface::eventWeight ( )
privatevirtual

Definition at line 116 of file ThePEGLesHouchesInterface.cc.

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

Definition at line 39 of file ThePEGLesHouchesInterface.cc.

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

Definition at line 129 of file ThePEGLesHouchesInterface.cc.

References doReadEvent(), edm::hlt::Exception, 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 }
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 ( )
privatevirtual

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:7
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 ( )
privatevirtual

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.

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

Definition at line 51 of file ThePEGLesHouchesInterface.cc.

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