CMS 3D CMS Logo

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

#include <CosmicGenFilterLowE.h>

Inheritance diagram for CosmicGenFilterLowE:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CosmicGenFilterLowE (const edm::ParameterSet &conf)
 
bool filter (edm::Event &iEvent, edm::EventSetup const &c)
 
virtual ~CosmicGenFilterLowE ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

TRandom2 RanGen2
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 16 of file CosmicGenFilterLowE.h.

Constructor & Destructor Documentation

CosmicGenFilterLowE::CosmicGenFilterLowE ( const edm::ParameterSet conf)
explicit

Definition at line 15 of file CosmicGenFilterLowE.cc.

16 {
17 }
virtual CosmicGenFilterLowE::~CosmicGenFilterLowE ( )
inlinevirtual

Definition at line 19 of file CosmicGenFilterLowE.h.

19 {}

Member Function Documentation

bool CosmicGenFilterLowE::filter ( edm::Event iEvent,
edm::EventSetup const &  c 
)
virtual

Implements edm::EDFilter.

Definition at line 19 of file CosmicGenFilterLowE.cc.

References personalPlayback::fp, edm::Event::getByLabel(), i, funct::pow(), and diffTwoXMLs::r1.

20 {
21 
22 
24  iEvent.getByLabel("generator","unsmeared",HepMCEvt);
25  const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
26 
27  double Ene = 0;
28 
29  for(HepMC::GenEvent::particle_const_iterator i=MCEvt->particles_begin(); i != MCEvt->particles_end();++i)
30  {
31  Ene = (*i)->momentum().e();
32  }
33 
34  float r1;
35  double prob;
36  prob = RanGen2.Rndm();
37  r1 = float(prob);
38  float fpmax = 2372.;
39  float fp;
40  double ten = 10.0;
41  float fp3gev = 650.; //...needed for the renormalization;
42 
43 
44  if (Ene < 3) {
45 
46  fp = 90.*(1.48*((pow(Ene,-1.5))* pow(ten,(1.189+0.9604*log10(Ene)-1.114*log10(Ene)*log10(Ene) +0.1775*log10(Ene)*log10(Ene)*log10(Ene)))));
47  if (r1 < (fp/fpmax)) return true;
48  else return false;
49  }
50  else {
51  if ( r1 < (fp3gev/fpmax)) {
52  return true;
53  }
54  else return false;
55  }
56 }
int i
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

TRandom2 CosmicGenFilterLowE::RanGen2
private

Definition at line 24 of file CosmicGenFilterLowE.h.