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

#include <TrackInfoProducer.h>

Inheritance diagram for TrackInfoProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 
 TrackInfoProducer (const edm::ParameterSet &iConfig)
 
virtual ~TrackInfoProducer ()
 
- 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 ()
 

Private Attributes

std::string backwardPredictedStateTag_
 
std::string combinedStateTag_
 
edm::ParameterSet conf_
 
std::string forwardPredictedStateTag_
 
TrackInfoProducerAlgorithm theAlgo_
 
std::string updatedStateTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 22 of file TrackInfoProducer.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file TrackInfoProducer.cc.

15  :
16  conf_(iConfig),
17  theAlgo_(iConfig)
18 {
19  produces<reco::TrackInfoCollection>();
20  produces<reco::TrackInfoTrackAssociationCollection>();
21 
22 
23 }
TrackInfoProducerAlgorithm theAlgo_
edm::ParameterSet conf_
virtual TrackInfoProducer::~TrackInfoProducer ( )
inlinevirtual

Definition at line 28 of file TrackInfoProducer.h.

28 {};

Member Function Documentation

void TrackInfoProducer::produce ( edm::Event theEvent,
const edm::EventSetup setup 
)
virtual

Implements edm::EDProducer.

Definition at line 26 of file TrackInfoProducer.cc.

References conf_, edm::EventSetup::get(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), i, edm::Ref< C, T, F >::key(), convertSQLitetoXML_cfg::output, edm::Event::put(), TrackInfoProducerAlgorithm::run(), theAlgo_, and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::export().

27 {
28  //
29  // create empty output collections
30  //
31 
32  std::auto_ptr<reco::TrackInfoCollection> outputColl (new reco::TrackInfoCollection);
33  std::auto_ptr<reco::TrackInfoTrackAssociationCollection> TIassociationColl (new reco::TrackInfoTrackAssociationCollection);
34 
35  edm::InputTag TkTag = conf_.getParameter<edm::InputTag>("cosmicTracks");
36 
40 
42  setup.get<TrackerDigiGeometryRecord>().get( tkgeom );
43  const TrackerGeometry * tracker=&(* tkgeom);
44 
45  theEvent.getByLabel(TkTag,TrajectoryCollection);
46  theEvent.getByLabel(TkTag,trackCollection);
47  theEvent.getByLabel(TkTag,assoMap);
48 
49  //
50  //run the algorithm
51  //
53 
54  std::vector<Trajectory>::const_iterator traj_iterator;
55  edm::LogInfo("TrackInfoProducer") << "Loop on trajectories";
56  std::map<reco::TrackRef,unsigned int> trackid;
57  int i=0;
58 
59  for(TrajTrackAssociationCollection::const_iterator it = assoMap->begin();it != assoMap->end(); ++it){
60  const edm::Ref<std::vector<Trajectory> > traj = it->key;
61  const reco::TrackRef track = it->val;
62  trackid.insert(make_pair(track,i));
63  i++;
64  theAlgo_.run(traj,track,output,tracker);
65  outputColl->push_back(*(new reco::TrackInfo(output)));
66 
67  }
68 
69 
70  //put everything in the event
72 
73 // if(forwardPredictedStateTag_!="") rTrackInfof = theEvent.put(outputFwdColl,forwardPredictedStateTag_ );
74 // if(backwardPredictedStateTag_!="") rTrackInfob = theEvent.put(outputBwdColl,backwardPredictedStateTag_);
75 // if(updatedStateTag_!="") rTrackInfou = theEvent.put(outputUpdatedColl,updatedStateTag_ );
76 // if(combinedStateTag_!="") rTrackInfoc = theEvent.put(outputCombinedColl,combinedStateTag_ );
77  rTrackInfo=theEvent.put(outputColl);
78 
79  for(std::map<reco::TrackRef,unsigned int>::iterator ref_iter=trackid.begin();ref_iter!=trackid.end();ref_iter++){
80 
81  TIassociationColl->insert( ref_iter->first,edm::Ref<reco::TrackInfoCollection>(rTrackInfo,ref_iter->second ));
82  }
83 
84  theEvent.put(TIassociationColl);
85 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::vector< TrackInfo > TrackInfoCollection
collection of TrackInfos
Definition: TrackInfoFwd.h:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
TrackInfoProducerAlgorithm theAlgo_
edm::ParameterSet conf_
const T & get() const
Definition: EventSetup.h:55
key_type key() const
Accessor for product key.
Definition: Ref.h:265
std::vector< Trajectory > TrajectoryCollection
void run(const edm::Ref< std::vector< Trajectory > > traj_iterator, reco::TrackRef track, reco::TrackInfo &output, const TrackerGeometry *tracker)

Member Data Documentation

std::string TrackInfoProducer::backwardPredictedStateTag_
private

Definition at line 36 of file TrackInfoProducer.h.

std::string TrackInfoProducer::combinedStateTag_
private

Definition at line 36 of file TrackInfoProducer.h.

edm::ParameterSet TrackInfoProducer::conf_
private

Definition at line 34 of file TrackInfoProducer.h.

Referenced by produce().

std::string TrackInfoProducer::forwardPredictedStateTag_
private

Definition at line 36 of file TrackInfoProducer.h.

TrackInfoProducerAlgorithm TrackInfoProducer::theAlgo_
private

Definition at line 35 of file TrackInfoProducer.h.

Referenced by produce().

std::string TrackInfoProducer::updatedStateTag_
private

Definition at line 36 of file TrackInfoProducer.h.