CMS 3D CMS Logo

NeutronHitsCollector.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SimMuon/Neutron
4 // Class: NeutronHitsCollector
5 //
15 //
16 // Original Author: Vadim Khotilovich
17 // Created: Mon Aug 09 19:11:42 CST 2010
18 //
19 //
20 
24 
27 
29 
32 
35 
37 public:
38  explicit NeutronHitsCollector(const edm::ParameterSet&);
39  ~NeutronHitsCollector() override{};
40 
41 private:
42  virtual void beginJob();
43  void produce(edm::Event&, const edm::EventSetup&) override;
44  virtual void endJob();
45 
49 };
50 
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 }
101 
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 }
220 
222 
224 
225 //define this as a plug-in
NeutronHitsCollector::endJob
virtual void endJob()
Definition: NeutronHitsCollector.cc:223
NeutronHitsCollector::~NeutronHitsCollector
~NeutronHitsCollector() override
Definition: NeutronHitsCollector.cc:39
NeutronHitsCollector
Definition: NeutronHitsCollector.cc:36
ESHandle.h
NeutronHitsCollector::neutron_label_dt
std::string neutron_label_dt
Definition: NeutronHitsCollector.cc:47
PSimHitContainer.h
NeutronHitsCollector::NeutronHitsCollector
NeutronHitsCollector(const edm::ParameterSet &)
Definition: NeutronHitsCollector.cc:51
EDProducer.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle< edm::PSimHitContainer >
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
NeutronHitsCollector::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: NeutronHitsCollector.cc:102
NeutronHitsCollector::beginJob
virtual void beginJob()
Definition: NeutronHitsCollector.cc:221
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
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
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
Frameworkfwd.h
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
PCaloHitContainer.h
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
ParameterSet.h
edm::Event
Definition: Event.h:73
SimTrackContainer.h
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
SimVertexContainer.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88