CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::DataMixingMuonWorker Class Reference

#include <DataMixingMuonWorker.h>

List of all members.

Public Member Functions

void addMuonPileups (const int bcr, const edm::EventPrincipal *, unsigned int EventId)
void addMuonSignals (const edm::Event &e)
 DataMixingMuonWorker (const edm::ParameterSet &ps)
 DataMixingMuonWorker ()
void putMuon (edm::Event &e)
virtual ~DataMixingMuonWorker ()

Private Attributes

std::string CSCComparatorDigiCollectionDM_
edm::InputTag CSCCompdigi_collectionSig_
edm::InputTag CSCCompPileInputTag_
edm::InputTag CSCDigiTagSig_
edm::InputTag CSCstripdigi_collectionSig_
std::string CSCStripDigiCollectionDM_
edm::InputTag CSCStripPileInputTag_
edm::InputTag CSCwiredigi_collectionSig_
std::string CSCWireDigiCollectionDM_
edm::InputTag CSCWirePileInputTag_
edm::InputTag DTdigi_collectionSig_
std::string DTDigiCollectionDM_
edm::InputTag DTDigiTagSig_
edm::InputTag DTPileInputTag_
std::string label_
CSCComparatorDigiCollectionOurCSCComparatorDigis_
CSCStripDigiCollectionOurCSCStripDigis_
CSCWireDigiCollectionOurCSCWireDigis_
DTDigiCollectionOurDTDigis_
RPCDigiCollectionOurRPCDigis_
edm::InputTag RPCdigi_collectionSig_
std::string RPCDigiCollectionDM_
edm::InputTag RPCDigiTagSig_
edm::InputTag RPCPileInputTag_
Selectorsel_

Detailed Description

Definition at line 41 of file DataMixingMuonWorker.h.


Constructor & Destructor Documentation

DataMixingMuonWorker::DataMixingMuonWorker ( )

Definition at line 27 of file DataMixingMuonWorker.cc.

{ sel_=0;} 
DataMixingMuonWorker::DataMixingMuonWorker ( const edm::ParameterSet ps) [explicit]

standard constructor

Definition at line 30 of file DataMixingMuonWorker.cc.

References CSCComparatorDigiCollectionDM_, CSCCompdigi_collectionSig_, CSCCompPileInputTag_, CSCstripdigi_collectionSig_, CSCStripDigiCollectionDM_, CSCStripPileInputTag_, CSCwiredigi_collectionSig_, CSCWireDigiCollectionDM_, CSCWirePileInputTag_, DTDigiCollectionDM_, DTDigiTagSig_, DTPileInputTag_, edm::ParameterSet::getParameter(), label_, RPCDigiCollectionDM_, RPCDigiTagSig_, RPCPileInputTag_, and sel_.

                                                                      : 
                                                            label_(ps.getParameter<std::string>("Label"))

  {                                                         

    // get the subdetector names
    //    this->getSubdetectorNames();  //something like this may be useful to check what we are supposed to do...

    // create input selector
    if (label_.size()>0){
      sel_=new Selector( ModuleLabelSelector(label_));
    }
    else {
      sel_=new Selector( MatchAllSelector());
    }

    // Declare the products to produce

    DTDigiTagSig_           = ps.getParameter<edm::InputTag>("DTDigiTagSig");
    RPCDigiTagSig_          = ps.getParameter<edm::InputTag>("RPCDigiTagSig");

    CSCstripdigi_collectionSig_   = ps.getParameter<edm::InputTag>("CSCstripdigiCollectionSig");
    CSCwiredigi_collectionSig_    = ps.getParameter<edm::InputTag>("CSCwiredigiCollectionSig");
    CSCCompdigi_collectionSig_    = ps.getParameter<edm::InputTag>("CSCCompdigiCollectionSig");

    DTPileInputTag_       = ps.getParameter<edm::InputTag>("DTPileInputTag");
    RPCPileInputTag_      = ps.getParameter<edm::InputTag>("RPCPileInputTag");
    CSCWirePileInputTag_  = ps.getParameter<edm::InputTag>("CSCWirePileInputTag");
    CSCStripPileInputTag_ = ps.getParameter<edm::InputTag>("CSCStripPileInputTag");
    CSCCompPileInputTag_  = ps.getParameter<edm::InputTag>("CSCCompPileInputTag");

    // outputs:

    DTDigiCollectionDM_  = ps.getParameter<std::string>("DTDigiCollectionDM");
    RPCDigiCollectionDM_ = ps.getParameter<std::string>("RPCDigiCollectionDM");
    CSCStripDigiCollectionDM_ = ps.getParameter<std::string>("CSCStripDigiCollectionDM");
    CSCWireDigiCollectionDM_  = ps.getParameter<std::string>("CSCWireDigiCollectionDM");
    CSCComparatorDigiCollectionDM_  = ps.getParameter<std::string>("CSCComparatorDigiCollectionDM");


  }
DataMixingMuonWorker::~DataMixingMuonWorker ( ) [virtual]

Default destructor

Definition at line 74 of file DataMixingMuonWorker.cc.

References sel_.

                                              { 
    delete sel_;
    sel_=0;
  }  

Member Function Documentation

void DataMixingMuonWorker::addMuonPileups ( const int  bcr,
const edm::EventPrincipal ep,
unsigned int  EventId 
)

Definition at line 226 of file DataMixingMuonWorker.cc.

References CSCCompPileInputTag_, CSCStripPileInputTag_, CSCWirePileInputTag_, DTPileInputTag_, edm::EventPrincipal::id(), LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, and RPCPileInputTag_.

Referenced by edm::DataMixingModule::pileWorker().

                                                                                                         {
  
    LogDebug("DataMixingMuonWorker") <<"\n===============> adding pileups from event  "<<ep->id()<<" for bunchcrossing "<<bcr;

    // fill in maps of hits; same code as addSignals, except now applied to the pileup events

    // DT
    // 
    // Get the digis from the event

   boost::shared_ptr<Wrapper<DTDigiCollection>  const> DTDigisPTR = 
          getProductByTag<DTDigiCollection>(*ep, DTPileInputTag_ );
 
   if(DTDigisPTR ) {

     const DTDigiCollection*  DTDigis = const_cast< DTDigiCollection * >(DTDigisPTR->product());

     DTDigiCollection::DigiRangeIterator DTLayerIt;
     for (DTLayerIt = DTDigis->begin(); DTLayerIt != DTDigis->end(); ++DTLayerIt) {
        // The layerId
        const DTLayerId& layerId = (*DTLayerIt).first;

        // Get the iterators over the Digis associated with this LayerId
        const DTDigiCollection::Range& range = (*DTLayerIt).second;

        OurDTDigis_->put(range, layerId);
      
      }
    }
    // RPC
    // 

    // Get the digis from the event


   boost::shared_ptr<Wrapper<RPCDigiCollection>  const> RPCDigisPTR = 
          getProductByTag<RPCDigiCollection>(*ep, RPCPileInputTag_ );
 
   if(RPCDigisPTR ) {

     const RPCDigiCollection*  RPCDigis = const_cast< RPCDigiCollection * >(RPCDigisPTR->product());

     RPCDigiCollection::DigiRangeIterator RPCLayerIt;
     for (RPCLayerIt = RPCDigis->begin(); RPCLayerIt != RPCDigis->end(); ++RPCLayerIt) {
        // The layerId
        const RPCDetId& layerId = (*RPCLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const RPCDigiCollection::Range& range = (*RPCLayerIt).second;

        OurRPCDigis_->put(range, layerId);
      
      }
    }

    // CSCStrip
    // 

    // Get the digis from the event

   boost::shared_ptr<Wrapper<CSCStripDigiCollection>  const> CSCStripDigisPTR = 
          getProductByTag<CSCStripDigiCollection>(*ep, CSCStripPileInputTag_ );
 
   if(CSCStripDigisPTR ) {

     const CSCStripDigiCollection*  CSCStripDigis = const_cast< CSCStripDigiCollection * >(CSCStripDigisPTR->product());

     CSCStripDigiCollection::DigiRangeIterator CSCStripLayerIt;
     for (CSCStripLayerIt = CSCStripDigis->begin(); CSCStripLayerIt != CSCStripDigis->end(); ++CSCStripLayerIt) {
        // The layerId
        const CSCDetId& layerId = (*CSCStripLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const CSCStripDigiCollection::Range& range = (*CSCStripLayerIt).second;

        OurCSCStripDigis_->put(range, layerId);
      
      }
    }

    // CSCWire
    // 

    // Get the digis from the event

   boost::shared_ptr<Wrapper<CSCWireDigiCollection>  const> CSCWireDigisPTR = 
          getProductByTag<CSCWireDigiCollection>(*ep, CSCWirePileInputTag_ );
 
   if(CSCWireDigisPTR ) {

     const CSCWireDigiCollection*  CSCWireDigis = const_cast< CSCWireDigiCollection * >(CSCWireDigisPTR->product());

     CSCWireDigiCollection::DigiRangeIterator CSCWireLayerIt;
     for (CSCWireLayerIt = CSCWireDigis->begin(); CSCWireLayerIt != CSCWireDigis->end(); ++CSCWireLayerIt) {
        // The layerId
        const CSCDetId& layerId = (*CSCWireLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const CSCWireDigiCollection::Range& range = (*CSCWireLayerIt).second;

        OurCSCWireDigis_->put(range, layerId);
      
      }
    }

   // CSCComparators
   //

   // Get the digis from the event

   boost::shared_ptr<Wrapper<CSCComparatorDigiCollection>  const> CSCComparatorDigisPTR =
     getProductByTag<CSCComparatorDigiCollection>(*ep, CSCCompPileInputTag_ );

   if(CSCComparatorDigisPTR ) {

     const CSCComparatorDigiCollection*  CSCComparatorDigis = const_cast< CSCComparatorDigiCollection * >(CSCComparatorDigisPTR->product());

     CSCComparatorDigiCollection::DigiRangeIterator CSCComparatorLayerIt;
     for (CSCComparatorLayerIt = CSCComparatorDigis->begin(); CSCComparatorLayerIt != CSCComparatorDigis->end(); ++CSCComparatorLayerIt) {
       // The layerId
       const CSCDetId& layerId = (*CSCComparatorLayerIt).first;

       // Get the iterators over the digis associated with this LayerId
       const CSCComparatorDigiCollection::Range& range = (*CSCComparatorLayerIt).second;

       OurCSCComparatorDigis_->put(range, layerId);

     }
   }


  }
void DataMixingMuonWorker::addMuonSignals ( const edm::Event e)

Definition at line 79 of file DataMixingMuonWorker.cc.

References CSCCompdigi_collectionSig_, CSCstripdigi_collectionSig_, CSCwiredigi_collectionSig_, DTDigiTagSig_, edm::Event::getByLabel(), edm::EventBase::id(), LogDebug, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, edm::Handle< T >::product(), and RPCDigiTagSig_.

Referenced by edm::DataMixingModule::addSignals().

                                                             { 
    // fill in maps of hits

    LogDebug("DataMixingMuonWorker")<<"===============> adding MC signals for "<<e.id();

    // DT
    // 

    OurDTDigis_ = new DTDigiCollection();
    Handle<DTDigiCollection> pDTdigis; 

    // Get the digis from the event
    if( e.getByLabel(DTDigiTagSig_, pDTdigis) ) {

    //    LogInfo("DataMixingMuonWorker") << "total # DT Digis: " << DTdigis->size();

    // Loop over digis, copying them to our own local storage
      const DTDigiCollection* DTdigis = pDTdigis.product();
      DTDigiCollection::DigiRangeIterator DLayerIt;
      for (DLayerIt = DTdigis->begin(); DLayerIt != DTdigis->end(); ++DLayerIt) {
        // The layerId
        const DTLayerId& layerId = (*DLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const DTDigiCollection::Range& range = (*DLayerIt).second;

        OurDTDigis_->put(range, layerId);
      }
    }
    // RPC
    // 

    OurRPCDigis_ = new RPCDigiCollection();

    // Get the digis from the event
    Handle<RPCDigiCollection> pRPCdigis; 

    if( e.getByLabel(RPCDigiTagSig_, pRPCdigis) ) {

    // Loop over digis, copying them to our own local storage

      const RPCDigiCollection* RPCdigis = pRPCdigis.product();
      RPCDigiCollection::DigiRangeIterator RLayerIt;
      for (RLayerIt = RPCdigis->begin(); RLayerIt != RPCdigis->end(); ++RLayerIt) {
        // The layerId
        const RPCDetId& layerId = (*RLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const RPCDigiCollection::Range& range = (*RLayerIt).second;

        OurRPCDigis_->put(range, layerId);
      
      }
    }
    // CSCStrip
    // 

    OurCSCStripDigis_ = new CSCStripDigiCollection();

    // Get the digis from the event
    Handle<CSCStripDigiCollection> pCSCStripdigis; 

    if( e.getByLabel(CSCstripdigi_collectionSig_, pCSCStripdigis) ) {

    //if(pCSCStripdigis.isValid() ) { std::cout << "Signal: have CSCStripDigis" << std::endl;}
    //else { std::cout << "Signal: NO CSCStripDigis" << std::endl;}


    // Loop over digis, copying them to our own local storage

      const CSCStripDigiCollection* CSCStripdigis = pCSCStripdigis.product();
      CSCStripDigiCollection::DigiRangeIterator CSLayerIt;
      for (CSLayerIt = CSCStripdigis->begin(); CSLayerIt != CSCStripdigis->end(); ++CSLayerIt) {
        // The layerId
        const CSCDetId& layerId = (*CSLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const CSCStripDigiCollection::Range& range = (*CSLayerIt).second;

        OurCSCStripDigis_->put(range, layerId);
      }
    }
    // CSCWire
    // 

    OurCSCWireDigis_ = new CSCWireDigiCollection();

    // Get the digis from the event
    Handle<CSCWireDigiCollection> pCSCWiredigis; 

    if( e.getByLabel(CSCwiredigi_collectionSig_, pCSCWiredigis) ) {
   

    //if(pCSCWiredigis.isValid() ) { std::cout << "Signal: have CSCWireDigis" << std::endl;}
    //else { std::cout << "Signal: NO CSCWireDigis" << std::endl;}
    
    // Loop over digis, copying them to our own local storage

      const CSCWireDigiCollection* CSCWiredigis = pCSCWiredigis.product();
      CSCWireDigiCollection::DigiRangeIterator CWLayerIt;
      for (CWLayerIt = CSCWiredigis->begin(); CWLayerIt != CSCWiredigis->end(); ++CWLayerIt) {
        // The layerId
        const CSCDetId& layerId = (*CWLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const CSCWireDigiCollection::Range& range = (*CWLayerIt).second;

        OurCSCWireDigis_->put(range, layerId);
      
      }
    }

    // CSCComparators
    // 

    OurCSCComparatorDigis_ = new CSCComparatorDigiCollection();

    // Get the digis from the event
    Handle<CSCComparatorDigiCollection> pCSCComparatordigis; 

    //std::cout << "CSCComp label: " << CSCDigiTagSig_.label() << " " << CSCCompdigi_collectionSig_.label() << std::endl;

    if( e.getByLabel(CSCCompdigi_collectionSig_, pCSCComparatordigis) ) {
   

      //if(pCSCComparatordigis.isValid() ) { std::cout << "Signal: have CSCComparatorDigis" << std::endl;}
      //else { std::cout << "Signal: NO CSCComparatorDigis" << std::endl;}
    
    // Loop over digis, copying them to our own local storage

      const CSCComparatorDigiCollection* CSCComparatordigis = pCSCComparatordigis.product();
      CSCComparatorDigiCollection::DigiRangeIterator CWLayerIt;
      for (CWLayerIt = CSCComparatordigis->begin(); CWLayerIt != CSCComparatordigis->end(); ++CWLayerIt) {
        // The layerId
        const CSCDetId& layerId = (*CWLayerIt).first;

        // Get the iterators over the digis associated with this LayerId
        const CSCComparatorDigiCollection::Range& range = (*CWLayerIt).second;

        OurCSCComparatorDigis_->put(range, layerId);
      
      }
    }

    
  } // end of addMuonSignals
void DataMixingMuonWorker::putMuon ( edm::Event e)

Definition at line 359 of file DataMixingMuonWorker.cc.

References CSCComparatorDigiCollectionDM_, CSCStripDigiCollectionDM_, CSCWireDigiCollectionDM_, OurCSCComparatorDigis_, OurCSCStripDigis_, OurCSCWireDigis_, OurDTDigis_, OurRPCDigis_, and edm::Event::put().

Referenced by edm::DataMixingModule::put().

                                                {

    // collections of digis to put in the event
    std::auto_ptr< DTDigiCollection > DTDigiMerge( new DTDigiCollection );
    std::auto_ptr< RPCDigiCollection > RPCDigiMerge( new RPCDigiCollection );
    std::auto_ptr< CSCStripDigiCollection > CSCStripDigiMerge( new CSCStripDigiCollection );
    std::auto_ptr< CSCWireDigiCollection > CSCWireDigiMerge( new CSCWireDigiCollection );
    std::auto_ptr< CSCComparatorDigiCollection > CSCComparatorDigiMerge( new CSCComparatorDigiCollection );

    // Loop over DT digis, copying them from our own local storage

    DTDigiCollection::DigiRangeIterator DLayerIt;
    for (DLayerIt = OurDTDigis_->begin(); DLayerIt != OurDTDigis_->end(); ++DLayerIt) {
      // The layerId
      const DTLayerId& layerId = (*DLayerIt).first;

      // Get the iterators over the digis associated with this LayerId
      const DTDigiCollection::Range& range = (*DLayerIt).second;

      DTDigiMerge->put(range, layerId);
      
    }

    // Loop over RPC digis, copying them from our own local storage

    RPCDigiCollection::DigiRangeIterator RLayerIt;
    for (RLayerIt = OurRPCDigis_->begin(); RLayerIt != OurRPCDigis_->end(); ++RLayerIt) {
      // The layerId
      const RPCDetId& layerId = (*RLayerIt).first;

      // Get the iterators over the digis associated with this LayerId
      const RPCDigiCollection::Range& range = (*RLayerIt).second;

      RPCDigiMerge->put(range, layerId);
      
    }
    // Loop over CSCStrip digis, copying them from our own local storage

    CSCStripDigiCollection::DigiRangeIterator CSLayerIt;
    for (CSLayerIt = OurCSCStripDigis_->begin(); CSLayerIt != OurCSCStripDigis_->end(); ++CSLayerIt) {
      // The layerId
      const CSCDetId& layerId = (*CSLayerIt).first;

      // Get the iterators over the digis associated with this LayerId
      const CSCStripDigiCollection::Range& range = (*CSLayerIt).second;

      CSCStripDigiMerge->put(range, layerId);
      
    }
    // Loop over CSCStrip digis, copying them from our own local storage

    CSCWireDigiCollection::DigiRangeIterator CWLayerIt;
    for (CWLayerIt = OurCSCWireDigis_->begin(); CWLayerIt != OurCSCWireDigis_->end(); ++CWLayerIt) {
      // The layerId
      const CSCDetId& layerId = (*CWLayerIt).first;

      // Get the iterators over the digis associated with this LayerId
      const CSCWireDigiCollection::Range& range = (*CWLayerIt).second;

      CSCWireDigiMerge->put(range, layerId);
      
    }

    // Loop over CSCComparator digis, copying them from our own local storage

    CSCComparatorDigiCollection::DigiRangeIterator CCLayerIt;
    for (CCLayerIt = OurCSCComparatorDigis_->begin(); CCLayerIt != OurCSCComparatorDigis_->end(); ++CCLayerIt) {
      // The layerId
      const CSCDetId& layerId = (*CCLayerIt).first;

      // Get the iterators over the digis associated with this LayerId
      const CSCComparatorDigiCollection::Range& range = (*CCLayerIt).second;

      CSCComparatorDigiMerge->put(range, layerId);
      
    }


    // put the collection of recunstructed hits in the event   
    //    LogDebug("DataMixingMuonWorker") << "total # DT Merged Digis: " << DTDigiMerge->size() ;
    //    LogDebug("DataMixingMuonWorker") << "total # RPC Merged Digis: " << RPCDigiMerge->size() ;
    //    LogDebug("DataMixingMuonWorker") << "total # CSCStrip Merged Digis: " << CSCStripDigiMerge->size() ;
    //    LogDebug("DataMixingMuonWorker") << "total # CSCWire Merged Digis: " << CSCWireDigiMerge->size() ;

    e.put( DTDigiMerge );
    e.put( RPCDigiMerge );
    e.put( CSCStripDigiMerge, CSCStripDigiCollectionDM_ );
    e.put( CSCWireDigiMerge, CSCWireDigiCollectionDM_ );
    e.put( CSCComparatorDigiMerge, CSCComparatorDigiCollectionDM_ );

    // clear local storage for this event
    delete OurDTDigis_;
    delete OurRPCDigis_;
    delete OurCSCStripDigis_;
    delete OurCSCWireDigis_;
    delete OurCSCComparatorDigis_;

  }

Member Data Documentation

Definition at line 80 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

Definition at line 68 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

Definition at line 74 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

Definition at line 63 of file DataMixingMuonWorker.h.

Definition at line 66 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

Definition at line 78 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

Definition at line 73 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

Definition at line 67 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

Definition at line 79 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and putMuon().

Definition at line 72 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

Definition at line 61 of file DataMixingMuonWorker.h.

Definition at line 76 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

Definition at line 64 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

Definition at line 70 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

std::string edm::DataMixingMuonWorker::label_ [private]

Definition at line 94 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

Definition at line 89 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

Definition at line 87 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

Definition at line 88 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

Definition at line 85 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

Definition at line 86 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), addMuonSignals(), and putMuon().

Definition at line 62 of file DataMixingMuonWorker.h.

Definition at line 77 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker().

Definition at line 65 of file DataMixingMuonWorker.h.

Referenced by addMuonSignals(), and DataMixingMuonWorker().

Definition at line 71 of file DataMixingMuonWorker.h.

Referenced by addMuonPileups(), and DataMixingMuonWorker().

Definition at line 93 of file DataMixingMuonWorker.h.

Referenced by DataMixingMuonWorker(), and ~DataMixingMuonWorker().