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
 
- 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

std::string neutron_label_csc
 
std::string neutron_label_dt
 
std::string neutron_label_rpc
 

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 51 of file NeutronHitsCollector.cc.

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

References edm::ParameterSet::getUntrackedParameter(), neutron_label_csc, neutron_label_dt, neutron_label_rpc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~NeutronHitsCollector()

NeutronHitsCollector::~NeutronHitsCollector ( )
inlineoverride

Definition at line 39 of file NeutronHitsCollector.cc.

39 {};

Member Function Documentation

◆ beginJob()

void NeutronHitsCollector::beginJob ( void  )
privatevirtual

Definition at line 221 of file NeutronHitsCollector.cc.

221 {}

◆ endJob()

void NeutronHitsCollector::endJob ( void  )
privatevirtual

Definition at line 223 of file NeutronHitsCollector.cc.

223 {}

◆ produce()

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

Definition at line 102 of file NeutronHitsCollector.cc.

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

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

Member Data Documentation

◆ neutron_label_csc

std::string NeutronHitsCollector::neutron_label_csc
private

Definition at line 46 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

◆ neutron_label_dt

std::string NeutronHitsCollector::neutron_label_dt
private

Definition at line 47 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

◆ neutron_label_rpc

std::string NeutronHitsCollector::neutron_label_rpc
private

Definition at line 48 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

NeutronHitsCollector::neutron_label_dt
std::string neutron_label_dt
Definition: NeutronHitsCollector.cc:47
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle< edm::PSimHitContainer >
NeutronHitsCollector::neutron_label_rpc
std::string neutron_label_rpc
Definition: NeutronHitsCollector.cc:48
iEvent
int iEvent
Definition: GenABIO.cc:224
NeutronHitsCollector::neutron_label_csc
std::string neutron_label_csc
Definition: NeutronHitsCollector.cc:46
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
hit
Definition: SiStripHitEffFromCalibTree.cc:88