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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 NeutronHitsCollector (const edm::ParameterSet &)
 
 ~NeutronHitsCollector ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual 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::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 ( )
inline

Definition at line 42 of file NeutronHitsCollector.cc.

42 {};

Member Function Documentation

void NeutronHitsCollector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 233 of file NeutronHitsCollector.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 236 of file NeutronHitsCollector.cc.

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

Implements edm::EDProducer.

Definition at line 110 of file NeutronHitsCollector.cc.

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

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