CMS 3D CMS Logo

TSToSCAssociatorEDProducer.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:
35  ~TSToSCAssociatorEDProducer() override;
36 
37 private:
38  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
39 
44 };
45 
47  produces<hgcal::SimToRecoCollectionTracksters>();
48  produces<hgcal::RecoToSimCollectionTracksters>();
49 
50  SCCollectionToken_ = consumes<SimClusterCollection>(pset.getParameter<edm::InputTag>("label_scl"));
51  TSCollectionToken_ = consumes<ticl::TracksterCollection>(pset.getParameter<edm::InputTag>("label_tst"));
52  LCCollectionToken_ = consumes<reco::CaloClusterCollection>(pset.getParameter<edm::InputTag>("label_lcl"));
53  associatorToken_ = consumes<hgcal::TracksterToSimClusterAssociator>(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 
69  Handle<SimClusterCollection> SCCollection;
70  iEvent.getByToken(SCCollectionToken_, SCCollection);
71 
73  iEvent.getByToken(TSCollectionToken_, TSCollection);
74 
76  iEvent.getByToken(LCCollectionToken_, LCCollection);
77 
78  // associate TS and SC
79  LogTrace("AssociatorValidator") << "Calling associateRecoToSim method\n";
81  theAssociator->associateRecoToSim(TSCollection, LCCollection, SCCollection);
82 
83  LogTrace("AssociatorValidator") << "Calling associateSimToReco method\n";
85  theAssociator->associateSimToReco(TSCollection, LCCollection, SCCollection);
86 
87  auto rts = std::make_unique<hgcal::RecoToSimCollectionTracksters>(recSimColl);
88  auto str = std::make_unique<hgcal::SimToRecoCollectionTracksters>(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< SimClusterCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
TSToSCAssociatorEDProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: TSToSCAssociatorEDProducer.cc:63
hgcal::TracksterToSimClusterAssociator::associateSimToReco
hgcal::SimToRecoCollectionTracksters associateSimToReco(const edm::Handle< ticl::TracksterCollection > &tCH, const edm::Handle< reco::CaloClusterCollection > &lCCH, const edm::Handle< SimClusterCollection > &sCCH) const
Associate a SimCluster to Tracksters.
Definition: TracksterToSimClusterAssociator.h:33
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
TSToSCAssociatorEDProducer::associatorToken_
edm::EDGetTokenT< hgcal::TracksterToSimClusterAssociator > associatorToken_
Definition: TSToSCAssociatorEDProducer.cc:43
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TSToSCAssociatorEDProducer::TSCollectionToken_
edm::EDGetTokenT< ticl::TracksterCollection > TSCollectionToken_
Definition: TSToSCAssociatorEDProducer.cc:41
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
iEvent
int iEvent
Definition: GenABIO.cc:224
TSToSCAssociatorEDProducer::SCCollectionToken_
edm::EDGetTokenT< SimClusterCollection > SCCollectionToken_
Definition: TSToSCAssociatorEDProducer.cc:40
edm::EventSetup
Definition: EventSetup.h:58
hgcal::TracksterToSimClusterAssociator::associateRecoToSim
hgcal::RecoToSimCollectionTracksters associateRecoToSim(const edm::Handle< ticl::TracksterCollection > &tCH, const edm::Handle< reco::CaloClusterCollection > &lCCH, const edm::Handle< SimClusterCollection > &sCCH) const
Associate a Trackster to SimClusters.
Definition: TracksterToSimClusterAssociator.h:26
TSToSCAssociatorEDProducer::LCCollectionToken_
edm::EDGetTokenT< reco::CaloClusterCollection > LCCollectionToken_
Definition: TSToSCAssociatorEDProducer.cc:42
TSToSCAssociatorEDProducer::TSToSCAssociatorEDProducer
TSToSCAssociatorEDProducer(const edm::ParameterSet &)
Definition: TSToSCAssociatorEDProducer.cc:46
eostools.move
def move(src, dest)
Definition: eostools.py:511
TSToSCAssociatorEDProducer::~TSToSCAssociatorEDProducer
~TSToSCAssociatorEDProducer() override
Definition: TSToSCAssociatorEDProducer.cc:56
TSToSCAssociatorEDProducer
Definition: TSToSCAssociatorEDProducer.cc:32
TracksterToSimClusterAssociator.h
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