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 Member Functions | Private Attributes
PFNuclearProducer Class Reference

#include <PFNuclearProducer.h>

Inheritance diagram for PFNuclearProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFNuclearProducer (const edm::ParameterSet &)
 Constructor. More...
 
 ~PFNuclearProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 Produce the PFRecTrack collection. More...
 

Private Attributes

double likelihoodCut_
 
std::vector< edm::EDGetTokenT
< reco::NuclearInteractionCollection > > 
nuclearContainers_
 
PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 12 of file PFNuclearProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 10 of file PFNuclearProducer.cc.

References edm::ParameterSet::getParameter(), i, likelihoodCut_, nuclearContainers_, and o2o::tags.

10  :
12 {
13  produces<reco::PFRecTrackCollection>();
14  produces<reco::PFNuclearInteractionCollection>();
15 
16  std::vector<edm::InputTag> tags=
17  iConfig.getParameter< vector < InputTag > >("nuclearColList");
18 
19  for (unsigned int i=0;i<tags.size();++i)
20  nuclearContainers_.push_back(consumes<reco::NuclearInteractionCollection>(tags[i]));
21 
23  = iConfig.getParameter<double>("likelihoodCut");
24 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
std::vector< edm::EDGetTokenT< reco::NuclearInteractionCollection > > nuclearContainers_
tuple tags
Definition: o2o.py:248
PFNuclearProducer::~PFNuclearProducer ( )

Destructor.

Definition at line 26 of file PFNuclearProducer.cc.

References pfTransformer_.

27 {
28  delete pfTransformer_;
29 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.

Member Function Documentation

void PFNuclearProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 81 of file PFNuclearProducer.cc.

References edm::EventSetup::get(), HLT_25ns10e33_v2_cff::magneticField, PFTrackTransformer::OnlyProp(), and pfTransformer_.

83 {
85  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
86  pfTransformer_= new PFTrackTransformer(math::XYZVector(magneticField->inTesla(GlobalPoint(0,0,0))));
88 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:56
void PFNuclearProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 92 of file PFNuclearProducer.cc.

References pfTransformer_.

93  {
94  delete pfTransformer_;
95  pfTransformer_=nullptr;
96 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
void PFNuclearProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Produce the PFRecTrack collection.

Implements edm::stream::EDProducerBase.

Definition at line 32 of file PFNuclearProducer.cc.

References PFTrackTransformer::addPoints(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), icoll, reco::PFRecTrack::KF, likelihood(), likelihoodCut_, nuclearContainers_, pfTransformer_, edm::Handle< T >::product(), edm::RefVector< C, T, F >::push_back(), and edm::Event::put().

33 {
34  typedef reco::NuclearInteraction::trackRef_iterator trackRef_iterator;
35 
36  //create the empty collections
37  auto_ptr< reco::PFNuclearInteractionCollection >
38  pfNuclearColl (new reco::PFNuclearInteractionCollection);
39  auto_ptr< reco::PFRecTrackCollection >
40  pfNuclearRecTrackColl (new reco::PFRecTrackCollection);
41 
43  int hid=0;
44 
45  // loop on the nuclear interaction collections
46  for (unsigned int istr=0; istr<nuclearContainers_.size();istr++){
47 
49  iEvent.getByToken(nuclearContainers_[istr], nuclCollH);
50  const reco::NuclearInteractionCollection& nuclColl = *(nuclCollH.product());
51 
52  // loop on all NuclearInteraction
53  for( unsigned int icoll=0; icoll < nuclColl.size(); icoll++) {
54 
55  if( nuclColl[icoll].likelihood() < likelihoodCut_) continue;
56 
57  reco::PFRecTrackRefVector pfRecTkcoll;
58 
59  // convert the secondary tracks
60  for(trackRef_iterator it = nuclColl[icoll].secondaryTracks_begin(); it!=nuclColl[icoll].secondaryTracks_end(); it++){
61  reco::PFRecTrack pftrack( (*it)->charge(),
63  it->key(), (reco::TrackRef)((*it).castTo<reco::TrackRef>()) );
64  Trajectory FakeTraj;
65  bool valid = pfTransformer_->addPoints( pftrack, **it, FakeTraj);
66  if(valid) {
67  pfRecTkcoll.push_back(reco::PFRecTrackRef( pfTrackRefProd, hid++ ));
68  pfNuclearRecTrackColl->push_back(pftrack);
69  }
70  }
71  reco::NuclearInteractionRef niRef(nuclCollH, icoll);
72  pfNuclearColl->push_back( reco::PFNuclearInteraction( niRef, pfRecTkcoll ));
73  }
74  }
75  iEvent.put(pfNuclearRecTrackColl);
76  iEvent.put(pfNuclearColl);
77 }
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
void likelihood(int &npar, double *grad, double &fval, double *xval, int flag)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool addPoints(reco::PFRecTrack &pftrack, const reco::Track &track, const Trajectory &traj, bool msgwarning=true) const
Add points to a PFTrack. return false if a TSOS is invalid.
std::vector< edm::EDGetTokenT< reco::NuclearInteractionCollection > > nuclearContainers_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< PFNuclearInteraction > PFNuclearInteractionCollection
collection of NuclearInteractions
std::vector< NuclearInteraction > NuclearInteractionCollection
collection of NuclearInteractions
reco::Vertex::trackRef_iterator trackRef_iterator
RefProd< PROD > getRefBeforePut()
Definition: Event.h:141
T const * product() const
Definition: Handle.h:81
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
int icoll
Definition: AMPTWrapper.h:136

Member Data Documentation

double PFNuclearProducer::likelihoodCut_
private

Definition at line 30 of file PFNuclearProducer.h.

Referenced by PFNuclearProducer(), and produce().

std::vector<edm::EDGetTokenT<reco::NuclearInteractionCollection> > PFNuclearProducer::nuclearContainers_
private

Definition at line 31 of file PFNuclearProducer.h.

Referenced by PFNuclearProducer(), and produce().

PFTrackTransformer* PFNuclearProducer::pfTransformer_
private

PFTrackTransformer.

Definition at line 29 of file PFNuclearProducer.h.

Referenced by beginRun(), endRun(), produce(), and ~PFNuclearProducer().