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
MCLongLivedParticles Class Reference

#include <MCLongLivedParticles.h>

Inheritance diagram for MCLongLivedParticles:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 MCLongLivedParticles (const edm::ParameterSet &)
 
 ~MCLongLivedParticles ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

float theCut
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 40 of file MCLongLivedParticles.h.

Constructor & Destructor Documentation

MCLongLivedParticles::MCLongLivedParticles ( const edm::ParameterSet iConfig)
explicit

Definition at line 11 of file MCLongLivedParticles.cc.

References edm::ParameterSet::getUntrackedParameter().

12 {
13  //here do whatever other initialization is needed
14  theCut = iConfig.getUntrackedParameter<double>("LengCut",10.);
15 }
T getUntrackedParameter(std::string const &, T const &) const
MCLongLivedParticles::~MCLongLivedParticles ( )

Definition at line 18 of file MCLongLivedParticles.cc.

19 {
20 
21  // do anything here that needs to be done at desctruction time
22  // (e.g. close files, deallocate resources etc.)
23 
24 }

Member Function Documentation

bool MCLongLivedParticles::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 28 of file MCLongLivedParticles.cc.

References edm::Event::getByType(), AlCaHLTBitMon_ParallelJobs::p, position, and mathSSE::sqrt().

29 {
30 
31  using namespace edm;
32 
34 
35  iEvent.getByType(evt);
36 
37  bool pass = false;
38 
39  const HepMC::GenEvent * generated_event = evt->GetEvent();
40  HepMC::GenEvent::particle_const_iterator p;
41 
42  for (p = generated_event->particles_begin(); p != generated_event->particles_end(); p++)
43  {
44 
45  if((*p)->production_vertex()!=0&&(*p)->end_vertex()!=0)
46  {
47  float dist = sqrt((((*p)->production_vertex())->position().x()-((*p)->end_vertex())->position().x())*(((*p)->production_vertex())->position().x()-((*p)->end_vertex())->position().x())+
48  (((*p)->production_vertex())->position().y()-((*p)->end_vertex())->position().y())*(((*p)->production_vertex())->position().y()-((*p)->end_vertex())->position().y()));
49  if(dist>theCut)
50  pass=true;
51  }
52 
53  if((*p)->production_vertex()==0&&!(*p)->end_vertex()!=0)
54  {
55  if(((*p)->end_vertex())->position().perp()>theCut)
56  pass=true;
57  }
58 
59  if(pass)
60  return pass;
61  }
62 
63  return pass;
64 }
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
T sqrt(T t)
Definition: SSEVec.h:46

Member Data Documentation

float MCLongLivedParticles::theCut
private

Definition at line 50 of file MCLongLivedParticles.h.