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

#include <PFDisplacedTrackerVertexProducer.h>

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

Public Member Functions

 PFDisplacedTrackerVertexProducer (const edm::ParameterSet &)
 Constructor. More...
 
 ~PFDisplacedTrackerVertexProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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
 
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

edm::InputTag pfDisplacedVertexContainer_
 
edm::InputTag pfTrackContainer_
 
PFTrackTransformerpfTransformer_
 PFTrackTransformer. More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 11 of file PFDisplacedTrackerVertexProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 11 of file PFDisplacedTrackerVertexProducer.cc.

References edm::ParameterSet::getParameter(), pfDisplacedVertexContainer_, and pfTrackContainer_.

11  :
13 {
14  produces<reco::PFRecTrackCollection>();
15  produces<reco::PFDisplacedTrackerVertexCollection>();
16 
18  iConfig.getParameter< InputTag >("displacedTrackerVertexColl");
19 
21  iConfig.getParameter< InputTag >("trackColl");
22 
23 }
T getParameter(std::string const &) const
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
PFDisplacedTrackerVertexProducer::~PFDisplacedTrackerVertexProducer ( )

Destructor.

Definition at line 25 of file PFDisplacedTrackerVertexProducer.cc.

References pfTransformer_.

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

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 101 of file PFDisplacedTrackerVertexProducer.cc.

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

103 {
104  ESHandle<MagneticField> magneticField;
105  iSetup.get<IdealMagneticFieldRecord>().get(magneticField);
106  pfTransformer_= new PFTrackTransformer(math::XYZVector(magneticField->inTesla(GlobalPoint(0,0,0))));
108 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const T & get() const
Definition: EventSetup.h:55
void PFDisplacedTrackerVertexProducer::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 112 of file PFDisplacedTrackerVertexProducer.cc.

References pfTransformer_.

113  {
114  delete pfTransformer_;
115  pfTransformer_=nullptr;
116 }
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
void PFDisplacedTrackerVertexProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Produce the PFRecTrack collection.

Implements edm::EDProducer.

Definition at line 31 of file PFDisplacedTrackerVertexProducer.cc.

References PFTrackTransformer::addPoints(), reco::TrackBase::charge(), edm::Event::getByLabel(), edm::Event::getRefBeforePut(), icoll, customizeTrackingMonitorSeedNumber::idx, edm::RefToBase< T >::key(), reco::PFRecTrack::KF, pfDisplacedVertexContainer_, pfTrackContainer_, pfTransformer_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), and TrackValidation_HighPurity_cff::valid.

32 {
33 
34  //create the empty collections
35  auto_ptr< reco::PFDisplacedTrackerVertexCollection >
36  pfDisplacedTrackerVertexColl (new reco::PFDisplacedTrackerVertexCollection);
37  auto_ptr< reco::PFRecTrackCollection >
38  pfRecTrackColl (new reco::PFRecTrackCollection);
39 
41 
42 
43 
45  iEvent.getByLabel(pfDisplacedVertexContainer_, nuclCollH);
46  const reco::PFDisplacedVertexCollection& nuclColl = *(nuclCollH.product());
47 
49  iEvent.getByLabel(pfTrackContainer_, trackColl);
50 
51  int idx = 0;
52 
53  // cout << "Size of Displaced Vertices "
54  // << nuclColl.size() << endl;
55 
56  // loop on all NuclearInteraction
57  for( unsigned int icoll=0; icoll < nuclColl.size(); icoll++) {
58 
59  reco::PFRecTrackRefVector pfRecTkcoll;
60 
61  std::vector<reco::Track> refittedTracks = nuclColl[icoll].refittedTracks();
62 
63  // convert the secondary tracks
64  for(unsigned it = 0; it < refittedTracks.size(); it++){
65 
66  reco::TrackBaseRef trackBaseRef = nuclColl[icoll].originalTrack(refittedTracks[it]);
67 
68  // cout << "track base pt = " << trackBaseRef->pt() << endl;
69 
70  reco::TrackRef trackRef(trackColl, trackBaseRef.key());
71 
72  // cout << "track pt = " << trackRef->pt() << endl;
73 
74 
75  reco::PFRecTrack pfRecTrack( trackBaseRef->charge(),
77  trackBaseRef.key(),
78  trackRef );
79 
80  // cout << pfRecTrack << endl;
81 
82  Trajectory FakeTraj;
83  bool valid = pfTransformer_->addPoints( pfRecTrack, *trackBaseRef, FakeTraj);
84  if(valid) {
85  pfRecTkcoll.push_back(reco::PFRecTrackRef( pfTrackRefProd, idx++));
86  pfRecTrackColl->push_back(pfRecTrack);
87  // cout << "after "<< pfRecTrack << endl;
88 
89  }
90  }
91  reco::PFDisplacedVertexRef niRef(nuclCollH, icoll);
92  pfDisplacedTrackerVertexColl->push_back( reco::PFDisplacedTrackerVertex( niRef, pfRecTkcoll ));
93  }
94 
95  iEvent.put(pfRecTrackColl);
96  iEvent.put(pfDisplacedTrackerVertexColl);
97 }
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
std::vector< PFDisplacedVertex > PFDisplacedVertexCollection
collection of PFDisplacedVertex objects
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.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
size_t key() const
Definition: RefToBase.h:228
PFTrackTransformer * pfTransformer_
PFTrackTransformer.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
RefProd< PROD > getRefBeforePut()
Definition: Event.h:128
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
int charge() const
track electric charge
Definition: TrackBase.h:111
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
Definition: PFRecTrackFwd.h:9
std::vector< PFDisplacedTrackerVertex > PFDisplacedTrackerVertexCollection
collection of DisplacedTrackerVertexs
int icoll
Definition: AMPTWrapper.h:136

Member Data Documentation

edm::InputTag PFDisplacedTrackerVertexProducer::pfDisplacedVertexContainer_
private

Definition at line 29 of file PFDisplacedTrackerVertexProducer.h.

Referenced by PFDisplacedTrackerVertexProducer(), and produce().

edm::InputTag PFDisplacedTrackerVertexProducer::pfTrackContainer_
private

Definition at line 30 of file PFDisplacedTrackerVertexProducer.h.

Referenced by PFDisplacedTrackerVertexProducer(), and produce().

PFTrackTransformer* PFDisplacedTrackerVertexProducer::pfTransformer_
private