CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 NeutronHitsCollector (const edm::ParameterSet &)
 
 ~NeutronHitsCollector ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

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::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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

Constructor & Destructor Documentation

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

Definition at line 57 of file NeutronHitsCollector.cc.

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

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

Definition at line 43 of file NeutronHitsCollector.cc.

43 {};

Member Function Documentation

void NeutronHitsCollector::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 234 of file NeutronHitsCollector.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 237 of file NeutronHitsCollector.cc.

237 {}
void NeutronHitsCollector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 111 of file NeutronHitsCollector.cc.

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

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

Member Data Documentation

std::string NeutronHitsCollector::neutron_label_csc
private

Definition at line 50 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

std::string NeutronHitsCollector::neutron_label_dt
private

Definition at line 51 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().

std::string NeutronHitsCollector::neutron_label_rpc
private

Definition at line 52 of file NeutronHitsCollector.cc.

Referenced by NeutronHitsCollector(), and produce().