Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62195
b: refs/heads/l1tmuon-upgrade-dev
c: d02e0f6
h: refs/heads/l1tmuon-upgrade-dev
i:
  62193: f571ce7
  62191: 873aa03
  • Loading branch information
Rick Wilkinson committed Mar 17, 2009
1 parent ee03bdf commit d83063c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/l1tmuon-upgrade-dev: 6603e2579eda99538c99753567dcfa486bf62b27
refs/heads/l1tmuon-upgrade-dev: d02e0f65f9650c7d44cbaa92d7767706202b193d
55 changes: 46 additions & 9 deletions trunk/SimMuon/CSCDigitizer/src/CSCDigiSuppressor.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include "SimMuon/CSCDigitizer/src/CSCDigiSuppressor.h"
#include "DataFormats/Common/interface/Handle.h"
#include <DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h>
#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"

#include <algorithm>

CSCDigiSuppressor::CSCDigiSuppressor(const edm::ParameterSet& ps)
: theLCTTag(ps.getParameter<edm::InputTag>("lctTag")),
theStripDigiTag(ps.getParameter<edm::InputTag>("stripDigiTag")),
: theLCTLabel(ps.getParameter<std::string>("lctLabel")),
theDigiLabel(ps.getParameter<std::string>("digiLabel")),
theStripElectronicsSim(ps),
theStripConditions(new CSCDbStripConditions(ps))
{
Expand All @@ -32,14 +35,15 @@ CSCDigiSuppressor::CSCDigiSuppressor(const edm::ParameterSet& ps)
void CSCDigiSuppressor::produce(edm::Event& e, const edm::EventSetup& eventSetup)
{
edm::Handle<CSCStripDigiCollection> oldStripDigis;
e.getByLabel(theStripDigiTag, oldStripDigis);
e.getByLabel(theDigiLabel, "MuonCSCStripDigi", oldStripDigis);
if (!oldStripDigis.isValid()) {
edm::LogError("CSCDigiValidation") << "Cannot get strips by label "
<< theStripDigiTag.encode();
<< theDigiLabel;
}

edm::Handle<CSCCorrelatedLCTDigiCollection> lcts;
e.getByLabel(theLCTTag, lcts);
e.getByLabel(theLCTLabel, lcts);

std::auto_ptr<CSCStripDigiCollection> newStripDigis(new CSCStripDigiCollection());

theStripConditions->initializeEvent(eventSetup);
Expand Down Expand Up @@ -68,6 +72,41 @@ void CSCDigiSuppressor::produce(edm::Event& e, const edm::EventSetup& eventSetup
}

e.put(newStripDigis, "MuonCSCStripDigi");
suppressWires(e);
}


void CSCDigiSuppressor::suppressWires(edm::Event & e)
{
edm::Handle<CSCWireDigiCollection> oldWireDigis;
e.getByLabel(theDigiLabel, "MuonCSCWireDigi", oldWireDigis);
std::auto_ptr<CSCWireDigiCollection> newWireDigis(new CSCWireDigiCollection(*oldWireDigis));

edm::Handle<CSCALCTDigiCollection> alctDigis;
e.getByLabel(theLCTLabel, alctDigis);
typedef CSCALCTDigiCollection::DigiRangeIterator ALCTItr;
typedef CSCWireDigiCollection::DigiRangeIterator WireItr;

for(WireItr wireItr = oldWireDigis->begin();
wireItr != oldWireDigis->end(); ++wireItr)
{
const CSCDetId& id = (*wireItr).first;
bool found = false;
for(ALCTItr alctItr = alctDigis->begin();
!found && alctItr != alctDigis->end(); ++alctItr)
{
if((*alctItr).first == id)
{
found = true;
}
}
if(found)
{
newWireDigis->put((*wireItr).second, (*wireItr).first);
}
}

e.put(newWireDigis, "MuonCSCWireDigi");
}


Expand Down Expand Up @@ -187,5 +226,3 @@ CSCDigiSuppressor::stripsToRead(const std::list<int> & cfebs) const
}
return strips;
}


5 changes: 3 additions & 2 deletions trunk/SimMuon/CSCDigitizer/src/CSCDigiSuppressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ class CSCDigiSuppressor : public edm::EDProducer
std::list<int>
stripsToRead(const std::list<int> & cfebs) const;

edm::InputTag theLCTTag;
edm::InputTag theStripDigiTag;
void suppressWires(edm::Event & e);

std::string theLCTLabel;
std::string theDigiLabel;

CSCStripElectronicsSim theStripElectronicsSim;
CSCStripConditions * theStripConditions;
Expand Down

0 comments on commit d83063c

Please sign in to comment.