#include <SimGeneral/DataMixingModule/plugins/DataMixingMuonWorker.h>
Public Member Functions | |
void | addMuonPileups (const int bcr, edm::Event *, unsigned int EventId) |
void | addMuonSignals (const edm::Event &e) |
DataMixingMuonWorker (const edm::ParameterSet &ps) | |
standard constructor | |
DataMixingMuonWorker () | |
void | putMuon (edm::Event &e) |
virtual | ~DataMixingMuonWorker () |
Default destructor. | |
Private Attributes | |
edm::InputTag | CSCDigiTag_ |
edm::InputTag | CSCstripdigi_collection_ |
std::string | CSCStripDigiCollectionDM_ |
edm::InputTag | CSCwiredigi_collection_ |
std::string | CSCWireDigiCollectionDM_ |
edm::InputTag | DTdigi_collection_ |
std::string | DTDigiCollectionDM_ |
edm::InputTag | DTDigiTag_ |
std::string | label_ |
CSCStripDigiCollection * | OurCSCStripDigis_ |
CSCWireDigiCollection * | OurCSCWireDigis_ |
DTDigiCollection * | OurDTDigis_ |
RPCDigiCollection * | OurRPCDigis_ |
edm::InputTag | RPCdigi_collection_ |
std::string | RPCDigiCollectionDM_ |
edm::InputTag | RPCDigiTag_ |
Selector * | sel_ |
Definition at line 39 of file DataMixingMuonWorker.h.
DataMixingMuonWorker::DataMixingMuonWorker | ( | ) |
DataMixingMuonWorker::DataMixingMuonWorker | ( | const edm::ParameterSet & | ps | ) | [explicit] |
standard constructor
Definition at line 30 of file DataMixingMuonWorker.cc.
References CSCDigiTag_, CSCstripdigi_collection_, CSCStripDigiCollectionDM_, CSCwiredigi_collection_, CSCWireDigiCollectionDM_, DTdigi_collection_, DTDigiCollectionDM_, DTDigiTag_, edm::ParameterSet::getParameter(), label_, RPCdigi_collection_, RPCDigiCollectionDM_, RPCDigiTag_, and sel_.
00030 : 00031 label_(ps.getParameter<std::string>("Label")) 00032 00033 { 00034 00035 // get the subdetector names 00036 // this->getSubdetectorNames(); //something like this may be useful to check what we are supposed to do... 00037 00038 // create input selector 00039 if (label_.size()>0){ 00040 sel_=new Selector( ModuleLabelSelector(label_)); 00041 } 00042 else { 00043 sel_=new Selector( MatchAllSelector()); 00044 } 00045 00046 // Declare the products to produce 00047 00048 DTDigiTag_ = ps.getParameter<edm::InputTag>("DTDigiTag"); 00049 DTdigi_collection_ = ps.getParameter<edm::InputTag>("DTdigiCollection"); 00050 RPCDigiTag_ = ps.getParameter<edm::InputTag>("RPCDigiTag"); 00051 RPCdigi_collection_ = ps.getParameter<edm::InputTag>("RPCdigiCollection"); 00052 00053 CSCDigiTag_ = ps.getParameter<edm::InputTag>("CSCDigiTag"); 00054 CSCstripdigi_collection_ = ps.getParameter<edm::InputTag>("CSCstripdigiCollection"); 00055 CSCwiredigi_collection_ = ps.getParameter<edm::InputTag>("CSCwiredigiCollection"); 00056 00057 00058 DTDigiCollectionDM_ = ps.getParameter<std::string>("DTDigiCollectionDM"); 00059 RPCDigiCollectionDM_ = ps.getParameter<std::string>("RPCDigiCollectionDM"); 00060 CSCStripDigiCollectionDM_ = ps.getParameter<std::string>("CSCStripDigiCollectionDM"); 00061 CSCWireDigiCollectionDM_ = ps.getParameter<std::string>("CSCWireDigiCollectionDM"); 00062 00063 00064 }
DataMixingMuonWorker::~DataMixingMuonWorker | ( | ) | [virtual] |
void DataMixingMuonWorker::addMuonPileups | ( | const int | bcr, | |
edm::Event * | e, | |||
unsigned int | EventId | |||
) |
Definition at line 188 of file DataMixingMuonWorker.cc.
References edm::Event::getByLabel(), edm::Event::id(), LogDebug, edm::Handle< T >::product(), and range.
00188 { 00189 00190 LogDebug("DataMixingMuonWorker") <<"\n===============> adding pileups from event "<<e->id()<<" for bunchcrossing "<<bcr; 00191 00192 // fill in maps of hits; same code as addSignals, except now applied to the pileup events 00193 00194 // DT 00195 // 00196 00197 Handle<DTDigiCollection> pDTdigis; 00198 00199 // Get the digis from the event 00200 if( e->getByLabel(DTDigiTag_.label(), pDTdigis) ) { 00201 00202 //if(pDTdigis.isValid() ) { cout << "Overlay: have DTDigis" << endl;} 00203 //else { cout << "Overlay: no DTDigis" << endl;} 00204 00205 // Loop over digis, copying them to our own local storage 00206 00207 const DTDigiCollection* DTdigis = pDTdigis.product(); 00208 DTDigiCollection::DigiRangeIterator DLayerIt; 00209 for (DLayerIt = DTdigis->begin(); DLayerIt != DTdigis->end(); ++DLayerIt) { 00210 // The layerId 00211 const DTLayerId& layerId = (*DLayerIt).first; 00212 00213 // Get the iterators over the digis associated with this LayerId 00214 const DTDigiCollection::Range& range = (*DLayerIt).second; 00215 00216 OurDTDigis_->put(range, layerId); 00217 00218 } 00219 } 00220 // RPC 00221 // 00222 00223 // Get the digis from the event 00224 Handle<RPCDigiCollection> pRPCdigis; 00225 00226 if( e->getByLabel(RPCDigiTag_.label(), pRPCdigis) ) { 00227 00228 //if(pRPCdigis.isValid() ) { cout << "Overlay: have RPDCigis" << endl;} 00229 //else { cout << "Overlay: no RPDCigis" << endl;} 00230 00231 // Loop over digis, copying them to our own local storage 00232 00233 const RPCDigiCollection* RPCdigis = pRPCdigis.product(); 00234 RPCDigiCollection::DigiRangeIterator RLayerIt; 00235 for (RLayerIt = RPCdigis->begin(); RLayerIt != RPCdigis->end(); ++RLayerIt) { 00236 // The layerId 00237 const RPCDetId& layerId = (*RLayerIt).first; 00238 00239 // Get the iterators over the digis associated with this LayerId 00240 const RPCDigiCollection::Range& range = (*RLayerIt).second; 00241 00242 OurRPCDigis_->put(range, layerId); 00243 00244 } 00245 } 00246 // CSCStrip 00247 // 00248 00249 // Get the digis from the event 00250 Handle<CSCStripDigiCollection> pCSCStripdigis; 00251 00252 if( e->getByLabel(CSCDigiTag_.label(),CSCstripdigi_collection_.label(), pCSCStripdigis) ) { 00253 00254 //if(pCSCStripdigis.isValid() ) { cout << "Overlay: have CSCStripDigis" << endl;} 00255 //else {cout << "Overlay: no CSCStripDigis" << endl;} 00256 00257 // Loop over digis, copying them to our own local storage 00258 00259 const CSCStripDigiCollection* CSCStripdigis = pCSCStripdigis.product(); 00260 CSCStripDigiCollection::DigiRangeIterator CSLayerIt; 00261 for (CSLayerIt = CSCStripdigis->begin(); CSLayerIt != CSCStripdigis->end(); ++CSLayerIt) { 00262 // The layerId 00263 const CSCDetId& layerId = (*CSLayerIt).first; 00264 00265 // Get the iterators over the digis associated with this LayerId 00266 const CSCStripDigiCollection::Range& range = (*CSLayerIt).second; 00267 00268 OurCSCStripDigis_->put(range, layerId); 00269 00270 } 00271 } 00272 // CSCWire 00273 // 00274 00275 // Get the digis from the event 00276 Handle<CSCWireDigiCollection> pCSCWiredigis; 00277 00278 if( e->getByLabel(CSCDigiTag_.label(),CSCwiredigi_collection_.label(), pCSCWiredigis) ) { 00279 00280 // Loop over digis, copying them to our own local storage 00281 00282 const CSCWireDigiCollection* CSCWiredigis = pCSCWiredigis.product(); 00283 CSCWireDigiCollection::DigiRangeIterator CWLayerIt; 00284 for (CWLayerIt = CSCWiredigis->begin(); CWLayerIt != CSCWiredigis->end(); ++CWLayerIt) { 00285 // The layerId 00286 const CSCDetId& layerId = (*CWLayerIt).first; 00287 00288 // Get the iterators over the digis associated with this LayerId 00289 const CSCWireDigiCollection::Range& range = (*CWLayerIt).second; 00290 00291 OurCSCWireDigis_->put(range, layerId); 00292 00293 } 00294 } 00295 }
void DataMixingMuonWorker::addMuonSignals | ( | const edm::Event & | e | ) |
Definition at line 73 of file DataMixingMuonWorker.cc.
References edm::Event::getByLabel(), edm::Event::id(), LogDebug, edm::Handle< T >::product(), and range.
00073 { 00074 // fill in maps of hits 00075 00076 LogDebug("DataMixingMuonWorker")<<"===============> adding MC signals for "<<e.id(); 00077 00078 // DT 00079 // 00080 00081 OurDTDigis_ = new DTDigiCollection(); 00082 Handle<DTDigiCollection> pDTdigis; 00083 00084 // Get the digis from the event 00085 if( e.getByLabel(DTDigiTag_.label(), pDTdigis) ) { 00086 00087 // LogInfo("DataMixingMuonWorker") << "total # DT Digis: " << DTdigis->size(); 00088 00089 // Loop over digis, copying them to our own local storage 00090 const DTDigiCollection* DTdigis = pDTdigis.product(); 00091 DTDigiCollection::DigiRangeIterator DLayerIt; 00092 for (DLayerIt = DTdigis->begin(); DLayerIt != DTdigis->end(); ++DLayerIt) { 00093 // The layerId 00094 const DTLayerId& layerId = (*DLayerIt).first; 00095 00096 // Get the iterators over the digis associated with this LayerId 00097 const DTDigiCollection::Range& range = (*DLayerIt).second; 00098 00099 OurDTDigis_->put(range, layerId); 00100 } 00101 } 00102 // RPC 00103 // 00104 00105 OurRPCDigis_ = new RPCDigiCollection(); 00106 00107 // Get the digis from the event 00108 Handle<RPCDigiCollection> pRPCdigis; 00109 00110 if( e.getByLabel(RPCDigiTag_.label(), pRPCdigis) ) { 00111 00112 // Loop over digis, copying them to our own local storage 00113 00114 const RPCDigiCollection* RPCdigis = pRPCdigis.product(); 00115 RPCDigiCollection::DigiRangeIterator RLayerIt; 00116 for (RLayerIt = RPCdigis->begin(); RLayerIt != RPCdigis->end(); ++RLayerIt) { 00117 // The layerId 00118 const RPCDetId& layerId = (*RLayerIt).first; 00119 00120 // Get the iterators over the digis associated with this LayerId 00121 const RPCDigiCollection::Range& range = (*RLayerIt).second; 00122 00123 OurRPCDigis_->put(range, layerId); 00124 00125 } 00126 } 00127 // CSCStrip 00128 // 00129 00130 OurCSCStripDigis_ = new CSCStripDigiCollection(); 00131 00132 // Get the digis from the event 00133 Handle<CSCStripDigiCollection> pCSCStripdigis; 00134 00135 if( e.getByLabel(CSCDigiTag_.label(),CSCstripdigi_collection_.label(), pCSCStripdigis) ) { 00136 00137 //if(pCSCStripdigis.isValid() ) { cout << "Signal: have CSCStripDigis" << endl;} 00138 //else { cout << "Signal: NO CSCStripDigis" << endl;} 00139 00140 00141 // Loop over digis, copying them to our own local storage 00142 00143 const CSCStripDigiCollection* CSCStripdigis = pCSCStripdigis.product(); 00144 CSCStripDigiCollection::DigiRangeIterator CSLayerIt; 00145 for (CSLayerIt = CSCStripdigis->begin(); CSLayerIt != CSCStripdigis->end(); ++CSLayerIt) { 00146 // The layerId 00147 const CSCDetId& layerId = (*CSLayerIt).first; 00148 00149 // Get the iterators over the digis associated with this LayerId 00150 const CSCStripDigiCollection::Range& range = (*CSLayerIt).second; 00151 00152 OurCSCStripDigis_->put(range, layerId); 00153 } 00154 } 00155 // CSCWire 00156 // 00157 00158 OurCSCWireDigis_ = new CSCWireDigiCollection(); 00159 00160 // Get the digis from the event 00161 Handle<CSCWireDigiCollection> pCSCWiredigis; 00162 00163 if( e.getByLabel(CSCDigiTag_.label(),CSCwiredigi_collection_.label(), pCSCWiredigis) ) { 00164 00165 00166 //if(pCSCWiredigis.isValid() ) { cout << "Signal: have CSCWireDigis" << endl;} 00167 //else { cout << "Signal: NO CSCWireDigis" << endl;} 00168 00169 // Loop over digis, copying them to our own local storage 00170 00171 const CSCWireDigiCollection* CSCWiredigis = pCSCWiredigis.product(); 00172 CSCWireDigiCollection::DigiRangeIterator CWLayerIt; 00173 for (CWLayerIt = CSCWiredigis->begin(); CWLayerIt != CSCWiredigis->end(); ++CWLayerIt) { 00174 // The layerId 00175 const CSCDetId& layerId = (*CWLayerIt).first; 00176 00177 // Get the iterators over the digis associated with this LayerId 00178 const CSCWireDigiCollection::Range& range = (*CWLayerIt).second; 00179 00180 OurCSCWireDigis_->put(range, layerId); 00181 00182 } 00183 } 00184 00185 00186 } // end of addMuonSignals
void DataMixingMuonWorker::putMuon | ( | edm::Event & | e | ) |
Definition at line 297 of file DataMixingMuonWorker.cc.
References edm::Event::put(), and range.
00297 { 00298 00299 // collections of digis to put in the event 00300 std::auto_ptr< DTDigiCollection > DTDigiMerge( new DTDigiCollection ); 00301 std::auto_ptr< RPCDigiCollection > RPCDigiMerge( new RPCDigiCollection ); 00302 std::auto_ptr< CSCStripDigiCollection > CSCStripDigiMerge( new CSCStripDigiCollection ); 00303 std::auto_ptr< CSCWireDigiCollection > CSCWireDigiMerge( new CSCWireDigiCollection ); 00304 00305 // Loop over DT digis, copying them from our own local storage 00306 00307 DTDigiCollection::DigiRangeIterator DLayerIt; 00308 for (DLayerIt = OurDTDigis_->begin(); DLayerIt != OurDTDigis_->end(); ++DLayerIt) { 00309 // The layerId 00310 const DTLayerId& layerId = (*DLayerIt).first; 00311 00312 // Get the iterators over the digis associated with this LayerId 00313 const DTDigiCollection::Range& range = (*DLayerIt).second; 00314 00315 DTDigiMerge->put(range, layerId); 00316 00317 } 00318 00319 // Loop over RPC digis, copying them from our own local storage 00320 00321 RPCDigiCollection::DigiRangeIterator RLayerIt; 00322 for (RLayerIt = OurRPCDigis_->begin(); RLayerIt != OurRPCDigis_->end(); ++RLayerIt) { 00323 // The layerId 00324 const RPCDetId& layerId = (*RLayerIt).first; 00325 00326 // Get the iterators over the digis associated with this LayerId 00327 const RPCDigiCollection::Range& range = (*RLayerIt).second; 00328 00329 RPCDigiMerge->put(range, layerId); 00330 00331 } 00332 // Loop over CSCStrip digis, copying them from our own local storage 00333 00334 CSCStripDigiCollection::DigiRangeIterator CSLayerIt; 00335 for (CSLayerIt = OurCSCStripDigis_->begin(); CSLayerIt != OurCSCStripDigis_->end(); ++CSLayerIt) { 00336 // The layerId 00337 const CSCDetId& layerId = (*CSLayerIt).first; 00338 00339 // Get the iterators over the digis associated with this LayerId 00340 const CSCStripDigiCollection::Range& range = (*CSLayerIt).second; 00341 00342 CSCStripDigiMerge->put(range, layerId); 00343 00344 } 00345 // Loop over CSCStrip digis, copying them from our own local storage 00346 00347 CSCWireDigiCollection::DigiRangeIterator CWLayerIt; 00348 for (CWLayerIt = OurCSCWireDigis_->begin(); CWLayerIt != OurCSCWireDigis_->end(); ++CWLayerIt) { 00349 // The layerId 00350 const CSCDetId& layerId = (*CWLayerIt).first; 00351 00352 // Get the iterators over the digis associated with this LayerId 00353 const CSCWireDigiCollection::Range& range = (*CWLayerIt).second; 00354 00355 CSCWireDigiMerge->put(range, layerId); 00356 00357 } 00358 00359 00360 // put the collection of recunstructed hits in the event 00361 //LogInfo("DataMixingMuonWorker") << "total # DT Merged Digis: " << DTDigiMerge->size() ; 00362 //LogInfo("DataMixingMuonWorker") << "total # RPC Merged Digis: " << RPCDigiMerge->size() ; 00363 //LogInfo("DataMixingMuonWorker") << "total # CSCStrip Merged Digis: " << CSCStripDigiMerge->size() ; 00364 //LogInfo("DataMixingMuonWorker") << "total # CSCWire Merged Digis: " << CSCWireDigiMerge->size() ; 00365 00366 e.put( DTDigiMerge, DTDigiCollectionDM_ ); 00367 e.put( RPCDigiMerge, RPCDigiCollectionDM_ ); 00368 e.put( CSCStripDigiMerge, CSCStripDigiCollectionDM_ ); 00369 e.put( CSCWireDigiMerge, CSCWireDigiCollectionDM_ ); 00370 00371 // clear local storage for this event 00372 delete OurDTDigis_; 00373 delete OurRPCDigis_; 00374 delete OurCSCStripDigis_; 00375 delete OurCSCWireDigis_; 00376 00377 00378 }
std::string edm::DataMixingMuonWorker::CSCStripDigiCollectionDM_ [private] |
std::string edm::DataMixingMuonWorker::CSCWireDigiCollectionDM_ [private] |
std::string edm::DataMixingMuonWorker::DTDigiCollectionDM_ [private] |
std::string edm::DataMixingMuonWorker::label_ [private] |
Definition at line 77 of file DataMixingMuonWorker.h.
Definition at line 78 of file DataMixingMuonWorker.h.
Definition at line 75 of file DataMixingMuonWorker.h.
Definition at line 76 of file DataMixingMuonWorker.h.
std::string edm::DataMixingMuonWorker::RPCDigiCollectionDM_ [private] |
Selector* edm::DataMixingMuonWorker::sel_ [private] |