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
 
double m_digiMaxDistanceX
 
edm::Handle< DTDigiCollectionm_dtDigis
 
edm::EDGetTokenT< DTDigiCollectionm_dtDigisToken
 
edm::ESHandle< DTGeometrym_dtGeometry
 

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 ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 30 of file MuonShowerDigiFiller.cc.

30  :
31  m_digiMaxDistanceX(iConfig.getParameter<double>("digiMaxDistanceX")),
32  m_dtDigisToken(iC.consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("dtDigiCollectionLabel"))),
33  m_cscDigisToken(iC.consumes<CSCStripDigiCollection>(iConfig.getParameter<edm::InputTag>("cscDigiCollectionLabel")))
34 {
35 
36 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCStripDigiCollection > m_cscDigisToken
edm::EDGetTokenT< DTDigiCollection > m_dtDigisToken

Member Function Documentation

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

Definition at line 62 of file MuonShowerDigiFiller.cc.

References funct::abs(), MuonSubdetId::CSC, reco::MuonChamberMatch::detector(), diffTreeTool::diff, MuonSubdetId::DT, objects.autophobj::float, CSCLayer::geometry(), reco::MuonChamberMatch::id, CSCGeometry::layer(), DTGeometry::layer(), m_cscDigis, m_cscGeometry, m_digiMaxDistanceX, m_dtDigis, m_dtGeometry, DTChamberId::maxLayerId, CSCDetId::maxLayerId(), DTChamberId::maxSuperLayerId, reco::MuonChamberMatch::nDigisInRange, muonCSCDigis_cfi::pedestal, DetId::rawId(), DTLayer::specificTopology(), electronIdCutBased_cfi::threshold, DTTopology::wirePosition(), reco::MuonChamberMatch::x, CSCLayerGeometry::xOfStrip(), and reco::MuonChamberMatch::y.

63 {
64 
65  int nDigisInRange = 0;
66 
67  // DT chamber
68  if( muChMatch.detector() == MuonSubdetId::DT )
69  {
70  double xTrack = muChMatch.x;
71 
72  for (int sl = 1; sl <= DTChamberId::maxSuperLayerId; sl += 2)
73  {
74  for (int layer = 1; layer <= DTChamberId::maxLayerId; ++layer)
75  {
76  const DTLayerId layerId(DTChamberId(muChMatch.id.rawId()),sl,layer);
77 
78  auto range = m_dtDigis->get(layerId);
79 
80  for (auto digiIt = range.first ;digiIt!=range.second; ++digiIt)
81  {
82  const auto topo = m_dtGeometry->layer(layerId)->specificTopology();
83 
84  double xWire = topo.wirePosition((*digiIt).wire());
85  double dX = std::abs(xWire - xTrack);
86 
87  if (dX < m_digiMaxDistanceX)
88  nDigisInRange++;
89  }
90  }
91  }
92  }
93 
94  else if(muChMatch.detector() == MuonSubdetId::CSC)
95  {
96 
97  double xTrack = muChMatch.x;
98  double yTrack = muChMatch.y;
99 
100  for (int iLayer = 1; iLayer <= CSCDetId::maxLayerId(); ++iLayer)
101  {
102  const CSCDetId chId(muChMatch.id.rawId());
103  const CSCDetId layerId(chId.endcap(), chId.station(),
104  chId.ring(), chId.chamber(),
105  iLayer);
106 
107  auto range = m_cscDigis->get(layerId);
108 
109  for (auto digiIt = range.first ;digiIt!=range.second; ++digiIt)
110  {
111 
112  std::vector<int> adcVals = digiIt->getADCCounts();
113  bool hasFired = false;
114  float pedestal = 0.5*(float)(adcVals[0]+adcVals[1]);
115  float threshold = 13.3 ;
116  float diff = 0.;
117  for (const auto & adcVal : adcVals)
118  {
119  diff = (float)adcVal - pedestal;
120  if (diff > threshold)
121  {
122  hasFired = true;
123  break;
124  }
125  }
126 
127  if (!hasFired) continue;
128 
129  const CSCLayerGeometry* layerGeom = m_cscGeometry->layer(layerId)->geometry();
130 
131  Float_t xStrip = layerGeom->xOfStrip(digiIt->getStrip(), yTrack);
132  float dX = std::abs(xStrip - xTrack);
133 
134  if (dX < m_digiMaxDistanceX)
135  nDigisInRange++;
136  }
137  }
138  }
139 
140  muChMatch.nDigisInRange = nDigisInRange;
141 
142 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
edm::Handle< DTDigiCollection > m_dtDigis
float xOfStrip(int strip, float y=0.) const
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
edm::ESHandle< DTGeometry > m_dtGeometry
static const int maxLayerId
highest layer id
Definition: DTChamberId.h:85
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int maxSuperLayerId
highest superlayer id
Definition: DTChamberId.h:81
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:139
edm::ESHandle< CSCGeometry > m_cscGeometry
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
static constexpr int DT
Definition: MuonSubdetId.h:12
edm::Handle< CSCStripDigiCollection > m_cscDigis
static constexpr int CSC
Definition: MuonSubdetId.h:13
static int maxLayerId()
Definition: CSCDetId.h:245
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void MuonShowerDigiFiller::fillDefault ( reco::MuonChamberMatch muChMatch) const

Definition at line 145 of file MuonShowerDigiFiller.cc.

References reco::MuonChamberMatch::nDigisInRange.

146 {
147 
148  muChMatch.nDigisInRange = 0;
149 
150 }
void MuonShowerDigiFiller::getDigis ( edm::Event iEvent)

Definition at line 53 of file MuonShowerDigiFiller.cc.

References edm::Event::getByToken(), m_cscDigis, m_cscDigisToken, m_dtDigis, and m_dtDigisToken.

54 {
55 
58 
59 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::Handle< DTDigiCollection > m_dtDigis
edm::EDGetTokenT< CSCStripDigiCollection > m_cscDigisToken
edm::EDGetTokenT< DTDigiCollection > m_dtDigisToken
edm::Handle< CSCStripDigiCollection > m_cscDigis
void MuonShowerDigiFiller::getES ( const edm::EventSetup iSetup)

Definition at line 44 of file MuonShowerDigiFiller.cc.

References edm::EventSetup::get(), m_cscGeometry, and m_dtGeometry.

45 {
46 
47  iSetup.get<MuonGeometryRecord>().get(m_dtGeometry);
48  iSetup.get<MuonGeometryRecord>().get(m_cscGeometry);
49 
50 }
edm::ESHandle< DTGeometry > m_dtGeometry
T get() const
Definition: EventSetup.h:71
edm::ESHandle< CSCGeometry > m_cscGeometry

Member Data Documentation

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

Definition at line 71 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getDigis().

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

Definition at line 65 of file MuonShowerDigiFiller.h.

Referenced by getDigis().

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

Definition at line 68 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getES().

double MuonShowerDigiFiller::m_digiMaxDistanceX
private

Definition at line 62 of file MuonShowerDigiFiller.h.

Referenced by fill().

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

Definition at line 70 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getDigis().

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

Definition at line 64 of file MuonShowerDigiFiller.h.

Referenced by getDigis().

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

Definition at line 67 of file MuonShowerDigiFiller.h.

Referenced by fill(), and getES().