CMS 3D CMS Logo

GenEventKTValueProducer Class Reference

Author:
Christophe Saout, CERN
More...

Inheritance diagram for GenEventKTValueProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 GenEventKTValueProducer (const ParameterSet &)
 constructor

Private Member Functions

void produce (Event &evt, const EventSetup &es)

Private Attributes

edm::InputTag src_


Detailed Description

Author:
Christophe Saout, CERN

Version:
Id
GenEventKTValueProducer.cc,v 1.2 2008/11/26 17:18:02 saout Exp

Definition at line 27 of file GenEventKTValueProducer.cc.


Constructor & Destructor Documentation

GenEventKTValueProducer::GenEventKTValueProducer ( const ParameterSet p  ) 

constructor

Definition at line 113 of file GenEventKTValueProducer.cc.

00113                                                                          :
00114   src_( p.getParameter<InputTag>( "src" ) )
00115 {
00116   produces<double>();
00117 }


Member Function Documentation

void GenEventKTValueProducer::produce ( Event evt,
const EventSetup es 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 119 of file GenEventKTValueProducer.cc.

References begin, reco::Candidate::end(), findHerwigPPME(), genParticles_cfi::genParticles, edm::Event::getByLabel(), iter, max, me, reco::Candidate::mother(), out, edm::Event::put(), src_, and StDecayID::status.

00120 {
00121   Handle<GenParticleCollection> genParticles;
00122 
00123   evt.getByLabel( src_, genParticles );
00124 
00125   auto_ptr<double> event_kt_value( new double( -1. ) );
00126 
00127   vector<const Candidate*> herwigPPMECandidates;
00128 
00129   // find the hard interaction(s)
00130   for(GenParticleCollection::const_iterator iter = genParticles->begin();
00131       iter != genParticles->end(); ++iter) {
00132 
00133     int status = iter->status();
00134 
00135     if ( status != 3 || iter->numberOfMothers() != 2 )
00136       continue;
00137 
00138     const Candidate *mothers[2] = { iter->mother(0), iter->mother(1) };
00139 
00140     // we only look at daughters once
00141     if (mothers[0]->daughter(0) != &*iter)
00142       continue;
00143 
00144     if ( mothers[0]->numberOfDaughters() > 1 ) {
00145       // we have a good "standard" documentation line
00146       double maxKT = -1.;
00147       for( Candidate::const_iterator iter2 = mothers[0]->begin();
00148            iter2 != mothers[0]->end(); ++iter2 ) {
00149         if ( iter2->status() == 3 &&
00150              ( iter2->mother(0) == mothers[1] ||
00151                iter2->mother(1) == mothers[1] ) )
00152           maxKT = max( maxKT, iter2->pt() );
00153       }
00154 
00155       if ( maxKT > 0. ) {
00156         *event_kt_value = maxKT;
00157         break;
00158       }
00159     } else {
00160       MatrixElement me;
00161       if ( !findHerwigPPME( &*iter, me ) )
00162         continue;
00163 
00164       // ok, we have found a Herwig++ matrix element with a subsection
00165       // of the status 2 graph with all one-mother-one-daughter endpoints...
00166       for( vector<const Candidate*>::const_iterator out = me.outgoing.begin();
00167            out != me.outgoing.end(); ++out )
00168         *event_kt_value = max( *event_kt_value, (*out)->pt() );
00169     }
00170   }
00171 
00172   evt.put( event_kt_value );
00173 }


Member Data Documentation

edm::InputTag GenEventKTValueProducer::src_ [private]

Definition at line 34 of file GenEventKTValueProducer.cc.

Referenced by produce().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:21:12 2009 for CMSSW by  doxygen 1.5.4