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)
 
static void prevalidate (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 13 of file TrackInfoProducer.cc.

13  :
14  conf_(iConfig),
15  theAlgo_(iConfig)
16 {
17  produces<reco::TrackInfoCollection>();
18  produces<reco::TrackInfoTrackAssociationCollection>();
19 
20 
21 }
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 24 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 JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

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