CMS 3D CMS Logo

GsfVertexConstraintProducer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 
4 // user include files
7 
10 
16 
17 //
18 // class decleration
19 //
20 
22 public:
24  ~GsfVertexConstraintProducer() override = default;
25 
26 private:
27  void produce(edm::StreamID streamid, edm::Event&, const edm::EventSetup&) const override;
28 
29  // ----------member data ---------------------------
32 };
33 
34 //
35 // constants, enums and typedefs
36 //
37 
38 //
39 // static data member definitions
40 //
41 
42 //
43 // constructors and destructor
44 //
46  : srcTrkTag_(iConfig.getParameter<edm::InputTag>("src")) {
47  //declare the consumes
48  trkToken_ = consumes<reco::GsfTrackCollection>(edm::InputTag(srcTrkTag_));
49 
50  //register your products
51  produces<std::vector<VertexConstraint> >();
52  produces<GsfTrackVtxConstraintAssociationCollection>();
53 
54  //now do what ever other initialization is needed
55 }
56 
57 //
58 // member functions
59 //
60 
61 // ------------ method called to produce the data ------------
64  const edm::EventSetup& iSetup) const {
65  using namespace edm;
66 
67  Handle<reco::GsfTrackCollection> theTCollection;
68  iEvent.getByToken(trkToken_, theTCollection);
69 
70  edm::RefProd<std::vector<VertexConstraint> > rPairs = iEvent.getRefBeforePut<std::vector<VertexConstraint> >();
71  std::unique_ptr<std::vector<VertexConstraint> > pairs(new std::vector<VertexConstraint>);
72  std::unique_ptr<GsfTrackVtxConstraintAssociationCollection> output(
73  new GsfTrackVtxConstraintAssociationCollection(theTCollection, rPairs));
74 
75  int index = 0;
76  for (reco::GsfTrackCollection::const_iterator i = theTCollection->begin(); i != theTCollection->end(); i++) {
77  VertexConstraint tmp(GlobalPoint(0, 0, 0), GlobalError(0.01, 0, 0.01, 0, 0, 0.001));
78  pairs->push_back(tmp);
79  output->insert(reco::GsfTrackRef(theTCollection, index), edm::Ref<std::vector<VertexConstraint> >(rPairs, index));
80  index++;
81  }
82 
83  iEvent.put(std::move(pairs));
84  iEvent.put(std::move(output));
85 }
86 
87 //define this as a plug-in
edm::RefProd
Definition: EDProductfwd.h:25
edm::StreamID
Definition: StreamID.h:30
mps_fire.i
i
Definition: mps_fire.py:355
GsfVertexConstraintProducer::produce
void produce(edm::StreamID streamid, edm::Event &, const edm::EventSetup &) const override
Definition: GsfVertexConstraintProducer.cc:62
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::EDGetTokenT< reco::GsfTrackCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
GsfTrackVtxConstraintAssociationCollection
edm::AssociationMap< edm::OneToOne< reco::GsfTrackCollection, std::vector< VertexConstraint > > > GsfTrackVtxConstraintAssociationCollection
Definition: GsfTrackConstraintAssociation.h:17
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Handle< reco::GsfTrackCollection >
GsfVertexConstraintProducer
Definition: GsfVertexConstraintProducer.cc:21
edm::Ref< GsfTrackCollection >
GsfVertexConstraintProducer::GsfVertexConstraintProducer
GsfVertexConstraintProducer(const edm::ParameterSet &)
Definition: GsfVertexConstraintProducer.cc:45
GlobalError
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
Definition: GlobalError.h:13
MakerMacros.h
GsfVertexConstraintProducer::~GsfVertexConstraintProducer
~GsfVertexConstraintProducer() override=default
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GsfVertexConstraintProducer::srcTrkTag_
const edm::InputTag srcTrkTag_
Definition: GsfVertexConstraintProducer.cc:30
GsfVertexConstraintProducer::trkToken_
edm::EDGetTokenT< reco::GsfTrackCollection > trkToken_
Definition: GsfVertexConstraintProducer.cc:31
edm::global::EDProducer
Definition: EDProducer.h:32
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
GsfTrack.h
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
GsfTrackFwd.h
Frameworkfwd.h
GsfTrackConstraintAssociation.h
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
VertexConstraint
std::pair< GlobalPoint, GlobalError > VertexConstraint
Definition: TrackConstraintAssociation.h:19
edm::InputTag
Definition: InputTag.h:15