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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 38 of file NeutronHitsCollector.cc.

Constructor & Destructor Documentation

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

Definition at line 56 of file NeutronHitsCollector.cc.

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

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

Definition at line 42 of file NeutronHitsCollector.cc.

References beginJob(), endJob(), and produce().

42 {};

Member Function Documentation

void NeutronHitsCollector::beginJob ( void  )
privatevirtual

Definition at line 233 of file NeutronHitsCollector.cc.

Referenced by ~NeutronHitsCollector().

233 {}
void NeutronHitsCollector::endJob ( void  )
privatevirtual

Definition at line 236 of file NeutronHitsCollector.cc.

References DEFINE_FWK_MODULE.

Referenced by ~NeutronHitsCollector().

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

Definition at line 110 of file NeutronHitsCollector.cc.

References edm::Event::getByLabel(), eostools::move(), neutron_label_csc, neutron_label_dt, neutron_label_rpc, and edm::Event::put().

Referenced by ~NeutronHitsCollector().

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

Member Data Documentation

std::string NeutronHitsCollector::neutron_label_csc
private

Definition at line 49 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

std::string NeutronHitsCollector::neutron_label_dt
private

Definition at line 50 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

std::string NeutronHitsCollector::neutron_label_rpc
private

Definition at line 51 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().