CMS 3D CMS Logo

TSToSimTSAssociatorEDProducer.cc
Go to the documentation of this file.
1 //
2 // Original Author: Leonardo Cristella
3 // Created: Thu Dec 3 10:52:11 CET 2020
4 //
5 //
6 
7 // system include files
8 #include <memory>
9 #include <string>
10 
11 // user include files
13 
16 
18 
20 
22 
25 
27 
28 //
29 // class decleration
30 //
31 
33 public:
36 
37 private:
38  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
39 
44 };
45 
47  produces<ticl::SimToRecoCollectionSimTracksters>("simToReco");
48  produces<ticl::RecoToSimCollectionSimTracksters>("recoToSim");
49 
50  TSCollectionToken_ = consumes<ticl::TracksterCollection>(pset.getParameter<edm::InputTag>("label_tst"));
51  SimTSCollectionToken_ = consumes<ticl::TracksterCollection>(pset.getParameter<edm::InputTag>("label_simTst"));
52  LCCollectionToken_ = consumes<reco::CaloClusterCollection>(pset.getParameter<edm::InputTag>("label_lcl"));
53  associatorToken_ = consumes<ticl::TracksterToSimTracksterAssociator>(pset.getParameter<edm::InputTag>("associator"));
54 }
55 
57 
58 //
59 // member functions
60 //
61 
62 // ------------ method called to produce the data ------------
64  using namespace edm;
65 
67  iEvent.getByToken(associatorToken_, theAssociator);
68 
70  iEvent.getByToken(TSCollectionToken_, TSCollection);
71 
72  Handle<ticl::TracksterCollection> SimTSCollection;
73  iEvent.getByToken(SimTSCollectionToken_, SimTSCollection);
74 
76  iEvent.getByToken(LCCollectionToken_, LCCollection);
77 
78  // associate TS and SimTS
79  LogTrace("AssociatorValidator") << "Calling associateRecoToSim method\n";
81  theAssociator->associateRecoToSim(TSCollection, LCCollection, SimTSCollection);
82 
83  LogTrace("AssociatorValidator") << "Calling associateSimToReco method\n";
85  theAssociator->associateSimToReco(TSCollection, LCCollection, SimTSCollection);
86 
87  auto rts = std::make_unique<ticl::RecoToSimCollectionSimTracksters>(recSimColl);
88  auto str = std::make_unique<ticl::SimToRecoCollectionSimTracksters>(simRecColl);
89 
90  iEvent.put(std::move(rts), "recoToSim");
91  iEvent.put(std::move(str), "simToReco");
92 }
93 
94 // define this as a plug-in
edm::EDGetTokenT< ticl::TracksterToSimTracksterAssociator > associatorToken_
#define LogTrace(id)
int iEvent
Definition: GenABIO.cc:224
ticl::RecoToSimCollectionSimTracksters associateRecoToSim(const edm::Handle< ticl::TracksterCollection > &tCH, const edm::Handle< reco::CaloClusterCollection > &lCCH, const edm::Handle< ticl::TracksterCollection > &sTCH) const
Associate a Trackster to SimClusters.
TSToSimTSAssociatorEDProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< ticl::TracksterCollection > SimTSCollectionToken_
HLT enums.
edm::EDGetTokenT< reco::CaloClusterCollection > LCCollectionToken_
#define str(s)
edm::EDGetTokenT< ticl::TracksterCollection > TSCollectionToken_
ticl::SimToRecoCollectionSimTracksters associateSimToReco(const edm::Handle< ticl::TracksterCollection > &tCH, const edm::Handle< reco::CaloClusterCollection > &lCCH, const edm::Handle< ticl::TracksterCollection > &sTCH) const
Associate a SimCluster to Tracksters.
def move(src, dest)
Definition: eostools.py:511