CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
MuCSCTnPFlatTableProducer Class Reference

#include <DPGAnalysis/MuonTools/plugins/MuCSCTnPFlatTableProducer.cc>

Inheritance diagram for MuCSCTnPFlatTableProducer:
MuBaseFlatTableProducer edm::stream::EDProducer<>

Public Member Functions

 MuCSCTnPFlatTableProducer (const edm::ParameterSet &)
 Constructor. More...
 
- Public Member Functions inherited from MuBaseFlatTableProducer
void beginRun (const edm::Run &run, const edm::EventSetup &config) final
 Configure event setup for each run. More...
 
void endRun (const edm::Run &, const edm::EventSetup &) final
 Empty, needed by interface. More...
 
 MuBaseFlatTableProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) final
 Fill ntuples event by event. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 Fill descriptors. More...
 

Protected Member Functions

void fillTable (edm::Event &) final
 Fill tree branches for a given events. More...
 
void getFromES (const edm::Run &, const edm::EventSetup &) final
 Get info from the ES by run. More...
 
void getFromES (const edm::EventSetup &) final
 Get info from the ES for a given event. More...
 
- Protected Member Functions inherited from MuBaseFlatTableProducer
template<typename T >
void addColumn (std::unique_ptr< nanoaod::FlatTable > &table, const std::string name, const std::vector< T > &vec, const std::string descr)
 

Private Member Functions

double calcDeltaR (double, double, double, double)
 
float computePFIso (const reco::MuonPFIsolation &, float)
 
float computeTrkIso (const reco::MuonIsolation &, float)
 
FreeTrajectoryState freeTrajStateMuon (const reco::Track &)
 
std::vector< Float_t > GetEdgeAndDistToGap (const reco::Track &, CSCDetId &)
 
bool hasTrigger (std::vector< int > &, const trigger::TriggerObjectCollection &, edm::Handle< trigger::TriggerEvent > &, const reco::Muon &)
 
double iso (const reco::Track &, edm::Handle< std::vector< reco::Track >>)
 
TrajectoryStateOnSurfacematchTTwithCSCSeg (const reco::Track &, edm::Handle< CSCSegmentCollection >, CSCSegmentCollection::const_iterator &, CSCDetId &)
 
bool muonTagSelection (const reco::Muon &)
 
UChar_t ringCandidate (Int_t iiStation, Int_t station, Float_t feta, Float_t phi)
 
TrajectoryStateOnSurface surfExtrapTrkSam (const reco::Track &, double)
 
UChar_t thisChamberCandidate (UChar_t station, UChar_t ring, Float_t phi)
 
bool trackProbeSelection (const reco::Track &track, edm::Handle< std::vector< reco::Track >>)
 Selection functions. More...
 
Float_t TrajectoryDistToSeg (TrajectoryStateOnSurface, CSCSegmentCollection::const_iterator)
 
Float_t YDistToHVDeadZone (Float_t, Int_t)
 
double zMass (const reco::Track &, const reco::Muon &)
 
bool zSelection (const reco::Muon &, const reco::Track &)
 

Private Attributes

double _muonIso
 
double _trackIso
 
double _zMass
 
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRunm_cscGeometry
 
nano_mu::EDTokenHandle< CSCSegmentCollectionm_cscSegmentToken
 
HLTConfigProvider m_hltConfig
 HLT config provider. More...
 
std::vector< int > m_isoTrigIndices
 
std::string m_isoTrigName
 
std::unique_ptr< MuonServiceProxym_muonSP
 Muon service proxy. More...
 
nano_mu::EDTokenHandle< reco::MuonCollectionm_muToken
 Tokens. More...
 
unsigned int m_nZCands
 
nano_mu::EDTokenHandle< std::vector< reco::Vertex > > m_primaryVerticesToken
 
nano_mu::EDTokenHandle< reco::TrackCollectionm_trackToken
 
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecordm_transientTrackBuilder
 Transient Track Builder. More...
 
nano_mu::EDTokenHandle< trigger::TriggerEventm_trigEventToken
 
std::vector< int > m_trigIndices
 Indices of the triggers used by muon filler for trigger matching. More...
 
std::string m_trigName
 Name of the triggers used by muon filler for trigger matching. More...
 
nano_mu::EDTokenHandle< edm::TriggerResultsm_trigResultsToken
 
edm::ESHandle< PropagatorpropagatorAlong
 
edm::ESHandle< PropagatorpropagatorOpposite
 
edm::ESHandle< MagneticFieldtheBField
 

Static Private Attributes

static constexpr Float_t MEZ [6] = {601.3, 696.11, 696.11, 827.56, 936.44, 1025.9}
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Attributes inherited from MuBaseFlatTableProducer
std::string m_name
 The label name of the FlatTableProducer. More...
 
- Static Protected Attributes inherited from MuBaseFlatTableProducer
static constexpr double DEFAULT_DOUBLE_VAL {-999.0}
 Definition of default values for float variables. More...
 
static constexpr double DEFAULT_DOUBLE_VAL_POS {-1.0}
 Definition of default values for positive float variables. More...
 
static constexpr int8_t DEFAULT_INT8_VAL {-99}
 Definition of default values for int8 variables. More...
 
static constexpr int DEFAULT_INT_VAL {-999}
 Definition of default values for int variables. More...
 
static constexpr int DEFAULT_INT_VAL_POS {-1}
 Definition of default values for positive int variables. More...
 

Detailed Description

Helper class : the CSC Tag and probe segment efficiency filler

Author
M. Herndon (UW Madison)

Definition at line 62 of file MuCSCTnPFlatTableProducer.cc.

Constructor & Destructor Documentation

◆ MuCSCTnPFlatTableProducer()

MuCSCTnPFlatTableProducer::MuCSCTnPFlatTableProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 165 of file MuCSCTnPFlatTableProducer.cc.

References DiMuonV_cfg::config.

167  m_muToken{config, consumesCollector(), "muonSrc"},
168  m_trackToken{config, consumesCollector(), "trackSrc"},
169  m_cscSegmentToken{config, consumesCollector(), "cscSegmentSrc"},
170  m_primaryVerticesToken{config, consumesCollector(), "primaryVerticesSrc"},
171  m_trigResultsToken{config, consumesCollector(), "trigResultsSrc"},
172  m_trigEventToken{config, consumesCollector(), "trigEventSrc"},
173  m_trigName{config.getParameter<std::string>("trigName")},
174  m_isoTrigName{config.getParameter<std::string>("isoTrigName")},
175  m_cscGeometry{consumesCollector()},
176  m_muonSP{std::make_unique<MuonServiceProxy>(config.getParameter<edm::ParameterSet>("ServiceParameters"),
177  consumesCollector())},
178  m_transientTrackBuilder{consumesCollector(), "TransientTrackBuilder"} {
179  produces<nanoaod::FlatTable>();
180 }
nano_mu::EDTokenHandle< std::vector< reco::Vertex > > m_primaryVerticesToken
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
Definition: config.py:1
nano_mu::EDTokenHandle< CSCSegmentCollection > m_cscSegmentToken
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
std::string m_trigName
Name of the triggers used by muon filler for trigger matching.
nano_mu::EDTokenHandle< edm::TriggerResults > m_trigResultsToken
nano_mu::EDTokenHandle< reco::MuonCollection > m_muToken
Tokens.
MuBaseFlatTableProducer(const edm::ParameterSet &)
Constructor.
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.
nano_mu::EDTokenHandle< trigger::TriggerEvent > m_trigEventToken
dictionary config
Read in AllInOne config in JSON format.
Definition: DiMuonV_cfg.py:30
nano_mu::EDTokenHandle< reco::TrackCollection > m_trackToken

Member Function Documentation

◆ calcDeltaR()

double MuCSCTnPFlatTableProducer::calcDeltaR ( double  eta1,
double  eta2,
double  phi1,
double  phi2 
)
private

Definition at line 1009 of file MuCSCTnPFlatTableProducer.cc.

References HLT_2024v14_cff::eta1, HLT_2024v14_cff::eta2, M_PI, and mathSSE::sqrt().

Referenced by fillTable(), and iso().

1009  {
1010  double deta = eta1 - eta2;
1011  if (phi1 < 0)
1012  phi1 += 2.0 * M_PI;
1013  if (phi2 < 0)
1014  phi2 += 2.0 * M_PI;
1015  double dphi = phi1 - phi2;
1016  if (dphi > M_PI)
1017  dphi -= 2. * M_PI;
1018  else if (dphi < -M_PI)
1019  dphi += 2. * M_PI;
1020  return std::sqrt(deta * deta + dphi * dphi);
1021 }
T sqrt(T t)
Definition: SSEVec.h:23
#define M_PI

◆ computePFIso()

float MuCSCTnPFlatTableProducer::computePFIso ( const reco::MuonPFIsolation pfIsolation,
float  muonPt 
)
private

Definition at line 657 of file MuCSCTnPFlatTableProducer.cc.

References WZElectronSkims53X_cff::max, and HLTObjectMonitor_cfi::muonPt.

Referenced by muonTagSelection().

657  {
658  return (pfIsolation.sumChargedHadronPt +
659  std::max(0., pfIsolation.sumNeutralHadronEt + pfIsolation.sumPhotonEt - 0.5 * pfIsolation.sumPUPt)) /
660  muonPt;
661 }

◆ computeTrkIso()

float MuCSCTnPFlatTableProducer::computeTrkIso ( const reco::MuonIsolation isolation,
float  muonPt 
)
private

Definition at line 653 of file MuCSCTnPFlatTableProducer.cc.

References HLTObjectMonitor_cfi::muonPt.

Referenced by fillTable().

653  {
654  return isolation.sumPt / muonPt;
655 }

◆ fillDescriptions()

void MuCSCTnPFlatTableProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Fill descriptors.

Definition at line 182 of file MuCSCTnPFlatTableProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

182  {
184 
185  desc.add<std::string>("name", "cscTnP");
186  desc.add<edm::InputTag>("muonSrc", edm::InputTag{"muons"});
187  desc.add<edm::InputTag>("trackSrc", edm::InputTag{"generalTracks"});
188  desc.add<edm::InputTag>("cscSegmentSrc", edm::InputTag{"cscSegments"});
189  desc.add<edm::InputTag>("primaryVerticesSrc", edm::InputTag{"offlinePrimaryVertices"});
190 
191  desc.add<edm::InputTag>("trigEventSrc", edm::InputTag{"hltTriggerSummaryAOD::HLT"});
192  desc.add<edm::InputTag>("trigResultsSrc", edm::InputTag{"TriggerResults::HLT"});
193 
194  desc.add<std::string>("trigName", "none");
195  desc.add<std::string>("isoTrigName", "HLT_IsoMu2*");
196 
197  desc.setAllowAnything();
198 
199  descriptions.addWithDefaultLabel(desc);
200 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ fillTable()

void MuCSCTnPFlatTableProducer::fillTable ( edm::Event ev)
finalprotectedvirtual

Fill tree branches for a given events.

Implements MuBaseFlatTableProducer.

Definition at line 234 of file MuCSCTnPFlatTableProducer.cc.

References _trackIso, _zMass, MuBaseFlatTableProducer::addColumn(), calcDeltaR(), CSCGeometry::chamber(), computeTrkIso(), nano_mu::EDTokenHandle< T >::conditionalGet(), HGC3DClusterGenMatchSelector_cfi::dR, PV3DBase< T, PVType, FrameType >::eta(), makeMEIFBenchmarkPlots::ev, TrajectoryStateOnSurface::freeState(), CSCLayer::geometry(), GetEdgeAndDistToGap(), TrajectoryStateOnSurface::globalPosition(), hasTrigger(), CSCGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), nano_mu::ESTokenHandle< T, R, TR >::isValid(), nano_mu_digi_cff::layer, CSCChamber::layer(), hgcalTBTopologyTester_cfi::layers, m_cscGeometry, m_cscSegmentToken, m_isoTrigIndices, m_muonSP, m_muToken, MuBaseFlatTableProducer::m_name, m_nZCands, m_primaryVerticesToken, m_trackToken, m_transientTrackBuilder, m_trigEventToken, m_trigIndices, m_trigResultsToken, matchTTwithCSCSeg(), MEZ, eostools::move(), DiMuonV_cfg::muons, muonTagSelection(), CSCLayerGeometry::nearestWire(), PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), HLT_2024v14_cff::primaryVertices, propagatorAlong, propagatorOpposite, rpcPointValidation_cfi::recHit, ringCandidate(), mathSSE::sqrt(), CSCLayerGeometry::strip(), GeomDet::surface(), surfExtrapTrkSam(), TableParser::table, theBField, thisChamberCandidate(), HLT_2024v14_cff::track, trackProbeSelection(), DiMuonV_cfg::tracks, PDWG_DiPhoton_SD_cff::triggerEvent, triggerMatchMonitor_cfi::triggerObjects, triggerResults, run3scouting_cff::trkEta, run3scouting_cff::trkPhi, AlignmentTracksFromVertexSelector_cfi::vertices, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and zSelection().

234  {
235  unsigned int m_nZCands = 0; // the # of digis (size of all following vectors)
236 
237  // Muon track tag variables
238  std::vector<float> m_muonPt; // muon pT [GeV/c]
239  std::vector<float> m_muonPhi; // muon phi [rad]
240  std::vector<float> m_muonEta; // muon eta
241  std::vector<float> m_muonPtError; // muon pT [GeV/c] error
242  std::vector<float> m_muonPhiError; // muon phi [rad] error
243  std::vector<float> m_muonEtaError; // muon eta error
244  std::vector<int> m_muonCharge; // muon charge
245  std::vector<float> m_muonDXY; // muon dXY
246  std::vector<float> m_muonDZ; // muon dZ
247  std::vector<int> m_muonTrkHits; // muon track Hits
248  std::vector<float> m_muonChi2; // muon Chi2
249  std::vector<bool> m_muonTrigger; // muon trigger
250  std::vector<float> m_muonIso; // track Iso
251 
252  // Track probe variabes
253  std::vector<float> m_trackPt; // track pT [GeV/c]
254  std::vector<float> m_trackP; // track P [GeV/c]
255  std::vector<float> m_trackPhi; // track phi [rad]
256  std::vector<float> m_trackEta; // track eta
257  std::vector<float> m_trackPtError; // track pT [GeV/c] error
258  std::vector<float> m_trackPhiError; // track phi [rad] error
259  std::vector<float> m_trackEtaError; // track eta error
260  std::vector<int> m_trackCharge; // track charge
261  std::vector<float> m_trackDXY; // track dXY
262  std::vector<float> m_trackDZ; // track dZ
263  std::vector<int> m_trackTrkHits; // track Hits
264  std::vector<float> m_trackChi2; // track Chi2
265  std::vector<float> m_trackIso; // track Iso
266 
267  // Z and global variables
268  std::vector<float> m_zMass; // z mass
269  std::vector<float> m_dRTrackMuon; // dR between the track and muon
270  std::vector<float> m_numberOfPrimaryVertices; // Number of primary Vertices
271 
272  // CSC chamber information, station encoded in vector
273  std::vector<int> m_chamberEndcap; // chamber endcap
274  // station encoded in array index
275  std::array<std::vector<int>, 4> m_chamberRing; // chamber Ring
276  std::array<std::vector<int>, 4> m_chamberChamber; // chamber Chamber
277  std::array<std::vector<int>, 4> m_chamberLayer; // Segment layer information
278 
279  // Track intersection variables
280  std::array<std::vector<float>, 4> m_ttIntLocalX; // track trajector intersection local X on stations 1-4
281  std::array<std::vector<float>, 4> m_ttIntLocalY; // track trajector intersection local Y on stations 1-4
282  std::array<std::vector<float>, 4> m_ttIntLocalErrorX; // track trajector intersection local X on stations 1-4
283  std::array<std::vector<float>, 4> m_ttIntLocalErrorY; // track trajector intersection local Y on stations 1-4
284  std::array<std::vector<float>, 4> m_ttIntLocalW; // track trajector intersection local Wire on stations 1-4
285  std::array<std::vector<float>, 4> m_ttIntLocalS; // track trajector intersection local Strip on stations 1-4
286  std::array<std::vector<float>, 4> m_ttIntEta; // track trajector intersection Eta stations 1-4
287 
288  // Track intersection fiducial information
289 
290  std::array<std::vector<float>, 4>
291  m_ttDistToEdge; // track trajector intersection distance to edge, neg is with chamber, on stations 1-4
292  std::array<std::vector<float>, 4> m_ttDistToHVGap; // track trajector intersection distance to HV GAP on stations 1-4
293 
294  // Segment location variables
295  std::array<std::vector<float>, 4> m_segLocalX; // segment local X on stations 1-4
296  std::array<std::vector<float>, 4> m_segLocalY; // segment local Y on stations 1-4
297  std::array<std::vector<float>, 4> m_segLocalErrorX; // segment local X error on stations 1-4
298  std::array<std::vector<float>, 4> m_segLocalErrorY; // segment local Y error on stations 1-4
299 
300  // track intersection segment residuals variables
301  std::array<std::vector<float>, 4>
302  m_ttIntSegResidualLocalX; // track trajector intersection Segment residual local X on stations 1-4
303  std::array<std::vector<float>, 4>
304  m_ttIntSegResidualLocalY; // track trajector intersection Segment residuallocal Y on stations 1-4
305 
306  auto&& propagator_along = m_muonSP->propagator("SteppingHelixPropagatorAlong");
307  auto&& propagator_opposite = m_muonSP->propagator("SteppingHelixPropagatorOpposite");
308 
309  propagatorAlong = propagator_along;
310  propagatorOpposite = propagator_opposite;
311 
312  theBField = m_muonSP->magneticField();
313 
316  auto segments = m_cscSegmentToken.conditionalGet(ev);
318 
321 
322  if (muons.isValid() && tracks.isValid() && segments.isValid() && primaryVertices.isValid() &&
324  for (const auto& muon : (*muons)) {
325  if (!muonTagSelection(muon))
326  continue;
327 
328  bool muonTrigger = false;
329  if (triggerResults.isValid() && triggerEvent.isValid()) {
330  const auto& triggerObjects = triggerEvent->getObjects();
333  }
334 
335  for (const auto& track : (*tracks)) {
337  continue;
338  if (!zSelection(muon, track))
339  continue;
340  //std::cout << "Z candidate found: " << _zMass << " track eta: " << track.eta() << std::endl;
341  //std::cout.flush();
342  m_nZCands++;
343 
344  m_trackPt.push_back(track.pt());
345  m_trackP.push_back(track.p());
346  m_trackEta.push_back(track.eta());
347  m_trackPhi.push_back(track.phi());
348  m_trackPtError.push_back(track.pt());
349  m_trackEtaError.push_back(track.eta());
350  m_trackPhiError.push_back(track.phi());
351  m_trackCharge.push_back(track.charge());
352  m_trackDXY.push_back(track.dxy());
353  m_trackDZ.push_back(track.dz());
354  m_trackTrkHits.push_back(track.hitPattern().numberOfValidTrackerHits());
355  m_trackChi2.push_back(track.normalizedChi2());
356  m_trackIso.push_back(_trackIso);
357 
358  m_muonPt.push_back(muon.track()->pt());
359  m_muonPhi.push_back(muon.track()->phi());
360  m_muonEta.push_back(muon.track()->eta());
361  m_muonPtError.push_back(muon.track()->ptError());
362  m_muonPhiError.push_back(muon.track()->phiError());
363  m_muonEtaError.push_back(muon.track()->etaError());
364  m_muonCharge.push_back(muon.charge());
365  m_muonDXY.push_back(muon.track()->dxy());
366  m_muonDZ.push_back(muon.track()->dz());
367  m_muonTrkHits.push_back(muon.track()->hitPattern().numberOfValidTrackerHits());
368  m_muonChi2.push_back(muon.track()->normalizedChi2());
369  m_muonIso.push_back(computeTrkIso(muon.isolationR03(), muon.pt()));
370  m_muonTrigger.push_back(muonTrigger);
371 
372  m_zMass.push_back(_zMass);
373  double_t dR = calcDeltaR(track.eta(), muon.eta(), track.phi(), muon.phi());
374  //double_t dR = 1.0;
375  m_dRTrackMuon.push_back(dR);
376  const reco::VertexCollection& vertices = *primaryVertices.product();
377  m_numberOfPrimaryVertices.push_back(vertices.size());
378 
379  bool ec = (track.eta() > 0);
380  UChar_t endcapCSC = ec ? 0 : 1;
381  m_chamberEndcap.push_back(endcapCSC * 1);
382 
383  Int_t iiStationFail = 0;
384  Int_t iiStation0Pass = 0;
385  for (int iiStationZ = 0; iiStationZ < 6; iiStationZ++) {
386  UChar_t stationCSC = iiStationZ > 2 ? iiStationZ - 2 : 0;
387  UChar_t ringCSC = 0;
388  // Could monitor this problem here if necessary;
389  if (stationCSC == 0 && iiStation0Pass > 0)
390  continue;
391  TrajectoryStateOnSurface tsos = surfExtrapTrkSam(track, ec ? MEZ[iiStationZ] : -MEZ[iiStationZ]);
392 
393  if (tsos.isValid()) {
394  Float_t trkEta = tsos.globalPosition().eta(), trkPhi = tsos.globalPosition().phi();
395  ringCSC = ringCandidate(iiStationZ, stationCSC + 1, trkEta, trkPhi);
396 
397  if (ringCSC) {
398  UChar_t chamberCSC = thisChamberCandidate(stationCSC + 1, ringCSC, track.phi()) - 1;
399  CSCDetId Layer3id = CSCDetId(endcapCSC + 1, stationCSC + 1, ringCSC, chamberCSC + 1, 3);
400  CSCDetId Layer0Id = CSCDetId(endcapCSC + 1,
401  stationCSC + 1,
402  ringCSC,
403  chamberCSC + 1,
404  0); //layer 0 is the mid point of the chamber. It is not a real layer.
405  // !!!!! need to fix Layer0Id problem with ME1/1 here
406 
407  const BoundPlane& Layer3Surface = m_cscGeometry->idToDet(Layer3id)->surface();
408 
409  tsos = surfExtrapTrkSam(track, Layer3Surface.position().z());
410 
411  if (tsos.isValid()) {
412  if (stationCSC == 0)
413  iiStation0Pass++;
414  // Fill track intersection denominator information
415  LocalPoint localTTIntPoint = Layer3Surface.toLocal(tsos.freeState()->position());
416  const CSCLayerGeometry* layerGeoma = m_cscGeometry->chamber(Layer0Id)->layer(3)->geometry();
417  const CSCLayerGeometry* layerGeomb = m_cscGeometry->chamber(Layer0Id)->layer(4)->geometry();
418 
419  m_chamberRing[stationCSC].push_back(ringCSC);
420  m_chamberChamber[stationCSC].push_back(chamberCSC);
421  m_ttIntLocalX[stationCSC].push_back(localTTIntPoint.x());
422  m_ttIntLocalY[stationCSC].push_back(localTTIntPoint.y());
423  m_ttIntLocalW[stationCSC].push_back(
424  (layerGeoma->nearestWire(localTTIntPoint) + layerGeomb->nearestWire(localTTIntPoint)) / 2.0);
425  m_ttIntLocalS[stationCSC].push_back(
426  (layerGeoma->strip(localTTIntPoint) + layerGeomb->strip(localTTIntPoint)) / 2.0);
427  m_ttIntEta[stationCSC].push_back(trkEta);
428 
429  // Errors are those of the track intersection, chosing the plane and exact geomentry is performed in the function
430  Float_t CSCProjEdgeDist = -9999.0;
431  Float_t ttIntLocalErrorX = -9999.0;
432  Float_t CSCDyProjHVGap = 9999.0;
433  Float_t ttIntLocalErrorY = -9999.0;
434  for (Int_t ly = 1; ly < 7; ly++) {
435  CSCDetId Layerid = CSCDetId(endcapCSC + 1, stationCSC + 1, ringCSC, chamberCSC + 1, ly);
436  std::vector<Float_t> EdgeAndDistToGap(GetEdgeAndDistToGap(
437  track, Layerid)); //values: 1-edge;2-err of edge;3-disttogap;4-err of dist to gap
438  if (EdgeAndDistToGap[0] > CSCProjEdgeDist) {
439  CSCProjEdgeDist = EdgeAndDistToGap[0];
440  ttIntLocalErrorX = EdgeAndDistToGap[1];
441  }
442  if (EdgeAndDistToGap[2] < CSCDyProjHVGap) {
443  CSCDyProjHVGap = EdgeAndDistToGap[2];
444  ttIntLocalErrorY = EdgeAndDistToGap[3];
445  }
446  }
447  m_ttDistToEdge[stationCSC].push_back(CSCProjEdgeDist);
448  m_ttDistToHVGap[stationCSC].push_back(CSCDyProjHVGap);
449  m_ttIntLocalErrorX[stationCSC].push_back(ttIntLocalErrorX);
450  m_ttIntLocalErrorY[stationCSC].push_back(ttIntLocalErrorY);
451 
452  // now we have a local point for comparison to segments
454  TrajectoryStateOnSurface* TrajToSeg = matchTTwithCSCSeg(track, segments, cscSegOut, Layer3id);
455 
456  if (TrajToSeg == nullptr) {
457  // fill Null Num
458  m_segLocalX[stationCSC].push_back(-9999.0);
459  m_segLocalY[stationCSC].push_back(-9999.0);
460  m_segLocalErrorX[stationCSC].push_back(0.0);
461  m_segLocalErrorY[stationCSC].push_back(0.0);
462 
463  m_ttIntSegResidualLocalX[stationCSC].push_back(-9990.0);
464  m_ttIntSegResidualLocalY[stationCSC].push_back(-9990.0);
465 
466  m_chamberLayer[stationCSC].push_back(-9);
467 
468  continue;
469  }
470 
471  LocalPoint localSegmentPoint = (*cscSegOut).localPosition();
472  LocalError localSegErr = (*cscSegOut).localPositionError();
473 
474  m_segLocalX[stationCSC].push_back(localSegmentPoint.x());
475  m_segLocalY[stationCSC].push_back(localSegmentPoint.y());
476  m_segLocalErrorX[stationCSC].push_back(sqrt(localSegErr.xx()));
477  m_segLocalErrorY[stationCSC].push_back(sqrt(localSegErr.yy()));
478 
479  m_ttIntSegResidualLocalX[stationCSC].push_back(localTTIntPoint.x() - localSegmentPoint.x());
480  m_ttIntSegResidualLocalY[stationCSC].push_back(localTTIntPoint.y() - localSegmentPoint.y());
481  /* Extract layers for hits */
482  int layers = 0;
483  for (std::vector<CSCRecHit2D>::const_iterator itRH = cscSegOut->specificRecHits().begin();
484  itRH != cscSegOut->specificRecHits().end();
485  ++itRH) {
486  const CSCRecHit2D* recHit = &(*itRH);
487  int layer = recHit->cscDetId().layer();
488  layers |= 1 << (layer - 1);
489  }
490  m_chamberLayer[stationCSC].push_back(layers);
491 
492  } // end preliminary tsos is valid
493 
494  } // end found ring CSC
495 
496  } // end refined tsos is valid
497 
498  if ((!tsos.isValid()) || (ringCSC == 0)) {
499  // only fill Null denominator once for station 1, iiStation Z = 0,1,2
500  if (iiStationZ <= 2)
501  iiStationFail++;
502  if (iiStationZ > 2 || iiStationFail == 3) {
503  // fill Null Den Num
504  m_chamberRing[stationCSC].push_back(-9);
505  m_chamberChamber[stationCSC].push_back(-9);
506  m_ttIntLocalX[stationCSC].push_back(-9999.0);
507  m_ttIntLocalY[stationCSC].push_back(-9999.0);
508  m_ttIntLocalErrorX[stationCSC].push_back(0.0);
509  m_ttIntLocalErrorY[stationCSC].push_back(0.0);
510  m_ttIntLocalW[stationCSC].push_back(-9999.0);
511  m_ttIntLocalS[stationCSC].push_back(-9999.0);
512  m_ttIntEta[stationCSC].push_back(-9999.0);
513 
514  m_ttDistToEdge[stationCSC].push_back(-9999.0);
515  m_ttDistToHVGap[stationCSC].push_back(-9999.9);
516 
517  m_segLocalX[stationCSC].push_back(-9999.0);
518  m_segLocalY[stationCSC].push_back(-9999.0);
519  m_segLocalErrorX[stationCSC].push_back(0.0);
520  m_segLocalErrorY[stationCSC].push_back(0.0);
521 
522  m_ttIntSegResidualLocalX[stationCSC].push_back(-9990.0);
523  m_ttIntSegResidualLocalY[stationCSC].push_back(-9990.0);
524 
525  m_chamberLayer[stationCSC].push_back(-9);
526  }
527  }
528 
529  } // end loop over CSC Z planes
530  } // endl loop over tracks
531  } // end loop over muons
532 
533  } // End if good physics objects
534 
535  // if (m_nZCands>0) {
536  auto table = std::make_unique<nanoaod::FlatTable>(m_nZCands, m_name, false, false);
537 
538  table->setDoc("CSC Tag & Probe segment efficiency information");
539 
540  addColumn(table, "muonPt", m_muonPt, "muon pt [GeV/c]");
541  addColumn(table, "muonPhi", m_muonPhi, "muon phi [rad]");
542  addColumn(table, "muonEta", m_muonEta, "muon eta");
543  addColumn(table, "muonPtError", m_muonPtError, "muon pt error [GeV/c]");
544  addColumn(table, "muonPhiError", m_muonPhiError, "muon phi error [rad]");
545  addColumn(table, "muonEtaError", m_muonEtaError, "muon eta error");
546  addColumn(table, "muonCharge", m_muonCharge, "muon charge");
547  addColumn(table, "muonDXY", m_muonDXY, "muon dXY [cm]");
548  addColumn(table, "muonDZ", m_muonDZ, "muon dZ [cm]");
549  addColumn(table, "muonTrkHits", m_muonTrkHits, "muon track hits");
550  addColumn(table, "muonChi2", m_muonChi2, "muon chi2");
551  addColumn(table, "muonIso", m_trackIso, "muon relative iso");
552  addColumn(table, "muonTrigger", m_muonTrigger, "muon has trigger bool");
553 
554  addColumn(table, "trackPt", m_trackPt, "track pt [GeV/c]");
555  addColumn(table, "trackP", m_trackPt, "track p [GeV/c]");
556  addColumn(table, "trackPhi", m_trackPhi, "track phi [rad]");
557  addColumn(table, "trackEta", m_trackEta, "track eta");
558  addColumn(table, "trackPtError", m_trackPtError, "track pt error [GeV/c]");
559  addColumn(table, "trackPhiError", m_trackPhiError, "track phi error [rad]");
560  addColumn(table, "trackEtaError", m_trackEtaError, "track eta error");
561  addColumn(table, "trackCharge", m_trackCharge, "track charge");
562  addColumn(table, "trackDXY", m_trackDXY, "track dXY [cm]");
563  addColumn(table, "trackDZ", m_trackDZ, "track dZ [cm]");
564  addColumn(table, "trackTrkHits", m_trackTrkHits, "track track hits");
565  addColumn(table, "trackChi2", m_trackChi2, "track chi2");
566  addColumn(table, "trackIso", m_trackIso, "track relative iso");
567 
568  addColumn(table, "zMass", m_zMass, "Z mass [GeV/c^2]");
569  addColumn(table, "dRTrackMuon", m_dRTrackMuon, "dR between track and muon");
570  addColumn(table, "numberOfPrimaryVertidies", m_numberOfPrimaryVertices, "Number of PVs");
571 
572  addColumn(table, "chamberEndcap", m_chamberEndcap, "");
573  addColumn(table, "chamberRing1", m_chamberRing[0], "");
574  addColumn(table, "chamberRing2", m_chamberRing[1], "");
575  addColumn(table, "chamberRing3", m_chamberRing[2], "");
576  addColumn(table, "chamberRing4", m_chamberRing[3], "");
577  addColumn(table, "chamberChamber1", m_chamberChamber[0], "");
578  addColumn(table, "chamberChamber2", m_chamberChamber[1], "");
579  addColumn(table, "chamberChamber3", m_chamberChamber[2], "");
580  addColumn(table, "chamberChamber4", m_chamberChamber[3], "");
581  addColumn(table, "chamberLayer1", m_chamberLayer[0], "");
582  addColumn(table, "chamberLayer2", m_chamberLayer[1], "");
583  addColumn(table, "chamberLayer3", m_chamberLayer[2], "");
584  addColumn(table, "chamberLayer4", m_chamberLayer[3], "");
585 
586  addColumn(table, "ttIntLocalX1", m_ttIntLocalX[0], "");
587  addColumn(table, "ttIntLocalX2", m_ttIntLocalX[1], "");
588  addColumn(table, "ttIntLocalX3", m_ttIntLocalX[2], "");
589  addColumn(table, "ttIntLocalX4", m_ttIntLocalX[3], "");
590  addColumn(table, "ttIntLocalY1", m_ttIntLocalY[0], "");
591  addColumn(table, "ttIntLocalY2", m_ttIntLocalY[1], "");
592  addColumn(table, "ttIntLocalY3", m_ttIntLocalY[2], "");
593  addColumn(table, "ttIntLocalY4", m_ttIntLocalY[3], "");
594  addColumn(table, "ttIntLocalErrorX1", m_ttIntLocalErrorX[0], "");
595  addColumn(table, "ttIntLocalErrorX2", m_ttIntLocalErrorX[1], "");
596  addColumn(table, "ttIntLocalErrorX3", m_ttIntLocalErrorX[2], "");
597  addColumn(table, "ttIntLocalErrorX4", m_ttIntLocalErrorX[3], "");
598  addColumn(table, "ttIntLocalErrorY1", m_ttIntLocalErrorY[0], "");
599  addColumn(table, "ttIntLocalErrorY2", m_ttIntLocalErrorY[1], "");
600  addColumn(table, "ttIntLocalErrorY3", m_ttIntLocalErrorY[2], "");
601  addColumn(table, "ttIntLocalErrorY4", m_ttIntLocalErrorY[3], "");
602  addColumn(table, "ttIntLocalW1", m_ttIntLocalW[0], "");
603  addColumn(table, "ttIntLocalW2", m_ttIntLocalW[1], "");
604  addColumn(table, "ttIntLocalW3", m_ttIntLocalW[2], "");
605  addColumn(table, "ttIntLocalW4", m_ttIntLocalW[3], "");
606  addColumn(table, "ttIntLocalS1", m_ttIntLocalS[0], "");
607  addColumn(table, "ttIntLocalS2", m_ttIntLocalS[1], "");
608  addColumn(table, "ttIntLocalS3", m_ttIntLocalS[2], "");
609  addColumn(table, "ttIntLocalS4", m_ttIntLocalS[3], "");
610  addColumn(table, "ttIntEta1", m_ttIntEta[0], "");
611  addColumn(table, "ttIntEta2", m_ttIntEta[1], "");
612  addColumn(table, "ttIntEta3", m_ttIntEta[2], "");
613  addColumn(table, "ttIntEta4", m_ttIntEta[3], "");
614 
615  addColumn(table, "ttDistToEdge1", m_ttDistToEdge[0], "");
616  addColumn(table, "ttDistToEdge2", m_ttDistToEdge[1], "");
617  addColumn(table, "ttDistToEdge3", m_ttDistToEdge[2], "");
618  addColumn(table, "ttDistToEdge4", m_ttDistToEdge[3], "");
619  addColumn(table, "ttDistToHVGap1", m_ttDistToHVGap[0], "");
620  addColumn(table, "ttDistToHVGap2", m_ttDistToHVGap[1], "");
621  addColumn(table, "ttDistToHVGap3", m_ttDistToHVGap[2], "");
622  addColumn(table, "ttDistToHVGap4", m_ttDistToHVGap[3], "");
623 
624  addColumn(table, "segLocalX1", m_segLocalX[0], "");
625  addColumn(table, "segLocalX2", m_segLocalX[1], "");
626  addColumn(table, "segLocalX3", m_segLocalX[2], "");
627  addColumn(table, "segLocalX4", m_segLocalX[3], "");
628  addColumn(table, "segLocalY1", m_segLocalY[0], "");
629  addColumn(table, "segLocalY2", m_segLocalY[1], "");
630  addColumn(table, "segLocalY3", m_segLocalY[2], "");
631  addColumn(table, "segLocalY4", m_segLocalY[3], "");
632  addColumn(table, "segLocalErrorX1", m_segLocalErrorX[0], "");
633  addColumn(table, "segLocalErrorX2", m_segLocalErrorX[1], "");
634  addColumn(table, "segLocalErrorX3", m_segLocalErrorX[2], "");
635  addColumn(table, "segLocalErrorX4", m_segLocalErrorX[3], "");
636  addColumn(table, "segLocalErrorY1", m_segLocalErrorY[0], "");
637  addColumn(table, "segLocalErrorY2", m_segLocalErrorY[1], "");
638  addColumn(table, "segLocalErrorY3", m_segLocalErrorY[2], "");
639  addColumn(table, "segLocalErrorY4", m_segLocalErrorY[3], "");
640 
641  addColumn(table, "ttIntSegResidualLocalX1", m_ttIntSegResidualLocalX[0], "");
642  addColumn(table, "ttIntSegResidualLocalX2", m_ttIntSegResidualLocalX[1], "");
643  addColumn(table, "ttIntSegResidualLocalX3", m_ttIntSegResidualLocalX[2], "");
644  addColumn(table, "ttIntSegResidualLocalX4", m_ttIntSegResidualLocalX[3], "");
645  addColumn(table, "ttIntSegResidualLocalY1", m_ttIntSegResidualLocalY[0], "");
646  addColumn(table, "ttIntSegResidualLocalY2", m_ttIntSegResidualLocalY[1], "");
647  addColumn(table, "ttIntSegResidualLocalY3", m_ttIntSegResidualLocalY[2], "");
648  addColumn(table, "ttIntSegResidualLocalY4", m_ttIntSegResidualLocalY[3], "");
649 
650  ev.put(std::move(table));
651 }
nano_mu::EDTokenHandle< std::vector< reco::Vertex > > m_primaryVerticesToken
edm::ESHandle< Propagator > propagatorOpposite
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:30
TrajectoryStateOnSurface surfExtrapTrkSam(const reco::Track &, double)
edm::ESHandle< MagneticField > theBField
static constexpr Float_t MEZ[6]
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
double calcDeltaR(double, double, double, double)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
auto conditionalGet(const edm::Event &ev) const
Definition: MuNtupleUtils.h:49
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
UChar_t ringCandidate(Int_t iiStation, Int_t station, Float_t feta, Float_t phi)
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
GlobalPoint position() const
void addColumn(std::unique_ptr< nanoaod::FlatTable > &table, const std::string name, const std::vector< T > &vec, const std::string descr)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
UChar_t thisChamberCandidate(UChar_t station, UChar_t ring, Float_t phi)
float strip(const LocalPoint &lp) const
GlobalPoint globalPosition() const
bool muonTagSelection(const reco::Muon &)
T sqrt(T t)
Definition: SSEVec.h:23
nano_mu::EDTokenHandle< CSCSegmentCollection > m_cscSegmentToken
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
nano_mu::EDTokenHandle< edm::TriggerResults > m_trigResultsToken
static std::string const triggerResults
Definition: EdmProvDump.cc:47
int nearestWire(const LocalPoint &lp) const
nano_mu::EDTokenHandle< reco::MuonCollection > m_muToken
Tokens.
std::vector< Float_t > GetEdgeAndDistToGap(const reco::Track &, CSCDetId &)
TrajectoryStateOnSurface * matchTTwithCSCSeg(const reco::Track &, edm::Handle< CSCSegmentCollection >, CSCSegmentCollection::const_iterator &, CSCDetId &)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
bool zSelection(const reco::Muon &, const reco::Track &)
bool trackProbeSelection(const reco::Track &track, edm::Handle< std::vector< reco::Track >>)
Selection functions.
bool isValid()
Check validity.
Definition: MuNtupleUtils.h:76
float computeTrkIso(const reco::MuonIsolation &, float)
std::string m_name
The label name of the FlatTableProducer.
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.
nano_mu::EDTokenHandle< trigger::TriggerEvent > m_trigEventToken
edm::ESHandle< Propagator > propagatorAlong
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< int > m_trigIndices
Indices of the triggers used by muon filler for trigger matching.
bool hasTrigger(std::vector< int > &, const trigger::TriggerObjectCollection &, edm::Handle< trigger::TriggerEvent > &, const reco::Muon &)
float xx() const
Definition: LocalError.h:22
def move(src, dest)
Definition: eostools.py:511
nano_mu::EDTokenHandle< reco::TrackCollection > m_trackToken
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91

◆ freeTrajStateMuon()

FreeTrajectoryState MuCSCTnPFlatTableProducer::freeTrajStateMuon ( const reco::Track track)
private

Definition at line 758 of file MuCSCTnPFlatTableProducer.cc.

References MillePedeFileConverter_cfg::e, theBField, and HLT_2024v14_cff::track.

Referenced by surfExtrapTrkSam().

758  {
759  //no track extras in nanoaod so directly use vx and p
760  GlobalPoint innerPoint(track.vx(), track.vy(), track.vz());
761  GlobalVector innerVec(track.px(), track.py(), track.pz());
762 
763  GlobalTrajectoryParameters gtPars(innerPoint, innerVec, track.charge(), &*theBField);
764 
766  cov *= 1e-20;
767 
768  CartesianTrajectoryError tCov(cov);
769 
770  return (cov.kRows == 6 ? FreeTrajectoryState(gtPars, tCov) : FreeTrajectoryState(gtPars));
771 }
edm::ESHandle< MagneticField > theBField
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66

◆ GetEdgeAndDistToGap()

std::vector< Float_t > MuCSCTnPFlatTableProducer::GetEdgeAndDistToGap ( const reco::Track track,
CSCDetId detid 
)
private

Definition at line 910 of file MuCSCTnPFlatTableProducer.cc.

References funct::abs(), ALCARECOPPSCalTrackBasedSel_cff::detid, TrajectoryStateOnSurface::freeState(), CSCLayer::geometry(), CSCGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), CSCGeometry::layer(), CSCWireTopology::lengthOfPlane(), TrajectoryStateOnSurface::localError(), m_cscGeometry, CSCWireTopology::narrowWidthOfPlane(), GloballyPositioned< T >::position(), FreeTrajectoryState::position(), LocalTrajectoryError::positionError(), mps_fire::result, mathSSE::sqrt(), GeomDet::surface(), surfExtrapTrkSam(), GloballyPositioned< T >::toLocal(), HLT_2024v14_cff::track, CSCWireTopology::wideWidthOfPlane(), CSCWireTopology::wireAngle(), CSCLayerGeometry::wireTopology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), YDistToHVDeadZone(), CSCWireTopology::yOfWire(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by fillTable().

910  {
911  std::vector<Float_t> result(4, 9999.);
912  result[3] = -9999;
913  const GeomDet* gdet = m_cscGeometry->idToDet(detid);
915  if (!tsos.isValid())
916  return result;
917  LocalPoint localTTPos = gdet->surface().toLocal(tsos.freeState()->position());
918  const CSCWireTopology* wireTopology = m_cscGeometry->layer(detid)->geometry()->wireTopology();
919  Float_t wideWidth = wireTopology->wideWidthOfPlane();
920  Float_t narrowWidth = wireTopology->narrowWidthOfPlane();
921  Float_t length = wireTopology->lengthOfPlane();
922  // If slanted, there is no y offset between local origin and symmetry center of wire plane
923  Float_t yOfFirstWire = std::abs(wireTopology->wireAngle()) > 1.E-06 ? -0.5 * length : wireTopology->yOfWire(1);
924  // y offset between local origin and symmetry center of wire plane
925  Float_t yCOWPOffset = yOfFirstWire + 0.5 * length;
926  // tangent of the incline angle from inside the trapezoid
927  Float_t tangent = (wideWidth - narrowWidth) / (2. * length);
928  // y position wrt bottom of trapezoid
929  Float_t yPrime = localTTPos.y() + std::abs(yOfFirstWire);
930  // half trapezoid width at y' is 0.5 * narrowWidth + x side of triangle with the above tangent and side y'
931  Float_t halfWidthAtYPrime = 0.5 * narrowWidth + yPrime * tangent;
932  // x offset between local origin and symmetry center of wire plane is zero
933  // x offset of ME11s is also zero. x center of wire groups is not at zero, because it is not parallel to x. The wire groups of ME11s have a complex geometry, see the code in m_debug.
934  Float_t edgex = std::abs(localTTPos.x()) - halfWidthAtYPrime;
935  Float_t edgey = std::abs(localTTPos.y() - yCOWPOffset) - 0.5 * length;
936  LocalError localTTErr = tsos.localError().positionError();
937  if (edgex > edgey) {
938  result[0] = edgex;
939  result[1] = sqrt(localTTErr.xx());
940  //result[1] = sqrt(tsos.cartesianError().position().cxx());
941  } else {
942  result[0] = edgey;
943  result[1] = sqrt(localTTErr.yy());
944  //result[1] = sqrt(tsos.cartesianError().position().cyy());
945  }
946  result[2] = YDistToHVDeadZone(localTTPos.y(), detid.station() * 10 + detid.ring());
947  result[3] = sqrt(localTTErr.yy());
948  return result; //return values: 1-edge;2-err of edge;3-disttogap;4-err of dist to gap
949 }
TrajectoryStateOnSurface surfExtrapTrkSam(const reco::Track &, double)
double wideWidthOfPlane() const
const LocalTrajectoryError & localError() const
const CSCWireTopology * wireTopology() const
T z() const
Definition: PV3DBase.h:61
LocalError positionError() const
LocalPoint toLocal(const GlobalPoint &gp) const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
float wireAngle() const override
T sqrt(T t)
Definition: SSEVec.h:23
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Float_t YDistToHVDeadZone(Float_t, Int_t)
float yOfWire(float wire, float x=0.) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() const
double lengthOfPlane() const
double narrowWidthOfPlane() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:105
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91

◆ getFromES() [1/2]

void MuCSCTnPFlatTableProducer::getFromES ( const edm::Run run,
const edm::EventSetup environment 
)
finalprotectedvirtual

Get info from the ES by run.

Reimplemented from MuBaseFlatTableProducer.

Definition at line 202 of file MuCSCTnPFlatTableProducer.cc.

References reco_calib_source_client_cfg::environment, nano_mu::ESTokenHandle< T, R, TR >::getFromES(), HLTConfigProvider::init(), m_cscGeometry, m_hltConfig, m_isoTrigIndices, m_isoTrigName, m_trigIndices, m_trigName, hltMonBTagIPClient_cfi::pathName, writedatasetfile::run, HLTConfigProvider::size(), simpleEdmComparison::tName, and HLTConfigProvider::triggerName().

202  {
204 
205  bool changed{true};
206  m_hltConfig.init(run, environment, "HLT", changed);
207 
208  const bool enableWildcard{true};
209 
210  TString tName = TString(m_trigName);
211  TRegexp tNamePattern = TRegexp(tName, enableWildcard);
212 
213  for (unsigned iPath = 0; iPath < m_hltConfig.size(); ++iPath) {
214  TString pathName = TString(m_hltConfig.triggerName(iPath));
215  if (pathName.Contains(tNamePattern))
216  m_trigIndices.push_back(static_cast<int>(iPath));
217  }
218 
219  tName = TString(m_isoTrigName);
220  tNamePattern = TRegexp(tName, enableWildcard);
221 
222  for (unsigned iPath = 0; iPath < m_hltConfig.size(); ++iPath) {
223  TString pathName = TString(m_hltConfig.triggerName(iPath));
224  if (pathName.Contains(tNamePattern))
225  m_isoTrigIndices.push_back(static_cast<int>(iPath));
226  }
227 }
const std::string & triggerName(unsigned int triggerIndex) const
unsigned int size() const
number of trigger paths in trigger table
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
std::string m_trigName
Name of the triggers used by muon filler for trigger matching.
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void getFromES(const edm::EventSetup &environment)
Get Handle from ES.
Definition: MuNtupleUtils.h:73
std::vector< int > m_trigIndices
Indices of the triggers used by muon filler for trigger matching.
HLTConfigProvider m_hltConfig
HLT config provider.

◆ getFromES() [2/2]

void MuCSCTnPFlatTableProducer::getFromES ( const edm::EventSetup environment)
finalprotectedvirtual

Get info from the ES for a given event.

Reimplemented from MuBaseFlatTableProducer.

Definition at line 229 of file MuCSCTnPFlatTableProducer.cc.

References reco_calib_source_client_cfg::environment, nano_mu::ESTokenHandle< T, R, TR >::getFromES(), m_muonSP, and m_transientTrackBuilder.

229  {
231  m_muonSP->update(environment);
232 }
nano_mu::ESTokenHandle< TransientTrackBuilder, TransientTrackRecord > m_transientTrackBuilder
Transient Track Builder.
void getFromES(const edm::EventSetup &environment)
Get Handle from ES.
Definition: MuNtupleUtils.h:73
std::unique_ptr< MuonServiceProxy > m_muonSP
Muon service proxy.

◆ hasTrigger()

bool MuCSCTnPFlatTableProducer::hasTrigger ( std::vector< int > &  trigIndices,
const trigger::TriggerObjectCollection trigObjs,
edm::Handle< trigger::TriggerEvent > &  trigEvent,
const reco::Muon muon 
)
private

Definition at line 663 of file MuCSCTnPFlatTableProducer.cc.

References eleIsoSequence_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, METSignificanceParams_cfi::dRMatch, spr::find(), relativeConstraints::keys, m_hltConfig, HLTConfigProvider::moduleLabels(), B2GTnPMonitor_cfi::trigEvent, and TriggerAnalyzer::trigObjs.

Referenced by fillTable().

666  {
667  float dRMatch = 999.;
668  for (int trigIdx : trigIndices) {
669  const std::vector<std::string> trigModuleLabels = m_hltConfig.moduleLabels(trigIdx);
670 
671  const unsigned trigModuleIndex =
672  std::find(trigModuleLabels.begin(), trigModuleLabels.end(), "hltBoolEnd") - trigModuleLabels.begin() - 1;
673  const unsigned hltFilterIndex = trigEvent->filterIndex(edm::InputTag(trigModuleLabels[trigModuleIndex], "", "HLT"));
674  if (hltFilterIndex < trigEvent->sizeFilters()) {
675  const trigger::Keys keys = trigEvent->filterKeys(hltFilterIndex);
676  const trigger::Vids vids = trigEvent->filterIds(hltFilterIndex);
677  const unsigned nTriggers = vids.size();
678 
679  for (unsigned iTrig = 0; iTrig < nTriggers; ++iTrig) {
680  trigger::TriggerObject trigObj = trigObjs[keys[iTrig]];
681  float dR = deltaR(muon, trigObj);
682  if (dR < dRMatch)
683  dRMatch = dR;
684  }
685  }
686  }
687 
688  return dRMatch < 0.1; //CB should get it programmable
689 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< size_type > Keys
std::vector< int > Vids
HLTConfigProvider m_hltConfig
HLT config provider.

◆ iso()

double MuCSCTnPFlatTableProducer::iso ( const reco::Track )
private

Definition at line 999 of file MuCSCTnPFlatTableProducer.cc.

References calcDeltaR(), HGC3DClusterGenMatchSelector_cfi::dR, objects.IsoTrackAnalyzer::isoSum, HLT_2024v14_cff::track, and DiMuonV_cfg::tracks.

Referenced by trackProbeSelection().

999  {
1000  double isoSum = 0.0;
1001  for (const auto& track2 : (*tracks)) {
1002  double dR = calcDeltaR(track.eta(), track2.eta(), track.phi(), track2.phi());
1003  if (track2.pt() > 1.0 && dR > 0.001 && dR < 0.3)
1004  isoSum += track2.pt();
1005  }
1006  return isoSum / track.pt();
1007 }
double calcDeltaR(double, double, double, double)
isoSum
===> compute the isolation and find the most isolated track

◆ matchTTwithCSCSeg()

TrajectoryStateOnSurface * MuCSCTnPFlatTableProducer::matchTTwithCSCSeg ( const reco::Track track,
edm::Handle< CSCSegmentCollection cscSegments,
CSCSegmentCollection::const_iterator cscSegOut,
CSCDetId idCSC 
)
private

Definition at line 866 of file MuCSCTnPFlatTableProducer.cc.

References funct::abs(), CSCDetId::chamber(), CSCGeometry::chamber(), dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), m_cscGeometry, CSCDetId::ring(), relativeConstraints::ring, CSCDetId::station(), surfExtrapTrkSam(), GeomDet::toGlobal(), HLT_2024v14_cff::track, TrajectoryDistToSeg(), and z.

Referenced by fillTable().

869  {
870  TrajectoryStateOnSurface* TrajSuf = nullptr;
871  Float_t deltaCSCR = 9999.;
872  for (CSCSegmentCollection::const_iterator segIt = cscSegments->begin(); segIt != cscSegments->end(); segIt++) {
873  CSCDetId id = (CSCDetId)(*segIt).cscDetId();
874 
875  if (idCSC.endcap() != id.endcap())
876  continue;
877  if (idCSC.station() != id.station())
878  continue;
879  if (idCSC.chamber() != id.chamber())
880  continue;
881 
882  Bool_t ed1 =
883  (idCSC.station() == 1) && ((idCSC.ring() == 1 || idCSC.ring() == 4) && (id.ring() == 1 || id.ring() == 4));
884  Bool_t ed2 =
885  (idCSC.station() == 1) && ((idCSC.ring() == 2 && id.ring() == 2) || (idCSC.ring() == 3 && id.ring() == 3));
886  Bool_t ed3 = (idCSC.station() != 1) && (idCSC.ring() == id.ring());
887  Bool_t TMCSCMatch = (ed1 || ed2 || ed3);
888 
889  if (!TMCSCMatch)
890  continue;
891 
892  const CSCChamber* cscchamber = m_cscGeometry->chamber(id);
893 
894  if (!cscchamber)
895  continue;
896 
897  TrajectoryStateOnSurface TrajSuf_ = surfExtrapTrkSam(track, cscchamber->toGlobal((*segIt).localPosition()).z());
898  Float_t dR_ = std::abs(TrajectoryDistToSeg(TrajSuf_, segIt));
899  if (dR_ < deltaCSCR) {
900  delete TrajSuf;
901  TrajSuf = new TrajectoryStateOnSurface(TrajSuf_);
902  deltaCSCR = dR_;
903  cscSegOut = segIt;
904  }
905  } //loop over segments
906 
907  return TrajSuf;
908 }
TrajectoryStateOnSurface surfExtrapTrkSam(const reco::Track &, double)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
Float_t TrajectoryDistToSeg(TrajectoryStateOnSurface, CSCSegmentCollection::const_iterator)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int chamber() const
Definition: CSCDetId.h:62
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
int station() const
Definition: CSCDetId.h:79
int endcap() const
Definition: CSCDetId.h:85
int ring() const
Definition: CSCDetId.h:68

◆ muonTagSelection()

bool MuCSCTnPFlatTableProducer::muonTagSelection ( const reco::Muon muon)
private

Definition at line 692 of file MuCSCTnPFlatTableProducer.cc.

References _muonIso, funct::abs(), PixelTripletNoTipGenerator_cfi::chi2Cut, computePFIso(), heepElectronID_HEEPV51_cff::dxyCut, TrackSplittingMonitor_cfi::dzCut, and jetfilter_cfi::ptCut.

Referenced by fillTable().

692  {
693  float ptCut = 10.0;
694  int trackerHitsCut = 8;
695  float dxyCut = 2.0;
696  float dzCut = 24.0;
697  float chi2Cut = 4.0;
698 
699  bool selected = false;
700  //_muonIso = iso(*muon.track(),tracks);
701  _muonIso = computePFIso(muon.pfIsolationR04(), muon.pt());
702 
703  if (!muon.isTrackerMuon())
704  return false;
705  if (!muon.track().isNonnull())
706  return false;
707  selected =
708  ((muon.track()->pt() > ptCut) && (muon.track()->hitPattern().numberOfValidTrackerHits() >= trackerHitsCut) &&
709  (muon.track()->dxy() < dxyCut) && (std::abs(muon.track()->dz()) < dzCut) &&
710  (muon.track()->normalizedChi2() < chi2Cut) && _muonIso < 0.1);
711 
712  return selected;
713 }
float computePFIso(const reco::MuonPFIsolation &, float)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ ringCandidate()

UChar_t MuCSCTnPFlatTableProducer::ringCandidate ( Int_t  iiStation,
Int_t  station,
Float_t  feta,
Float_t  phi 
)
private

Definition at line 773 of file MuCSCTnPFlatTableProducer.cc.

References funct::abs(), JetMETHLTOfflineSource_cfi::feta, relativeConstraints::ring, and relativeConstraints::station.

Referenced by fillTable().

773  {
774  UChar_t ring = 0;
775 
776  switch (station) {
777  case 1:
778  if (std::abs(feta) >= 0.85 && std::abs(feta) < 1.18) { //ME13
779  if (iiStation == 2)
780  ring = 3;
781  return ring;
782  }
783  if (std::abs(feta) >= 1.18 &&
784  std::abs(feta) <= 1.5) { //ME12 if(std::abs(feta)>1.18 && std::abs(feta)<1.7){//ME12
785  if (iiStation == 1)
786  ring = 2;
787  return ring;
788  }
789  if (std::abs(feta) > 1.5 && std::abs(feta) < 2.1) { //ME11
790  if (iiStation == 0)
791  ring = 1;
792  return ring;
793  }
794  if (std::abs(feta) >= 2.1 && std::abs(feta) < 2.45) { //ME11
795  if (iiStation == 0)
796  ring = 4;
797  return ring;
798  }
799  break;
800  case 2:
801  if (std::abs(feta) > 0.95 && std::abs(feta) < 1.6) { //ME22
802  ring = 2;
803  return ring;
804  }
805  if (std::abs(feta) > 1.55 && std::abs(feta) < 2.45) { //ME21
806  ring = 1;
807  return ring;
808  }
809  break;
810  case 3:
811  if (std::abs(feta) > 1.08 && std::abs(feta) < 1.72) { //ME32
812  ring = 2;
813  return ring;
814  }
815  if (std::abs(feta) > 1.69 && std::abs(feta) < 2.45) { //ME31
816  ring = 1;
817  return ring;
818  }
819  break;
820  case 4:
821  if (std::abs(feta) > 1.78 && std::abs(feta) < 2.45) { //ME41
822  ring = 1;
823  return ring;
824  }
825  if (std::abs(feta) > 1.15 && std::abs(feta) <= 1.78) { //ME42
826  ring = 2;
827  return ring;
828  }
829  break;
830  default:
831  edm::LogError("") << "Invalid station: " << station << std::endl;
832  break;
833  }
834  return 0;
835 }
Log< level::Error, false > LogError
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ surfExtrapTrkSam()

TrajectoryStateOnSurface MuCSCTnPFlatTableProducer::surfExtrapTrkSam ( const reco::Track track,
double  z 
)
private

Definition at line 744 of file MuCSCTnPFlatTableProducer.cc.

References Plane::build(), freeTrajStateMuon(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), propagatorAlong, propagatorOpposite, makeMuonMisalignmentScenario::rot, HLT_2024v14_cff::track, and z.

Referenced by fillTable(), GetEdgeAndDistToGap(), and matchTTwithCSCSeg().

744  {
745  Plane::PositionType pos(0, 0, z);
748 
750  TrajectoryStateOnSurface recoProp = propagatorAlong->propagate(recoStart, *myPlane);
751 
752  if (!recoProp.isValid())
753  recoProp = propagatorOpposite->propagate(recoStart, *myPlane);
754 
755  return recoProp;
756 }
edm::ESHandle< Propagator > propagatorOpposite
FreeTrajectoryState freeTrajStateMuon(const reco::Track &)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
edm::ESHandle< Propagator > propagatorAlong

◆ thisChamberCandidate()

UChar_t MuCSCTnPFlatTableProducer::thisChamberCandidate ( UChar_t  station,
UChar_t  ring,
Float_t  phi 
)
private

Definition at line 837 of file MuCSCTnPFlatTableProducer.cc.

References M_PI, phi, relativeConstraints::ring, and relativeConstraints::station.

Referenced by fillTable().

837  {
838  // cout <<"\t\t TPTrackMuonSys::thisChamberCandidate..."<<endl;
839 
840  //search for chamber candidate based on CMS IN-2007/024
841  //10 deg chambers are ME1,ME22,ME32,ME42 chambers; 20 deg chambers are ME21,31,41 chambers
842  //Chambers one always starts from approx -5 deg.
843  const UChar_t nVal = (station > 1 && ring == 1) ? 18 : 36;
844  const Float_t ChamberSpan = 2 * M_PI / nVal;
845  Float_t dphi = phi + M_PI / 36;
846  while (dphi >= 2 * M_PI)
847  dphi -= 2 * M_PI;
848  while (dphi < 0)
849  dphi += 2 * M_PI;
850  UChar_t ChCand = floor(dphi / ChamberSpan) + 1;
851  return ChCand > nVal ? nVal : ChCand;
852 }
#define M_PI

◆ trackProbeSelection()

bool MuCSCTnPFlatTableProducer::trackProbeSelection ( const reco::Track track)
private

Selection functions.

Definition at line 715 of file MuCSCTnPFlatTableProducer.cc.

References _trackIso, funct::abs(), PixelTripletNoTipGenerator_cfi::chi2Cut, heepElectronID_HEEPV51_cff::dxyCut, TrackSplittingMonitor_cfi::dzCut, iso(), jetfilter_cfi::ptCut, HLT_2024v14_cff::track, and DiMuonV_cfg::tracks.

Referenced by fillTable().

716  {
717  float ptCut = 10.0;
718  int trackerHitsCut = 8;
719  float dxyCut = 2.0;
720  float dzCut = 24.0;
721  float chi2Cut = 4.0;
722 
723  bool selected = false;
725 
726  selected =
727  ((track.pt() > ptCut) && (std::abs(track.eta()) > 0.75) && (std::abs(track.eta()) < 2.55) &&
728  (track.numberOfValidHits() >= trackerHitsCut) && (track.dxy() < dxyCut) && (std::abs(track.dz()) < dzCut) &&
729  (track.normalizedChi2() > 0.0) && (track.normalizedChi2() < chi2Cut) && _trackIso < 0.1);
730 
731  return selected;
732 }
double iso(const reco::Track &, edm::Handle< std::vector< reco::Track >>)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ TrajectoryDistToSeg()

Float_t MuCSCTnPFlatTableProducer::TrajectoryDistToSeg ( TrajectoryStateOnSurface  TrajSuf,
CSCSegmentCollection::const_iterator  segIt 
)
private

Definition at line 854 of file MuCSCTnPFlatTableProducer.cc.

References TrajectoryStateOnSurface::freeState(), CSCGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), m_cscGeometry, FreeTrajectoryState::position(), funct::pow(), mathSSE::sqrt(), GeomDet::surface(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by matchTTwithCSCSeg().

855  {
856  if (!TrajSuf.isValid())
857  return 9999.;
858  const GeomDet* gdet = m_cscGeometry->idToDet((CSCDetId)(*segIt).cscDetId());
859  LocalPoint localTTPos = gdet->surface().toLocal(TrajSuf.freeState()->position());
860  LocalPoint localSegPos = (*segIt).localPosition();
861  Float_t CSCdeltaX = localSegPos.x() - localTTPos.x();
862  Float_t CSCdeltaY = localSegPos.y() - localTTPos.y();
863  return sqrt(pow(CSCdeltaX, 2) + pow(CSCdeltaY, 2));
864 }
LocalPoint toLocal(const GlobalPoint &gp) const
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:23
nano_mu::ESTokenHandle< CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun > m_cscGeometry
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
FreeTrajectoryState const * freeState(bool withErrors=true) const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91

◆ YDistToHVDeadZone()

Float_t MuCSCTnPFlatTableProducer::YDistToHVDeadZone ( Float_t  yLocal,
Int_t  StationAndRing 
)
private

Definition at line 953 of file MuCSCTnPFlatTableProducer.cc.

References funct::abs(), and HGVHistoProducerAlgoBlock_cfi::minY.

Referenced by GetEdgeAndDistToGap().

953  {
954  //the ME11 wires are not parallel to x, but no gap
955  //chamber edges are not included.
956  const Float_t deadZoneCenterME1_2[2] = {-32.88305, 32.867423};
957  const Float_t deadZoneCenterME1_3[2] = {-22.7401, 27.86665};
958  const Float_t deadZoneCenterME2_1[2] = {-27.47, 33.67};
959  const Float_t deadZoneCenterME3_1[2] = {-36.21, 23.68};
960  const Float_t deadZoneCenterME4_1[2] = {-26.14, 23.85};
961  const Float_t deadZoneCenterME234_2[4] = {-81.8744, -21.18165, 39.51105, 100.2939};
962  const Float_t* deadZoneCenter;
963  Float_t deadZoneHeightHalf = 0.32 * 7 / 2; // wire spacing * (wires missing + 1)/2
964  Float_t minY = 999999.;
965  UChar_t nGaps = 2;
966  switch (std::abs(StationAndRing)) {
967  case 11:
968  case 14:
969  return 162; //the height of ME11
970  break;
971  case 12:
972  deadZoneCenter = deadZoneCenterME1_2;
973  break;
974  case 13:
975  deadZoneCenter = deadZoneCenterME1_3;
976  break;
977  case 21:
978  deadZoneCenter = deadZoneCenterME2_1;
979  break;
980  case 31:
981  deadZoneCenter = deadZoneCenterME3_1;
982  break;
983  case 41:
984  deadZoneCenter = deadZoneCenterME4_1;
985  break;
986  default:
987  deadZoneCenter = deadZoneCenterME234_2;
988  nGaps = 4;
989  }
990  for (UChar_t iGap = 0; iGap < nGaps; iGap++) {
991  Float_t newMinY = yLocal < deadZoneCenter[iGap] ? deadZoneCenter[iGap] - deadZoneHeightHalf - yLocal
992  : yLocal - (deadZoneCenter[iGap] + deadZoneHeightHalf);
993  if (newMinY < minY)
994  minY = newMinY;
995  }
996  return minY;
997 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ zMass()

double MuCSCTnPFlatTableProducer::zMass ( const reco::Track track,
const reco::Muon muon 
)
private

Definition at line 1023 of file MuCSCTnPFlatTableProducer.cc.

References funct::pow(), mathSSE::sqrt(), and HLT_2024v14_cff::track.

Referenced by zSelection().

1023  {
1024  double zMass = -99.0;
1025  double mMu = 0.1134289256;
1026 
1027  zMass = std::pow((std::sqrt(std::pow(muon.p(), 2) + mMu * mMu) + std::sqrt(std::pow(track.p(), 2) + mMu * mMu)), 2) -
1028  (std::pow((muon.px() + track.px()), 2) + std::pow((muon.py() + track.py()), 2) +
1029  std::pow((muon.pz() + track.pz()), 2));
1030 
1031  return std::sqrt(zMass);
1032 }
T sqrt(T t)
Definition: SSEVec.h:23
double zMass(const reco::Track &, const reco::Muon &)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ zSelection()

bool MuCSCTnPFlatTableProducer::zSelection ( const reco::Muon muon,
const reco::Track track 
)
private

Definition at line 734 of file MuCSCTnPFlatTableProducer.cc.

References _zMass, HLT_2024v14_cff::track, and zMass().

Referenced by fillTable().

734  {
735  bool selected = false;
736 
737  _zMass = zMass(track, muon);
738  selected = (track.charge() * muon.charge() == -1 && (_zMass > 75.0) && (_zMass < 120.0));
739 
740  return selected;
741 }
double zMass(const reco::Track &, const reco::Muon &)

Member Data Documentation

◆ _muonIso

double MuCSCTnPFlatTableProducer::_muonIso
private

Definition at line 153 of file MuCSCTnPFlatTableProducer.cc.

Referenced by muonTagSelection().

◆ _trackIso

double MuCSCTnPFlatTableProducer::_trackIso
private

Definition at line 152 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and trackProbeSelection().

◆ _zMass

double MuCSCTnPFlatTableProducer::_zMass
private

Definition at line 154 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and zSelection().

◆ m_cscGeometry

nano_mu::ESTokenHandle<CSCGeometry, MuonGeometryRecord, edm::Transition::BeginRun> MuCSCTnPFlatTableProducer::m_cscGeometry
private

Handles to geometry, detector and specialized objects CSC Geometry

Definition at line 100 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), GetEdgeAndDistToGap(), getFromES(), matchTTwithCSCSeg(), and TrajectoryDistToSeg().

◆ m_cscSegmentToken

nano_mu::EDTokenHandle<CSCSegmentCollection> MuCSCTnPFlatTableProducer::m_cscSegmentToken
private

Definition at line 87 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_hltConfig

HLTConfigProvider MuCSCTnPFlatTableProducer::m_hltConfig
private

HLT config provider.

Definition at line 114 of file MuCSCTnPFlatTableProducer.cc.

Referenced by getFromES(), and hasTrigger().

◆ m_isoTrigIndices

std::vector<int> MuCSCTnPFlatTableProducer::m_isoTrigIndices
private

Definition at line 118 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_isoTrigName

std::string MuCSCTnPFlatTableProducer::m_isoTrigName
private

Definition at line 96 of file MuCSCTnPFlatTableProducer.cc.

Referenced by getFromES().

◆ m_muonSP

std::unique_ptr<MuonServiceProxy> MuCSCTnPFlatTableProducer::m_muonSP
private

Muon service proxy.

Definition at line 103 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_muToken

nano_mu::EDTokenHandle<reco::MuonCollection> MuCSCTnPFlatTableProducer::m_muToken
private

Tokens.

Definition at line 84 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_nZCands

unsigned int MuCSCTnPFlatTableProducer::m_nZCands
private

The variables holding the T&P related information

Definition at line 150 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_primaryVerticesToken

nano_mu::EDTokenHandle<std::vector<reco::Vertex> > MuCSCTnPFlatTableProducer::m_primaryVerticesToken
private

Definition at line 89 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_trackToken

nano_mu::EDTokenHandle<reco::TrackCollection> MuCSCTnPFlatTableProducer::m_trackToken
private

Definition at line 85 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_transientTrackBuilder

nano_mu::ESTokenHandle<TransientTrackBuilder, TransientTrackRecord> MuCSCTnPFlatTableProducer::m_transientTrackBuilder
private

Transient Track Builder.

Definition at line 106 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_trigEventToken

nano_mu::EDTokenHandle<trigger::TriggerEvent> MuCSCTnPFlatTableProducer::m_trigEventToken
private

Definition at line 92 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ m_trigIndices

std::vector<int> MuCSCTnPFlatTableProducer::m_trigIndices
private

Indices of the triggers used by muon filler for trigger matching.

Definition at line 117 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and getFromES().

◆ m_trigName

std::string MuCSCTnPFlatTableProducer::m_trigName
private

Name of the triggers used by muon filler for trigger matching.

Definition at line 95 of file MuCSCTnPFlatTableProducer.cc.

Referenced by getFromES().

◆ m_trigResultsToken

nano_mu::EDTokenHandle<edm::TriggerResults> MuCSCTnPFlatTableProducer::m_trigResultsToken
private

Definition at line 91 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ MEZ

constexpr Float_t MuCSCTnPFlatTableProducer::MEZ[6] = {601.3, 696.11, 696.11, 827.56, 936.44, 1025.9}
staticprivate

Definition at line 81 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable().

◆ propagatorAlong

edm::ESHandle<Propagator> MuCSCTnPFlatTableProducer::propagatorAlong
private

Definition at line 109 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and surfExtrapTrkSam().

◆ propagatorOpposite

edm::ESHandle<Propagator> MuCSCTnPFlatTableProducer::propagatorOpposite
private

Definition at line 110 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and surfExtrapTrkSam().

◆ theBField

edm::ESHandle<MagneticField> MuCSCTnPFlatTableProducer::theBField
private

Definition at line 111 of file MuCSCTnPFlatTableProducer.cc.

Referenced by fillTable(), and freeTrajStateMuon().