CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CollectionMerger< T1, T2 > Class Template Reference

#include <CollectionMerger.h>

Inheritance diagram for CollectionMerger< T1, T2 >:
edm::stream::EDProducer<>

Public Member Functions

 CollectionMerger (const edm::ParameterSet &)
 
 ~CollectionMerger () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

typedef T2 BaseHit
 
typedef T1 MergeCollection
 
typedef edm::ValueMap< reco::TrackRefVectorTrackToTrackMapnew
 

Private Member Functions

void fill_output_obj (edm::Event &, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
template<>
void fill_output_obj (edm::Event &iEvent, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
void fill_output_obj_calo (std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
void fill_output_obj_muonchamber (std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
void fill_output_obj_seed (edm::Event &, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
 
void fill_output_obj_tracker (std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections, bool print_pixel=false)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void willconsume (const edm::ParameterSet &iConfig)
 
template<>
void willconsume (const edm::ParameterSet &iConfig)
 
void willproduce (std::string instance, std::string alias)
 
template<>
void willproduce (std::string instance, std::string alias)
 

Private Attributes

std::map< std::string, std::vector< edm::EDGetTokenT< MergeCollection > > > inputs_
 
edm::EDGetTokenT< reco::TrackCollectioninputs_fixtrackcol_
 
edm::EDGetTokenT< TrackToTrackMapnewinputs_fixtrackrefs_
 
edm::EDGetTokenT< reco::SuperClusterCollectioninputs_SC_
 
edm::EDGetTokenT< reco::SuperClusterCollectioninputs_scEB_
 
edm::EDGetTokenT< reco::SuperClusterCollectioninputs_scEE_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename T1, typename T2>
class CollectionMerger< T1, T2 >

Author
Stefan Wayand; Christian Veelken, LLR

Clean Up from Christian Winter & Sebastian Brommer, KIT

Definition at line 44 of file CollectionMerger.h.

Member Typedef Documentation

◆ BaseHit

template<typename T1 , typename T2 >
typedef T2 CollectionMerger< T1, T2 >::BaseHit
private

Definition at line 53 of file CollectionMerger.h.

◆ MergeCollection

template<typename T1 , typename T2 >
typedef T1 CollectionMerger< T1, T2 >::MergeCollection
private

Definition at line 52 of file CollectionMerger.h.

◆ TrackToTrackMapnew

template<typename T1 , typename T2 >
typedef edm::ValueMap<reco::TrackRefVector> CollectionMerger< T1, T2 >::TrackToTrackMapnew
private

Definition at line 58 of file CollectionMerger.h.

Constructor & Destructor Documentation

◆ CollectionMerger()

template<typename T1 , typename T2 >
CollectionMerger< T1, T2 >::CollectionMerger ( const edm::ParameterSet iConfig)
explicit

Definition at line 61 of file CollectionMerger.cc.

References isoTrack_cff::alias, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

61  {
62  std::vector<edm::InputTag> inCollections = iConfig.getParameter<std::vector<edm::InputTag>>("mergCollections");
63  for (auto const &inCollection : inCollections) {
64  inputs_[inCollection.instance()].push_back(consumes<MergeCollection>(inCollection));
65  }
66  willconsume(iConfig);
67  for (const auto &toproduce : inputs_) {
68  std::string alias(iConfig.getParameter<std::string>("@module_label"));
69  willproduce(toproduce.first, alias);
70  }
71 }
std::map< std::string, std::vector< edm::EDGetTokenT< MergeCollection > > > inputs_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void willproduce(std::string instance, std::string alias)
void willconsume(const edm::ParameterSet &iConfig)

◆ ~CollectionMerger()

template<typename T1 , typename T2 >
CollectionMerger< T1, T2 >::~CollectionMerger ( )
override

Definition at line 74 of file CollectionMerger.cc.

74  {
75  // nothing to be done yet...
76 }

Member Function Documentation

◆ fill_output_obj() [1/12]

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 282 of file CollectionMerger.cc.

References cms::cuda::assert().

284  {
285  assert(0);
286 }
assert(be >=bs)

◆ fill_output_obj() [2/12]

template<>
void CollectionMerger< edmNew::DetSetVector< SiPixelCluster >, SiPixelCluster >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 290 of file CollectionMerger.cc.

293  {
294  fill_output_obj_tracker(output, inputCollections, true);
295 }
void fill_output_obj_tracker(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections, bool print_pixel=false)
Definition: output.py:1

◆ fill_output_obj() [3/12]

template<>
void CollectionMerger< edmNew::DetSetVector< SiStripCluster >, SiStripCluster >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 298 of file CollectionMerger.cc.

301  {
302  fill_output_obj_tracker(output, inputCollections);
303 }
void fill_output_obj_tracker(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections, bool print_pixel=false)
Definition: output.py:1

◆ fill_output_obj() [4/12]

template<>
void CollectionMerger< edm::SortedCollection< EcalRecHit >, EcalRecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 306 of file CollectionMerger.cc.

309  {
310  fill_output_obj_calo(output, inputCollections);
311 }
void fill_output_obj_calo(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [5/12]

template<>
void CollectionMerger< edm::SortedCollection< HBHERecHit >, HBHERecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 314 of file CollectionMerger.cc.

317  {
318  fill_output_obj_calo(output, inputCollections);
319 }
void fill_output_obj_calo(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [6/12]

template<>
void CollectionMerger< edm::SortedCollection< HFRecHit >, HFRecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 322 of file CollectionMerger.cc.

325  {
326  fill_output_obj_calo(output, inputCollections);
327 }
void fill_output_obj_calo(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [7/12]

template<>
void CollectionMerger< edm::SortedCollection< HORecHit >, HORecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 330 of file CollectionMerger.cc.

333  {
334  fill_output_obj_calo(output, inputCollections);
335 }
void fill_output_obj_calo(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [8/12]

template<>
void CollectionMerger< edm::SortedCollection< ZDCRecHit >, ZDCRecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 338 of file CollectionMerger.cc.

341  {
342  fill_output_obj_calo(output, inputCollections);
343 }
void fill_output_obj_calo(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [9/12]

template<>
void CollectionMerger< edm::RangeMap< DTLayerId, edm::OwnVector< DTRecHit1DPair > >, DTRecHit1DPair >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 346 of file CollectionMerger.cc.

349  {
350  fill_output_obj_muonchamber(output, inputCollections);
351 }
void fill_output_obj_muonchamber(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [10/12]

template<>
void CollectionMerger< edm::RangeMap< CSCDetId, edm::OwnVector< CSCRecHit2D > >, CSCRecHit2D >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 354 of file CollectionMerger.cc.

357  {
358  fill_output_obj_muonchamber(output, inputCollections);
359 }
void fill_output_obj_muonchamber(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [11/12]

template<>
void CollectionMerger< edm::RangeMap< RPCDetId, edm::OwnVector< RPCRecHit > >, RPCRecHit >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 362 of file CollectionMerger.cc.

365  {
366  fill_output_obj_muonchamber(output, inputCollections);
367 }
void fill_output_obj_muonchamber(std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj() [12/12]

template<>
void CollectionMerger< std::vector< reco::ElectronSeed >, reco::ElectronSeed >::fill_output_obj ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 370 of file CollectionMerger.cc.

References iEvent.

373  {
374  fill_output_obj_seed(iEvent, output, inputCollections);
375 }
int iEvent
Definition: GenABIO.cc:224
void fill_output_obj_seed(edm::Event &, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1

◆ fill_output_obj_calo()

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::fill_output_obj_calo ( std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 131 of file CollectionMerger.cc.

References valuemaptraslator_cfi::inputCollection, and rpcPointValidation_cfi::recHit.

132  {
133  std::map<uint32_t, BaseHit> output_map;
134  // First merge the two collections again
135  for (auto const &inputCollection : inputCollections) {
136  for (typename MergeCollection::const_iterator recHit = inputCollection->begin(); recHit != inputCollection->end();
137  ++recHit) {
138  DetId detIdObject(recHit->detid().rawId());
139  T2 *akt_calo_obj = &output_map[detIdObject.rawId()];
140  float new_energy = akt_calo_obj->energy() + recHit->energy();
141  T2 newRecHit(*recHit);
142  newRecHit.setEnergy(new_energy);
143  *akt_calo_obj = newRecHit;
144  }
145  }
146  // Now save it into the standard CMSSW format
147  for (typename std::map<uint32_t, BaseHit>::const_iterator outHits = output_map.begin(); outHits != output_map.end();
148  ++outHits) {
149  output->push_back(outHits->second);
150  }
151  output->sort(); // Do a sort for this collection
152 }
Definition: DetId.h:17
Definition: output.py:1

◆ fill_output_obj_muonchamber()

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::fill_output_obj_muonchamber ( std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 156 of file CollectionMerger.cc.

References valuemaptraslator_cfi::inputCollection, genParticles_cff::map, and rpcPointValidation_cfi::recHit.

157  {
158  std::map<uint32_t, std::vector<BaseHit>> output_map;
159  // First merge the collections with the help of the output map
160  for (auto const &inputCollection : inputCollections) {
161  for (typename MergeCollection::const_iterator recHit = inputCollection->begin(); recHit != inputCollection->end();
162  ++recHit) {
163  DetId detIdObject(recHit->geographicalId());
164  output_map[detIdObject].push_back(*recHit);
165  }
166  }
167  // Now save it into the standard CMSSW format, with the standard Filler
168  for (typename std::map<uint32_t, std::vector<BaseHit>>::const_iterator outHits = output_map.begin();
169  outHits != output_map.end();
170  ++outHits) {
171  output->put((typename T1::id_iterator::value_type)outHits->first,
172  outHits->second.begin(),
173  outHits->second.end()); // The DTLayerId misses the automatic type cast
174  }
175 }
Definition: DetId.h:17
Definition: output.py:1

◆ fill_output_obj_seed()

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::fill_output_obj_seed ( edm::Event iEvent,
std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections 
)
private

Definition at line 200 of file CollectionMerger.cc.

References HLT_2024v14_cff::distance, l1ctLayer1_cff::dr, generator_cfi::drMin, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, iEvent, infinity, valuemaptraslator_cfi::inputCollection, fileCollector::seed, and mathSSE::sqrt().

202  {
203  // track to track map for trackerdriven seed fix
204  edm::Handle<TrackToTrackMapnew> track_ref_map;
205  iEvent.getByToken(inputs_fixtrackrefs_, track_ref_map);
206 
208  iEvent.getByToken(inputs_fixtrackcol_, track_new_col);
209  std::map<reco::TrackRef, reco::TrackRef> simple_track_to_track_map;
210  for (unsigned abc = 0; abc < track_new_col->size(); ++abc) {
211  reco::TrackRef trackRef(track_new_col, abc);
212  simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
213  }
214 
215  // ECAL barrel supercluster collection
217  iEvent.getByToken(inputs_scEB_, scEB);
218  auto bScEB = scEB->cbegin();
219  auto eScEB = scEB->cend();
220 
221  // ECAL endcap supercluster collection
223  iEvent.getByToken(inputs_scEE_, scEE);
224  auto bScEE = scEE->cbegin();
225  auto eScEE = scEE->cend();
226 
227  // First merge the two collections again
228  for (auto const &inputCollection : inputCollections) {
229  for (typename MergeCollection::const_iterator seed = inputCollection->begin(); seed != inputCollection->end();
230  ++seed) {
231  T2 newSeed(*seed);
232 
233  // fix reference to supercluster if seed is ecal driven
234  if (seed->isEcalDriven()) {
235  const reco::ElectronSeed::CaloClusterRef &seedCcRef(seed->caloCluster());
236  if (seedCcRef.isNonnull()) {
237  // find corresponding supercluster in ECAL barrel and endcap
238  float dx, dy, dz, dr;
241  for (auto sc = bScEB; sc != eScEB; ++sc) {
242  const reco::SuperClusterRef &scRef(reco::SuperClusterRef(scEB, std::distance(bScEB, sc)));
243  dx = fabs(scRef->x() - seedCcRef->x());
244  dy = fabs(scRef->y() - seedCcRef->y());
245  dz = fabs(scRef->z() - seedCcRef->z());
246  dr = sqrt(dx * dx + dy * dy + dz * dz);
247  if (dr < drMin) {
248  drMin = dr;
249  ccRefMin = reco::ElectronSeed::CaloClusterRef(scRef);
250  }
251  }
252  for (auto sc = bScEE; sc != eScEE; ++sc) {
253  const reco::SuperClusterRef &scRef(reco::SuperClusterRef(scEE, std::distance(bScEE, sc)));
254  dx = fabs(scRef->x() - seedCcRef->x());
255  dy = fabs(scRef->y() - seedCcRef->y());
256  dz = fabs(scRef->z() - seedCcRef->z());
257  dr = sqrt(dx * dx + dy * dy + dz * dz);
258  if (dr < drMin) {
259  drMin = dr;
260  ccRefMin = reco::ElectronSeed::CaloClusterRef(scRef);
261  }
262  }
263  // set new calocluster if new ref was found
264  if (drMin < 10.0) {
265  newSeed.setCaloCluster(ccRefMin);
266  }
267  }
268  }
269  if (seed->isTrackerDriven()) {
270  const reco::ElectronSeed::CtfTrackRef &ctfTrackRef(seed->ctfTrack());
271  if (ctfTrackRef.isNonnull()) {
272  newSeed.setCtfTrack(simple_track_to_track_map[ctfTrackRef]);
273  }
274  }
275  output->push_back(newSeed);
276  }
277  }
278 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::SuperClusterCollection > inputs_scEB_
T sqrt(T t)
Definition: SSEVec.h:23
const double infinity
edm::EDGetTokenT< reco::SuperClusterCollection > inputs_scEE_
edm::RefToBase< CaloCluster > CaloClusterRef
Definition: ElectronSeed.h:68
Definition: output.py:1
edm::EDGetTokenT< TrackToTrackMapnew > inputs_fixtrackrefs_
edm::EDGetTokenT< reco::TrackCollection > inputs_fixtrackcol_

◆ fill_output_obj_tracker()

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::fill_output_obj_tracker ( std::unique_ptr< MergeCollection > &  output,
std::vector< edm::Handle< MergeCollection >> &  inputCollections,
bool  print_pixel = false 
)
private

Definition at line 102 of file CollectionMerger.cc.

References valuemaptraslator_cfi::inputCollection, and genParticles_cff::map.

104  {
105  std::map<uint32_t, std::vector<BaseHit>> output_map;
106  // First merge the collections with the help of the output map
107  for (auto const &inputCollection : inputCollections) {
108  for (typename MergeCollection::const_iterator clustSet = inputCollection->begin();
109  clustSet != inputCollection->end();
110  ++clustSet) {
111  DetId detIdObject(clustSet->detId());
112  for (typename edmNew::DetSet<BaseHit>::const_iterator clustIt = clustSet->begin(); clustIt != clustSet->end();
113  ++clustIt) {
114  output_map[detIdObject.rawId()].push_back(*clustIt);
115  }
116  }
117  }
118  // Now save it into the standard CMSSW format, with the standard Filler
119  for (typename std::map<uint32_t, std::vector<BaseHit>>::const_iterator outHits = output_map.begin();
120  outHits != output_map.end();
121  ++outHits) {
122  DetId detIdObject(outHits->first);
123  typename MergeCollection::FastFiller spc(*output, detIdObject);
124  for (const auto &Hit : outHits->second) {
125  spc.push_back(Hit);
126  }
127  }
128 }
data_type const * const_iterator
Definition: DetSetNew.h:31
Definition: DetId.h:17
Definition: output.py:1

◆ produce()

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 79 of file CollectionMerger.cc.

References iEvent, eostools::move(), and convertSQLitetoXML_cfg::output.

79  {
80  for (auto input_ : inputs_) {
81  std::unique_ptr<MergeCollection> output(new MergeCollection());
82  std::vector<edm::Handle<MergeCollection>> inputCollections;
83  inputCollections.resize(input_.second.size());
84  for (unsigned id = 0; id < input_.second.size(); id++) {
85  iEvent.getByToken(input_.second[id], inputCollections[id]);
86  }
87  fill_output_obj(iEvent, output, inputCollections);
88  iEvent.put(std::move(output), input_.first);
89  }
90 }
std::map< std::string, std::vector< edm::EDGetTokenT< MergeCollection > > > inputs_
int iEvent
Definition: GenABIO.cc:224
void fill_output_obj(edm::Event &, std::unique_ptr< MergeCollection > &output, std::vector< edm::Handle< MergeCollection >> &inputCollections)
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511

◆ willconsume() [1/2]

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::willconsume ( const edm::ParameterSet iConfig)
private

Definition at line 93 of file CollectionMerger.cc.

93 {}

◆ willconsume() [2/2]

template<>
void CollectionMerger< std::vector< reco::ElectronSeed >, reco::ElectronSeed >::willconsume ( const edm::ParameterSet iConfig)
private

Definition at line 180 of file CollectionMerger.cc.

References ProducerED_cfi::InputTag.

181  {
182  // track refs for trackerdriven seeds
183  inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew>(edm::InputTag("generalTracks"));
184  inputs_fixtrackcol_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
185 
186  // sc refs for ecaldriven seeds
187  inputs_scEB_ = consumes<reco::SuperClusterCollection>(
188  edm::InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"));
189  inputs_scEE_ = consumes<reco::SuperClusterCollection>(
190  edm::InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"));
191 }
edm::EDGetTokenT< reco::SuperClusterCollection > inputs_scEB_
edm::EDGetTokenT< reco::SuperClusterCollection > inputs_scEE_
edm::EDGetTokenT< TrackToTrackMapnew > inputs_fixtrackrefs_
edm::EDGetTokenT< reco::TrackCollection > inputs_fixtrackcol_

◆ willproduce() [1/2]

template<typename T1 , typename T2 >
void CollectionMerger< T1, T2 >::willproduce ( std::string  instance,
std::string  alias 
)
private

Definition at line 96 of file CollectionMerger.cc.

References instance.

96  {
97  produces<MergeCollection>(instance);
98 }
static PFTauRenderPlugin instance

◆ willproduce() [2/2]

template<>
void CollectionMerger< std::vector< reco::ElectronSeed >, reco::ElectronSeed >::willproduce ( std::string  instance,
std::string  alias 
)
private

Definition at line 194 of file CollectionMerger.cc.

References instance.

195  {
196  produces<MergeCollection>(instance);
197 }
static PFTauRenderPlugin instance

Member Data Documentation

◆ inputs_

template<typename T1 , typename T2 >
std::map<std::string, std::vector<edm::EDGetTokenT<MergeCollection> > > CollectionMerger< T1, T2 >::inputs_
private

Definition at line 54 of file CollectionMerger.h.

◆ inputs_fixtrackcol_

template<typename T1 , typename T2 >
edm::EDGetTokenT<reco::TrackCollection> CollectionMerger< T1, T2 >::inputs_fixtrackcol_
private

Definition at line 60 of file CollectionMerger.h.

◆ inputs_fixtrackrefs_

template<typename T1 , typename T2 >
edm::EDGetTokenT<TrackToTrackMapnew> CollectionMerger< T1, T2 >::inputs_fixtrackrefs_
private

Definition at line 59 of file CollectionMerger.h.

◆ inputs_SC_

template<typename T1 , typename T2 >
edm::EDGetTokenT<reco::SuperClusterCollection> CollectionMerger< T1, T2 >::inputs_SC_
private

Definition at line 56 of file CollectionMerger.h.

◆ inputs_scEB_

template<typename T1 , typename T2 >
edm::EDGetTokenT<reco::SuperClusterCollection> CollectionMerger< T1, T2 >::inputs_scEB_
private

Definition at line 56 of file CollectionMerger.h.

◆ inputs_scEE_

template<typename T1 , typename T2 >
edm::EDGetTokenT<reco::SuperClusterCollection> CollectionMerger< T1, T2 >::inputs_scEE_
private

Definition at line 56 of file CollectionMerger.h.