CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
prodname Class Reference
Inheritance diagram for prodname:
edm::ESProducer edm::EDProducer edm::ESProxyFactoryProducer edm::ProducerBase edm::eventsetup::DataProxyProvider edm::ProductRegistryHelper

Public Types

typedef perl if (1 eq scalar(@::datatypes))
 
- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

foreach $type (@::datatypes)
 
 prodname (const edm::ParameterSet &)
 
 prodname (const edm::ParameterSet &)
 
ReturnType produce (const recordname &)
 
 ~prodname ()
 
 ~prodname ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- 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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Public Attributes

 $line = 0
 
 $result ="$result>"
 
 else { $result="edm::ESProducts<"
 
perl ReturnType
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void endRun (edm::Run &, edm::EventSetup const &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

example_myparticle edm::InputTag electronTags_
 
example_myparticle edm::InputTag muonTags_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 43 of file edproducer.cc.

Member Typedef Documentation

typedef perl prodname::if(1 eq scalar(@::datatypes))
inline

Definition at line 43 of file esproducer.cc.

43 { $result="boost::shared_ptr<$::datatypes[0]>"; } else { $result="edm::ESProducts<"; $line = 0; foreach $type ( @::datatypes ) { if ($line) { $result = "$result, "; } $result= "$result boost::shared_ptr<$type> "; $line =1;} $result="$result>"; } @\perl ReturnType;
foreach $type(@::datatypes)
Definition: esproducer.cc:43
perl ReturnType
Definition: esproducer.cc:43

Constructor & Destructor Documentation

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

Definition at line 79 of file edproducer.cc.

80  :
81 @example_myparticle muonTags_( iConfig.getParameter<edm::InputTag>( "muons" )),
82 @example_myparticle electronTags_( iConfig.getParameter<edm::InputTag>( "electrons" ))
83 {
84  //register your products
85 /* Examples
86  produces<ExampleData2>();
87 
88  //if do put with a label
89  produces<ExampleData2>("label");
90 
91  //if you want to put into the Run
92  produces<ExampleData2,InRun>();
93 */
94 @example_myparticle produces<MyParticleCollection>( "particles" );
95  //now do what ever other initialization is needed
96 
97 }
T getParameter(std::string const &) const
example_myparticle edm::InputTag electronTags_
Definition: edproducer.cc:62
example_myparticle edm::InputTag muonTags_
Definition: edproducer.cc:61
prodname::~prodname ( )

Definition at line 100 of file edproducer.cc.

101 {
102 
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 
106 }
prodname::prodname ( const edm::ParameterSet )
prodname::~prodname ( )

Member Function Documentation

foreach prodname::$type ( @::datatypes  )
inline

Definition at line 43 of file esproducer.cc.

Referenced by produce().

43 { $result="boost::shared_ptr<$::datatypes[0]>"; } else { $result="edm::ESProducts<"; $line = 0; foreach $type ( @::datatypes ) { if ($line) { $result = "$result, "; } $result= "$result boost::shared_ptr<$type> "; $line =1;} $result="$result>"; } @\perl ReturnType;
foreach $type(@::datatypes)
Definition: esproducer.cc:43
perl ReturnType
Definition: esproducer.cc:43
void prodname::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 179 of file edproducer.cc.

180 {
181 }
void prodname::beginLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 202 of file edproducer.cc.

203 {
204 }
void prodname::beginRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 190 of file edproducer.cc.

191 {
192 }
void prodname::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 185 of file edproducer.cc.

185  {
186 }
void prodname::endLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 208 of file edproducer.cc.

209 {
210 }
void prodname::endRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 196 of file edproducer.cc.

197 {
198 }
void prodname::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 214 of file edproducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

214  {
215  //The following says we do not know what parameters are allowed so do no validation
216  // Please change this to state exactly what you do use, even if it is no parameters
218  desc.setUnknown();
219  descriptions.addDefault(desc);
220 @example_myparticle
221 @example_myparticle //Specify that only 'muons' and 'electrons' are allowed
222 @example_myparticle //To use, remove the default given above and uncomment below
223 @example_myparticle //ParameterSetDescription desc;
224 @example_myparticle //desc.add<edm::InputTag>("muons","muons");
225 @example_myparticle //desc.add<edm::InputTag>("electrons","pixelMatchGsfElectrons");
226 @example_myparticle //descriptions.addDefault(desc);
227 }
void addDefault(ParameterSetDescription const &psetDescription)
prodname::ReturnType prodname::produce ( const recordname &  iRecord)

Definition at line 86 of file esproducer.cc.

References $line, $result, $type(), and python.Vispa.Plugins.EdmBrowser.EdmDataAccessor::eq().

87 {
88  using namespace edm::es;
89 @perl $result=""; foreach $type (@::datatypes) {$result ="$result boost::shared_ptr<$type> p$type ;\n";} @\perl
90 
91  return @perl if( 1 eq scalar( @::datatypes ) ) { $result="p$::datatypes[0]" } else { $result="products("; $line = 0; foreach $type ( @::datatypes ) { if ($line) { $result = "$result,"; } $result= "$result p$type"; $line +=1; } $result="$result)"; } @\perl ;
92 }
foreach $type(@::datatypes)
Definition: esproducer.cc:43
void prodname::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 115 of file edproducer.cc.

References DeDxDiscriminatorTools::charge(), metsig::electron, electronTags_, edm::Event::getByLabel(), h, metsig::muon, patZpeak::muons, muonTags_, MyParticleCollection, edm::Event::put(), and dt_dqm_sourceclient_common_cff::reco.

116 {
117  using namespace edm;
118 @example_myparticle using namespace reco;
119 @example_myparticle using namespace std;
120 /* This is an event example
121  //Read 'ExampleData' from the Event
122  Handle<ExampleData> pIn;
123  iEvent.getByLabel("example",pIn);
124 
125  //Use the ExampleData to create an ExampleData2 which
126  // is put into the Event
127  std::auto_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
128  iEvent.put(pOut);
129 */
130 
131 /* this is an EventSetup example
132  //Read SetupData from the SetupRecord in the EventSetup
133  ESHandle<SetupData> pSetup;
134  iSetup.get<SetupRecord>().get(pSetup);
135 */
136 
137 @example_myparticle Handle<MuonCollection> muons;
138 @example_myparticle iEvent.getByLabel( muonTags_, muons );
139 @example_myparticle
140 @example_myparticle Handle<PixelMatchGsfElectronCollection> electrons;
141 @example_myparticle iEvent.getByLabel( electronTags_, electrons );
142 @example_myparticle
143 @example_myparticle // create a new collection of Particle objects
144 @example_myparticle auto_ptr<MyParticleCollection> newParticles( new MyParticleCollection );
145 @example_myparticle
146 @example_myparticle // if the number of electrons or muons is 4 (or 2 and 2), costruct a new particle
147 @example_myparticle if( muons->size() == 4 || electrons->size() == 4 || ( muons->size() == 2 && electrons->size() == 2 ) ) {
148 @example_myparticle
149 @example_myparticle // sums of momenta and charges will be calculated
150 @example_myparticle Particle::LorentzVector totalP4( 0, 0, 0, 0 );
151 @example_myparticle Particle::Charge charge( 0 );
152 @example_myparticle
153 @example_myparticle // loop over muons, sum over p4s and charges. Later same for electrons
154 @example_myparticle for( MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon ) {
155 @example_myparticle totalP4 += muon->p4();
156 @example_myparticle charge += muon->charge();
157 @example_myparticle }
158 @example_myparticle
159 @example_myparticle for( PixelMatchGsfElectronCollection::const_iterator electron = electrons->begin(); electron != electrons->end(); ++electron ) {
160 @example_myparticle totalP4 += electron->p4();
161 @example_myparticle charge += electron->charge();
162 @example_myparticle }
163 @example_myparticle
164 @example_myparticle // create a particle with momentum and charge from muons and electrons
165 @example_myparticle Particle h;
166 @example_myparticle h.setP4(totalP4);
167 @example_myparticle h.setCharge(charge);
168 @example_myparticle
169 @example_myparticle // fill the particles into the vector
170 @example_myparticle newParticles->push_back( h );
171 @example_myparticle }
172 @example_myparticle
173 @example_myparticle // save the vector
174 @example_myparticle iEvent.put( newParticles, "particles" );
175 }
int Charge
electric charge type
Definition: Particle.h:24
double charge(const std::vector< uint8_t > &Ampls)
example_myparticle edm::InputTag electronTags_
Definition: edproducer.cc:62
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
example_myparticle edm::InputTag muonTags_
Definition: edproducer.cc:61
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple muons
Definition: patZpeak.py:38
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:26
example_myparticle example_myparticle typedef std::vector< reco::Particle > MyParticleCollection
Definition: edproducer.cc:70

Member Data Documentation

prodname::$line = 0

Definition at line 43 of file esproducer.cc.

Referenced by produce().

prodname::$result ="$result>"

Definition at line 43 of file esproducer.cc.

Referenced by produce().

example_myparticle edm::InputTag prodname::electronTags_
private

Definition at line 62 of file edproducer.cc.

Referenced by produce().

prodname::else { $result="edm::ESProducts<"

Definition at line 43 of file esproducer.cc.

example_myparticle edm::InputTag prodname::muonTags_
private

Definition at line 61 of file edproducer.cc.

Referenced by produce().

perl prodname::ReturnType

Definition at line 43 of file esproducer.cc.