CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
NeutronHitsCollector Class Reference

#include <SimMuon/Neutron/plugins/NeutronHitsCollector.cc>

Inheritance diagram for NeutronHitsCollector:
edm::stream::EDProducer<>

Public Member Functions

 NeutronHitsCollector (const edm::ParameterSet &)
 
 ~NeutronHitsCollector () override=default
 
- 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 Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const std::string neutron_label_csc
 
const std::string neutron_label_dt
 
const std::string neutron_label_rpc
 
const edm::EDGetTokenT< edm::PSimHitContainertokenCSC_
 
const edm::EDGetTokenT< edm::PSimHitContainertokenDT_
 
const edm::EDGetTokenT< edm::PSimHitContainertokenRPC_
 

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

Description: Utility for neutron SimHits produced by CSC/RPC/DTNeutronWriter modules. Re-packs neutron simhits in muon detectors into new collections that have a single module label. Creates a bunch of empty collections with the same module label to make MixingModule happy

Definition at line 36 of file NeutronHitsCollector.cc.

Constructor & Destructor Documentation

◆ NeutronHitsCollector()

NeutronHitsCollector::NeutronHitsCollector ( const edm::ParameterSet iConfig)
explicit

Definition at line 54 of file NeutronHitsCollector.cc.

55  : neutron_label_csc(iConfig.getUntrackedParameter<std::string>("neutronLabelCSC", "")),
56  neutron_label_dt(iConfig.getUntrackedParameter<std::string>("neutronLabelDT", "")),
57  neutron_label_rpc(iConfig.getUntrackedParameter<std::string>("neutronLabelRPC", "")),
58  tokenCSC_(consumes<edm::PSimHitContainer>(neutron_label_csc)),
59  tokenDT_(consumes<edm::PSimHitContainer>(neutron_label_dt)),
60  tokenRPC_(consumes<edm::PSimHitContainer>(neutron_label_rpc)) {
61  // The following list duplicates
62  // http://cmslxr.fnal.gov/lxr/source/SimG4Core/Application/plugins/OscarProducer.cc
63 
64  produces<edm::PSimHitContainer>("MuonDTHits");
65  produces<edm::PSimHitContainer>("MuonCSCHits");
66  produces<edm::PSimHitContainer>("MuonRPCHits");
67 
68  produces<edm::SimTrackContainer>().setBranchAlias("SimTracks");
69  produces<edm::SimVertexContainer>().setBranchAlias("SimVertices");
70 
71  produces<edm::PSimHitContainer>("TrackerHitsPixelBarrelLowTof");
72  produces<edm::PSimHitContainer>("TrackerHitsPixelBarrelHighTof");
73  produces<edm::PSimHitContainer>("TrackerHitsTIBLowTof");
74  produces<edm::PSimHitContainer>("TrackerHitsTIBHighTof");
75  produces<edm::PSimHitContainer>("TrackerHitsTIDLowTof");
76  produces<edm::PSimHitContainer>("TrackerHitsTIDHighTof");
77  produces<edm::PSimHitContainer>("TrackerHitsPixelEndcapLowTof");
78  produces<edm::PSimHitContainer>("TrackerHitsPixelEndcapHighTof");
79  produces<edm::PSimHitContainer>("TrackerHitsTOBLowTof");
80  produces<edm::PSimHitContainer>("TrackerHitsTOBHighTof");
81  produces<edm::PSimHitContainer>("TrackerHitsTECLowTof");
82  produces<edm::PSimHitContainer>("TrackerHitsTECHighTof");
83 
84  produces<edm::PSimHitContainer>("TotemHitsT1");
85  produces<edm::PSimHitContainer>("TotemHitsT2Gem");
86  produces<edm::PSimHitContainer>("TotemHitsRP");
87  produces<edm::PSimHitContainer>("FP420SI");
88  produces<edm::PSimHitContainer>("BSCHits");
89 
90  produces<edm::PCaloHitContainer>("EcalHitsEB");
91  produces<edm::PCaloHitContainer>("EcalHitsEE");
92  produces<edm::PCaloHitContainer>("EcalHitsES");
93  produces<edm::PCaloHitContainer>("HcalHits");
94  produces<edm::PCaloHitContainer>("CaloHitsTk");
95  produces<edm::PCaloHitContainer>("CastorPL");
96  produces<edm::PCaloHitContainer>("CastorFI");
97  produces<edm::PCaloHitContainer>("CastorBU");
98  produces<edm::PCaloHitContainer>("CastorTU");
99  produces<edm::PCaloHitContainer>("EcalTBH4BeamHits");
100  produces<edm::PCaloHitContainer>("HcalTB06BeamHits");
101  produces<edm::PCaloHitContainer>("ZDCHITS");
102  //produces<edm::PCaloHitContainer>("ChamberHits");
103  //produces<edm::PCaloHitContainer>("FibreHits");
104  //produces<edm::PCaloHitContainer>("WedgeHits");
105 }
const std::string neutron_label_rpc
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< edm::PSimHitContainer > tokenDT_
const edm::EDGetTokenT< edm::PSimHitContainer > tokenRPC_
const std::string neutron_label_dt
const edm::EDGetTokenT< edm::PSimHitContainer > tokenCSC_
const std::string neutron_label_csc

◆ ~NeutronHitsCollector()

NeutronHitsCollector::~NeutronHitsCollector ( )
overridedefault

Member Function Documentation

◆ beginJob()

void NeutronHitsCollector::beginJob ( void  )
privatevirtual

Definition at line 223 of file NeutronHitsCollector.cc.

223 {}

◆ endJob()

void NeutronHitsCollector::endJob ( void  )
privatevirtual

Definition at line 225 of file NeutronHitsCollector.cc.

225 {}

◆ produce()

void NeutronHitsCollector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 107 of file NeutronHitsCollector.cc.

References iEvent, eostools::move(), neutron_label_csc, neutron_label_dt, neutron_label_rpc, tokenCSC_, tokenDT_, and tokenRPC_.

107  {
108  edm::PSimHitContainer::const_iterator hit;
109 
110  // ----- MuonCSCHits -----
111  //
112  std::unique_ptr<edm::PSimHitContainer> simCSC(new edm::PSimHitContainer);
113  if (neutron_label_csc.length() > 0) {
114  const edm::Handle<edm::PSimHitContainer>& MuonCSCHits = iEvent.getHandle(tokenCSC_);
115  for (hit = MuonCSCHits->begin(); hit != MuonCSCHits->end(); ++hit)
116  simCSC->push_back(*hit);
117  }
118  iEvent.put(std::move(simCSC), "MuonCSCHits");
119 
120  // ----- MuonDTHits -----
121  //
122  std::unique_ptr<edm::PSimHitContainer> simDT(new edm::PSimHitContainer);
123  if (neutron_label_dt.length() > 0) {
124  const edm::Handle<edm::PSimHitContainer>& MuonDTHits = iEvent.getHandle(tokenDT_);
125  for (hit = MuonDTHits->begin(); hit != MuonDTHits->end(); ++hit)
126  simDT->push_back(*hit);
127  }
128  iEvent.put(std::move(simDT), "MuonDTHits");
129 
130  // ----- MuonRPCHits -----
131  //
132  std::unique_ptr<edm::PSimHitContainer> simRPC(new edm::PSimHitContainer);
133  if (neutron_label_rpc.length() > 0) {
134  const edm::Handle<edm::PSimHitContainer>& MuonRPCHits = iEvent.getHandle(tokenRPC_);
135  for (hit = MuonRPCHits->begin(); hit != MuonRPCHits->end(); ++hit)
136  simRPC->push_back(*hit);
137  }
138  iEvent.put(std::move(simRPC), "MuonRPCHits");
139 
140  // Further, produce a bunch of empty collections
141 
142  // ----- calorimetry -----
143  //
144  std::unique_ptr<edm::PCaloHitContainer> calout1(new edm::PCaloHitContainer);
145  iEvent.put(std::move(calout1), "EcalHitsEB");
146  std::unique_ptr<edm::PCaloHitContainer> calout2(new edm::PCaloHitContainer);
147  iEvent.put(std::move(calout2), "EcalHitsEE");
148  std::unique_ptr<edm::PCaloHitContainer> calout3(new edm::PCaloHitContainer);
149  iEvent.put(std::move(calout3), "EcalHitsES");
150  std::unique_ptr<edm::PCaloHitContainer> calout4(new edm::PCaloHitContainer);
151  iEvent.put(std::move(calout4), "HcalHits");
152  std::unique_ptr<edm::PCaloHitContainer> calout5(new edm::PCaloHitContainer);
153  iEvent.put(std::move(calout5), "CaloHitsTk");
154  std::unique_ptr<edm::PCaloHitContainer> calout6(new edm::PCaloHitContainer);
155  iEvent.put(std::move(calout6), "CastorPL");
156  std::unique_ptr<edm::PCaloHitContainer> calout7(new edm::PCaloHitContainer);
157  iEvent.put(std::move(calout7), "CastorFI");
158  std::unique_ptr<edm::PCaloHitContainer> calout8(new edm::PCaloHitContainer);
159  iEvent.put(std::move(calout8), "CastorBU");
160  std::unique_ptr<edm::PCaloHitContainer> calout9(new edm::PCaloHitContainer);
161  iEvent.put(std::move(calout9), "CastorTU");
162  std::unique_ptr<edm::PCaloHitContainer> calout10(new edm::PCaloHitContainer);
163  iEvent.put(std::move(calout10), "EcalTBH4BeamHits");
164  std::unique_ptr<edm::PCaloHitContainer> calout11(new edm::PCaloHitContainer);
165  iEvent.put(std::move(calout11), "HcalTB06BeamHits");
166  std::unique_ptr<edm::PCaloHitContainer> calout12(new edm::PCaloHitContainer);
167  iEvent.put(std::move(calout12), "ZDCHITS");
168  //std::unique_ptr<edm::PCaloHitContainer> calout13(new edm::PCaloHitContainer);
169  //iEvent.put(std::move(calout13), "ChamberHits");
170  //std::unique_ptr<edm::PCaloHitContainer> calout14(new edm::PCaloHitContainer);
171  //iEvent.put(std::move(calout14), "FibreHits");
172  //std::unique_ptr<edm::PCaloHitContainer> calout15(new edm::PCaloHitContainer);
173  //iEvent.put(std::move(calout15), "WedgeHits");
174 
175  // ----- Tracker -----
176  //
177  std::unique_ptr<edm::PSimHitContainer> trout1(new edm::PSimHitContainer);
178  iEvent.put(std::move(trout1), "TrackerHitsPixelBarrelLowTof");
179  std::unique_ptr<edm::PSimHitContainer> trout2(new edm::PSimHitContainer);
180  iEvent.put(std::move(trout2), "TrackerHitsPixelBarrelHighTof");
181  std::unique_ptr<edm::PSimHitContainer> trout3(new edm::PSimHitContainer);
182  iEvent.put(std::move(trout3), "TrackerHitsTIBLowTof");
183  std::unique_ptr<edm::PSimHitContainer> trout4(new edm::PSimHitContainer);
184  iEvent.put(std::move(trout4), "TrackerHitsTIBHighTof");
185  std::unique_ptr<edm::PSimHitContainer> trout5(new edm::PSimHitContainer);
186  iEvent.put(std::move(trout5), "TrackerHitsTIDLowTof");
187  std::unique_ptr<edm::PSimHitContainer> trout6(new edm::PSimHitContainer);
188  iEvent.put(std::move(trout6), "TrackerHitsTIDHighTof");
189  std::unique_ptr<edm::PSimHitContainer> trout7(new edm::PSimHitContainer);
190  iEvent.put(std::move(trout7), "TrackerHitsPixelEndcapLowTof");
191  std::unique_ptr<edm::PSimHitContainer> trout8(new edm::PSimHitContainer);
192  iEvent.put(std::move(trout8), "TrackerHitsPixelEndcapHighTof");
193  std::unique_ptr<edm::PSimHitContainer> trout9(new edm::PSimHitContainer);
194  iEvent.put(std::move(trout9), "TrackerHitsTOBLowTof");
195  std::unique_ptr<edm::PSimHitContainer> trout10(new edm::PSimHitContainer);
196  iEvent.put(std::move(trout10), "TrackerHitsTOBHighTof");
197  std::unique_ptr<edm::PSimHitContainer> trout11(new edm::PSimHitContainer);
198  iEvent.put(std::move(trout11), "TrackerHitsTECLowTof");
199  std::unique_ptr<edm::PSimHitContainer> trout12(new edm::PSimHitContainer);
200  iEvent.put(std::move(trout12), "TrackerHitsTECHighTof");
201 
202  // ----- Forward stuff -----
203  //
204  std::unique_ptr<edm::PSimHitContainer> fwout1(new edm::PSimHitContainer);
205  iEvent.put(std::move(fwout1), "TotemHitsT1");
206  std::unique_ptr<edm::PSimHitContainer> fwout2(new edm::PSimHitContainer);
207  iEvent.put(std::move(fwout2), "TotemHitsT2Gem");
208  std::unique_ptr<edm::PSimHitContainer> fwout3(new edm::PSimHitContainer);
209  iEvent.put(std::move(fwout3), "TotemHitsRP");
210  std::unique_ptr<edm::PSimHitContainer> fwout4(new edm::PSimHitContainer);
211  iEvent.put(std::move(fwout4), "FP420SI");
212  std::unique_ptr<edm::PSimHitContainer> fwout5(new edm::PSimHitContainer);
213  iEvent.put(std::move(fwout5), "BSCHits");
214 
215  // ----- SimTracks & SimVertices -----
216  //
217  std::unique_ptr<edm::SimTrackContainer> simTr(new edm::SimTrackContainer);
218  iEvent.put(std::move(simTr));
219  std::unique_ptr<edm::SimVertexContainer> simVe(new edm::SimVertexContainer);
220  iEvent.put(std::move(simVe));
221 }
std::vector< PCaloHit > PCaloHitContainer
const std::string neutron_label_rpc
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< edm::PSimHitContainer > tokenDT_
const edm::EDGetTokenT< edm::PSimHitContainer > tokenRPC_
const std::string neutron_label_dt
std::vector< SimVertex > SimVertexContainer
std::vector< PSimHit > PSimHitContainer
std::vector< SimTrack > SimTrackContainer
const edm::EDGetTokenT< edm::PSimHitContainer > tokenCSC_
def move(src, dest)
Definition: eostools.py:511
const std::string neutron_label_csc

Member Data Documentation

◆ neutron_label_csc

const std::string NeutronHitsCollector::neutron_label_csc
private

Definition at line 46 of file NeutronHitsCollector.cc.

Referenced by produce().

◆ neutron_label_dt

const std::string NeutronHitsCollector::neutron_label_dt
private

Definition at line 47 of file NeutronHitsCollector.cc.

Referenced by produce().

◆ neutron_label_rpc

const std::string NeutronHitsCollector::neutron_label_rpc
private

Definition at line 48 of file NeutronHitsCollector.cc.

Referenced by produce().

◆ tokenCSC_

const edm::EDGetTokenT<edm::PSimHitContainer> NeutronHitsCollector::tokenCSC_
private

Definition at line 49 of file NeutronHitsCollector.cc.

Referenced by produce().

◆ tokenDT_

const edm::EDGetTokenT<edm::PSimHitContainer> NeutronHitsCollector::tokenDT_
private

Definition at line 50 of file NeutronHitsCollector.cc.

Referenced by produce().

◆ tokenRPC_

const edm::EDGetTokenT<edm::PSimHitContainer> NeutronHitsCollector::tokenRPC_
private

Definition at line 51 of file NeutronHitsCollector.cc.

Referenced by produce().