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<hgcal::SimToRecoCollectionSimTracksters>();
48  produces<hgcal::RecoToSimCollectionSimTracksters>();
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<hgcal::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<hgcal::RecoToSimCollectionSimTracksters>(recSimColl);
88  auto str = std::make_unique<hgcal::SimToRecoCollectionSimTracksters>(simRecColl);
89 
90  iEvent.put(std::move(rts));
91  iEvent.put(std::move(str));
92 }
93 
94 // define this as a plug-in
edm::StreamID
Definition: StreamID.h:30
MessageLogger.h
Trackster.h
ESHandle.h
edm::EDGetTokenT< ticl::TracksterCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
hgcal::TracksterToSimTracksterAssociator::associateRecoToSim
hgcal::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.
Definition: TracksterToSimTracksterAssociator.h:26
TSToSimTSAssociatorEDProducer::associatorToken_
edm::EDGetTokenT< hgcal::TracksterToSimTracksterAssociator > associatorToken_
Definition: TSToSimTSAssociatorEDProducer.cc:43
TSToSimTSAssociatorEDProducer::LCCollectionToken_
edm::EDGetTokenT< reco::CaloClusterCollection > LCCollectionToken_
Definition: TSToSimTSAssociatorEDProducer.cc:42
edm::Handle
Definition: AssociativeIterator.h:50
TSToSimTSAssociatorEDProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: TSToSimTSAssociatorEDProducer.cc:63
MakerMacros.h
TracksterToSimTracksterAssociator.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TSToSimTSAssociatorEDProducer::SimTSCollectionToken_
edm::EDGetTokenT< ticl::TracksterCollection > SimTSCollectionToken_
Definition: TSToSimTSAssociatorEDProducer.cc:41
TSToSimTSAssociatorEDProducer::TSToSimTSAssociatorEDProducer
TSToSimTSAssociatorEDProducer(const edm::ParameterSet &)
Definition: TSToSimTSAssociatorEDProducer.cc:46
str
#define str(s)
Definition: TestProcessor.cc:53
EDGetToken.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::AssociationMap
Definition: AssociationMap.h:48
TSToSimTSAssociatorEDProducer::~TSToSimTSAssociatorEDProducer
~TSToSimTSAssociatorEDProducer() override
Definition: TSToSimTSAssociatorEDProducer.cc:56
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
TSToSimTSAssociatorEDProducer
Definition: TSToSimTSAssociatorEDProducer.cc:32
eostools.move
def move(src, dest)
Definition: eostools.py:511
TSToSimTSAssociatorEDProducer::TSCollectionToken_
edm::EDGetTokenT< ticl::TracksterCollection > TSCollectionToken_
Definition: TSToSimTSAssociatorEDProducer.cc:40
hgcal::TracksterToSimTracksterAssociator::associateSimToReco
hgcal::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.
Definition: TracksterToSimTracksterAssociator.h:34
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27