CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonShowerDigiFiller Class Reference

#include <RecoMuon/MuonIdentification/src/MuonShowerDigiFiller.cc>

Public Member Functions

void fill (reco::MuonChamberMatch &muChMatch) const
 
void fillDefault (reco::MuonChamberMatch &muChMatch) const
 
void getDigis (edm::Event &iEvent)
 
void getES (const edm::EventSetup &iSetup)
 
 MuonShowerDigiFiller (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 

Private Attributes

edm::Handle< CSCStripDigiCollectionm_cscDigis
 
edm::EDGetTokenT< CSCStripDigiCollectionm_cscDigisToken
 
edm::ESHandle< CSCGeometrym_cscGeometry
 
edm::ESGetToken< CSCGeometry, MuonGeometryRecordm_cscGeometryToken
 
double m_digiMaxDistanceX
 
edm::Handle< DTDigiCollectionm_dtDigis
 
edm::EDGetTokenT< DTDigiCollectionm_dtDigisToken
 
edm::ESHandle< DTGeometrym_dtGeometry
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordm_dtGeometryToken
 

Detailed Description

Description: Class filling shower information using DT and CSC digis

Implementation: <Notes on="" implementation>="">

Definition at line 47 of file MuonShowerDigiFiller.h.

Constructor & Destructor Documentation

◆ MuonShowerDigiFiller()

MuonShowerDigiFiller::MuonShowerDigiFiller ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 27 of file MuonShowerDigiFiller.cc.

28  : m_digiMaxDistanceX(iConfig.getParameter<double>("digiMaxDistanceX")),
29  m_dtDigisToken(iC.consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("dtDigiCollectionLabel"))),
31  iC.consumes<CSCStripDigiCollection>(iConfig.getParameter<edm::InputTag>("cscDigiCollectionLabel"))),

Member Function Documentation

◆ fill()

void MuonShowerDigiFiller::fill ( reco::MuonChamberMatch muChMatch) const

Definition at line 49 of file MuonShowerDigiFiller.cc.

49  {
50  int nDigisInRange = 0;
51 
52  // DT chamber
53  if (muChMatch.detector() == MuonSubdetId::DT) {
54  double xTrack = muChMatch.x;
55 
56  for (int sl = 1; sl <= DTChamberId::maxSuperLayerId; sl += 2) {
57  for (int layer = 1; layer <= DTChamberId::maxLayerId; ++layer) {
58  const DTLayerId layerId(DTChamberId(muChMatch.id.rawId()), sl, layer);
59 
60  auto range = m_dtDigis->get(layerId);
61 
62  for (auto digiIt = range.first; digiIt != range.second; ++digiIt) {
63  const auto topo = m_dtGeometry->layer(layerId)->specificTopology();
64 
65  double xWire = topo.wirePosition((*digiIt).wire());
66  double dX = std::abs(xWire - xTrack);
67 
68  if (dX < m_digiMaxDistanceX)
69  nDigisInRange++;
70  }
71  }
72  }
73  }
74 
75  else if (muChMatch.detector() == MuonSubdetId::CSC) {
76  double xTrack = muChMatch.x;
77  double yTrack = muChMatch.y;
78 
79  for (int iLayer = 1; iLayer <= CSCDetId::maxLayerId(); ++iLayer) {
80  const CSCDetId chId(muChMatch.id.rawId());
81  const CSCDetId layerId(chId.endcap(), chId.station(), chId.ring(), chId.chamber(), iLayer);
82 
83  auto range = m_cscDigis->get(layerId);
84 
85  for (auto digiIt = range.first; digiIt != range.second; ++digiIt) {
86  std::vector<int> adcVals = digiIt->getADCCounts();
87  bool hasFired = false;
88  float pedestal = 0.5 * (float)(adcVals[0] + adcVals[1]);
89  float threshold = 13.3;
90  float diff = 0.;
91  for (const auto& adcVal : adcVals) {
92  diff = (float)adcVal - pedestal;
93  if (diff > threshold) {
94  hasFired = true;
95  break;
96  }
97  }
98 
99  if (!hasFired)
100  continue;
101 
102  const CSCLayerGeometry* layerGeom = m_cscGeometry->layer(layerId)->geometry();
103 
104  Float_t xStrip = layerGeom->xOfStrip(digiIt->getStrip(), yTrack);
105  float dX = std::abs(xStrip - xTrack);
106 
107  if (dX < m_digiMaxDistanceX)
108  nDigisInRange++;
109  }
110  }
111  }
112 
113  muChMatch.nDigisInRange = nDigisInRange;
114 }

References funct::abs(), MuonSubdetId::CSC, reco::MuonChamberMatch::detector(), change_name::diff, MuonSubdetId::DT, dqmMemoryStats::float, CSCLayer::geometry(), reco::MuonChamberMatch::id, CSCGeometry::layer(), DTGeometry::layer(), phase1PixelTopology::layer, m_cscDigis, m_cscGeometry, m_digiMaxDistanceX, m_dtDigis, m_dtGeometry, DTChamberId::maxLayerId, CSCDetId::maxLayerId(), DTChamberId::maxSuperLayerId, reco::MuonChamberMatch::nDigisInRange, EcalCondDBWriter_cfi::pedestal, FastTimerService_cff::range, DetId::rawId(), DTLayer::specificTopology(), remoteMonitoring_LED_IterMethod_cfg::threshold, DTTopology::wirePosition(), reco::MuonChamberMatch::x, CSCLayerGeometry::xOfStrip(), and reco::MuonChamberMatch::y.

◆ fillDefault()

void MuonShowerDigiFiller::fillDefault ( reco::MuonChamberMatch muChMatch) const

Definition at line 116 of file MuonShowerDigiFiller.cc.

116 { muChMatch.nDigisInRange = 0; }

References reco::MuonChamberMatch::nDigisInRange.

◆ getDigis()

void MuonShowerDigiFiller::getDigis ( edm::Event iEvent)

Definition at line 44 of file MuonShowerDigiFiller.cc.

44  {
45  iEvent.getByToken(m_dtDigisToken, m_dtDigis);
46  iEvent.getByToken(m_cscDigisToken, m_cscDigis);
47 }

References iEvent, m_cscDigis, m_cscDigisToken, m_dtDigis, and m_dtDigisToken.

◆ getES()

void MuonShowerDigiFiller::getES ( const edm::EventSetup iSetup)

Member Data Documentation

◆ m_cscDigis

edm::Handle<CSCStripDigiCollection> MuonShowerDigiFiller::m_cscDigis
private

Definition at line 70 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getDigis().

◆ m_cscDigisToken

edm::EDGetTokenT<CSCStripDigiCollection> MuonShowerDigiFiller::m_cscDigisToken
private

Definition at line 61 of file MuonShowerDigiFiller.h.

Referenced by getDigis().

◆ m_cscGeometry

edm::ESHandle<CSCGeometry> MuonShowerDigiFiller::m_cscGeometry
private

Definition at line 67 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getES().

◆ m_cscGeometryToken

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> MuonShowerDigiFiller::m_cscGeometryToken
private

Definition at line 64 of file MuonShowerDigiFiller.h.

Referenced by getES().

◆ m_digiMaxDistanceX

double MuonShowerDigiFiller::m_digiMaxDistanceX
private

Definition at line 58 of file MuonShowerDigiFiller.h.

Referenced by fill().

◆ m_dtDigis

edm::Handle<DTDigiCollection> MuonShowerDigiFiller::m_dtDigis
private

Definition at line 69 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getDigis().

◆ m_dtDigisToken

edm::EDGetTokenT<DTDigiCollection> MuonShowerDigiFiller::m_dtDigisToken
private

Definition at line 60 of file MuonShowerDigiFiller.h.

Referenced by getDigis().

◆ m_dtGeometry

edm::ESHandle<DTGeometry> MuonShowerDigiFiller::m_dtGeometry
private

Definition at line 66 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getES().

◆ m_dtGeometryToken

edm::ESGetToken<DTGeometry, MuonGeometryRecord> MuonShowerDigiFiller::m_dtGeometryToken
private

Definition at line 63 of file MuonShowerDigiFiller.h.

Referenced by getES().

MuonShowerDigiFiller::m_dtDigis
edm::Handle< DTDigiCollection > m_dtDigis
Definition: MuonShowerDigiFiller.h:69
change_name.diff
diff
Definition: change_name.py:13
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
MuonShowerDigiFiller::m_dtDigisToken
edm::EDGetTokenT< DTDigiCollection > m_dtDigisToken
Definition: MuonShowerDigiFiller.h:60
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
MuonShowerDigiFiller::m_cscGeometry
edm::ESHandle< CSCGeometry > m_cscGeometry
Definition: MuonShowerDigiFiller.h:67
reco::MuonChamberMatch::x
float x
Definition: MuonChamberMatch.h:19
CSCStripDigiCollection
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
reco::MuonChamberMatch::detector
int detector() const
Definition: MuonChamberMatch.h:31
CSCLayerGeometry::xOfStrip
float xOfStrip(int strip, float y=0.) const
Definition: CSCLayerGeometry.h:175
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
MuonShowerDigiFiller::m_dtGeometryToken
edm::ESGetToken< DTGeometry, MuonGeometryRecord > m_dtGeometryToken
Definition: MuonShowerDigiFiller.h:63
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
MuonShowerDigiFiller::m_cscDigisToken
edm::EDGetTokenT< CSCStripDigiCollection > m_cscDigisToken
Definition: MuonShowerDigiFiller.h:61
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
reco::MuonChamberMatch::nDigisInRange
int nDigisInRange
Definition: MuonChamberMatch.h:29
MuonShowerDigiFiller::m_digiMaxDistanceX
double m_digiMaxDistanceX
Definition: MuonShowerDigiFiller.h:58
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
MuonShowerDigiFiller::m_cscGeometryToken
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_cscGeometryToken
Definition: MuonShowerDigiFiller.h:64
MuonShowerDigiFiller::m_cscDigis
edm::Handle< CSCStripDigiCollection > m_cscDigis
Definition: MuonShowerDigiFiller.h:70
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
reco::MuonChamberMatch::id
DetId id
Definition: MuonChamberMatch.h:27
DTDigiCollection
CSCDetId
Definition: CSCDetId.h:26
DTChamberId::maxLayerId
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:70
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
DTChamberId::maxSuperLayerId
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:66
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCGeometry::layer
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
edm::Transition::BeginRun
MuonShowerDigiFiller::m_dtGeometry
edm::ESHandle< DTGeometry > m_dtGeometry
Definition: MuonShowerDigiFiller.h:66
CSCDetId::maxLayerId
static int maxLayerId()
Definition: CSCDetId.h:243
reco::MuonChamberMatch::y
float y
Definition: MuonChamberMatch.h:20
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTChamberId
Definition: DTChamberId.h:14
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
edm::InputTag
Definition: InputTag.h:15