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

#include <TauAnalysis/GsfTrackMixer/src/GsfTrackMixer.cc>

Inheritance diagram for GsfTrackMixer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GsfTrackMixer (const edm::ParameterSet &)
 
 ~GsfTrackMixer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag _col1
 
edm::InputTag _col2
 
std::string preidgsf_
 
std::string preidname_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 47 of file GsfTrackMixer.cc.

Constructor & Destructor Documentation

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

Definition at line 77 of file GsfTrackMixer.cc.

77  :
78  _col1(iConfig.getParameter< edm::InputTag > ("collection1")),
79  _col2(iConfig.getParameter< edm::InputTag > ("collection2"))
80 {
81 
82  // ?setBranchAlias?
83  produces<reco::GsfTrackCollection>();
84  produces<reco::TrackExtraCollection>();
85  produces<reco::GsfTrackExtraCollection>();
86  //produces<reco::GsfTrackCollection>().setBranchAlias( alias_ + "GsfTracks" );
87  //produces<reco::TrackExtraCollection>().setBranchAlias( alias_ + "TrackExtras" );
88  //produces<reco::GsfTrackExtraCollection>().setBranchAlias( alias_ + "GsfTrackExtras" );
89  //produces<TrackingRecHitCollection>().setBranchAlias( alias_ + "RecHits" );
90  //produces<std::vector<Trajectory> >() ;
91  //produces<TrajGsfTrackAssociationCollection>();
92 
93 
94 }
T getParameter(std::string const &) const
edm::InputTag _col2
edm::InputTag _col1
GsfTrackMixer::~GsfTrackMixer ( )

Definition at line 97 of file GsfTrackMixer.cc.

98 {
99 
100  // do anything here that needs to be done at desctruction time
101  // (e.g. close files, deallocate resources etc.)
102 
103 }

Member Function Documentation

void GsfTrackMixer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 173 of file GsfTrackMixer.cc.

174 {
175 }
void GsfTrackMixer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 179 of file GsfTrackMixer.cc.

179  {
180 }
void GsfTrackMixer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 112 of file GsfTrackMixer.cc.

References _col1, _col2, edm::Event::getByLabel(), edm::Event::getRefBeforePut(), customizeTrackingMonitorSeedNumber::idx, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, reco::Track::setExtra(), and reco::GsfTrack::setGsfExtra().

113 {
114  using namespace edm;
115  using namespace std;
116  using namespace reco;
117 
118  // see RecoTracker/TrackProducer/plugins/GsfTrackProducer.cc
119  // and RecoTracker/TrackProducer/src/GsfTrackProducerBase.cc
120  //std::auto_ptr<TrackingRecHitCollection> outputRHColl (new TrackingRecHitCollection);
121  std::auto_ptr<reco::GsfTrackCollection> outputTColl(new reco::GsfTrackCollection);
122  std::auto_ptr<reco::TrackExtraCollection> outputTEColl(new reco::TrackExtraCollection);
123  std::auto_ptr<reco::GsfTrackExtraCollection> outputGsfTEColl(new reco::GsfTrackExtraCollection);
124  //std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(new std::vector<Trajectory>);
125 
129 
130 
133 
135  iEvent.getByLabel( _col1, hcol1);
136  iEvent.getByLabel( _col2, hcol2);
137 
138  std::vector< edm::Handle< reco::GsfTrackCollection > > cols;
139  cols.push_back(hcol1);
140  cols.push_back(hcol2);
141 
142  for ( std::vector< edm::Handle< reco::GsfTrackCollection > >::iterator itCols=cols.begin();
143  itCols!=cols.end();
144  ++itCols )
145  {
146  for (GsfTrackCollection::const_iterator it = (*itCols)->begin(); it!=(*itCols)->end(); ++ it){
147  GsfTrack gsfTrack = *it;
148  TrackExtra te = *(it->extra());
149  GsfTrackExtra ge = *(it->gsfExtra());
150 
151  reco::GsfTrackExtraRef terefGsf = reco::GsfTrackExtraRef ( rGsfTrackExtras, idxGsf ++ );
152  reco::TrackExtraRef teref= reco::TrackExtraRef ( rTrackExtras, idx ++ );
153 
154  gsfTrack.setExtra( teref );
155  gsfTrack.setGsfExtra( terefGsf );
156 
157  outputTColl->push_back(gsfTrack);
158  outputTEColl->push_back(te);
159  outputGsfTEColl->push_back(ge);
160  }
161  }
162 
163 
164 
165  iEvent.put(outputTColl);
166  iEvent.put(outputTEColl);
167  iEvent.put(outputGsfTEColl);
168 
169 }
void setGsfExtra(const GsfTrackExtraRef &ref)
set reference to GSF &quot;extra&quot; object
Definition: GsfTrack.h:30
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:17
edm::InputTag _col2
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
RefProd< PROD > getRefBeforePut()
Definition: Event.h:141
edm::Ref< GsfTrackExtraCollection > GsfTrackExtraRef
persistent reference to a GsfTrackExtra
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:11
void setExtra(const TrackExtraRef &ref)
set reference to &quot;extra&quot; object
Definition: Track.h:184
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::InputTag _col1
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:168

Member Data Documentation

edm::InputTag GsfTrackMixer::_col1
private

Definition at line 56 of file GsfTrackMixer.cc.

Referenced by produce().

edm::InputTag GsfTrackMixer::_col2
private

Definition at line 57 of file GsfTrackMixer.cc.

Referenced by produce().

std::string GsfTrackMixer::preidgsf_
private

Definition at line 60 of file GsfTrackMixer.cc.

std::string GsfTrackMixer::preidname_
private

Definition at line 61 of file GsfTrackMixer.cc.