51 std::map<T1, std::vector<T2>> recHits_output;
52 std::vector<uint32_t> vetoHits;
60 if (iMuon->isGlobalMuon())
61 track = iMuon->outerTrack().get();
62 else if (iMuon->isStandAloneMuon())
63 track = iMuon->outerTrack().get();
64 else if (iMuon->isRPCMuon())
65 track = iMuon->innerTrack().get();
66 else if (iMuon->isTrackerMuon())
67 track = iMuon->innerTrack().get();
69 edm::LogError(
"TauEmbedding") <<
"The imput muon: " << (*iMuon)
70 <<
" must be either global or does or be tracker muon";
76 if (!(murechit).isValid())
83 sort(vetoHits.begin(), vetoHits.end());
84 vetoHits.erase(
unique(vetoHits.begin(), vetoHits.end()), vetoHits.end());
100 const auto &lErr =
chamber.tState.localError();
101 const auto &lPos =
chamber.tState.localPosition();
102 const auto &lDir =
chamber.tState.localDirection();
103 const auto &localError = lErr.positionError();
105 matchedChamber.
x = lPos.x();
106 matchedChamber.
y = lPos.y();
107 matchedChamber.
xErr =
sqrt(localError.xx());
108 matchedChamber.
yErr =
sqrt(localError.yy());
109 matchedChamber.
dXdZ = lDir.z() != 0 ? lDir.x() / lDir.z() : 9999;
110 matchedChamber.
dYdZ = lDir.z() != 0 ? lDir.y() / lDir.z() : 9999;
114 matchedChamber.
dXdZErr = trajectoryCovMatrix(1, 1) > 0 ?
sqrt(trajectoryCovMatrix(1, 1)) : 0;
115 matchedChamber.
dYdZErr = trajectoryCovMatrix(2, 2) > 0 ?
sqrt(trajectoryCovMatrix(2, 2)) : 0;
124 double xTrack = matchedChamber.
x;
131 for (
auto digiIt =
range.first; digiIt !=
range.second; ++digiIt) {
137 vetoHits.push_back(matchedChamber.
id.
rawId());
145 double xTrack = matchedChamber.
x;
146 double yTrack = matchedChamber.
y;
150 const CSCDetId layerId(chId.endcap(), chId.station(), chId.ring(), chId.chamber(), iLayer);
153 for (
auto digiIt =
range.first; digiIt !=
range.second; ++digiIt) {
154 std::vector<int> adcVals = digiIt->getADCCounts();
155 bool hasFired =
false;
159 for (
const auto &adcVal : adcVals) {
171 Float_t xStrip = layerGeom->
xOfStrip(digiIt->getStrip(), yTrack);
175 vetoHits.push_back(matchedChamber.
id.
rawId());
185 sort(vetoHits.begin(), vetoHits.end());
186 vetoHits.erase(
unique(vetoHits.begin(), vetoHits.end()), vetoHits.end());
192 RecHitCollectionHandle RecHitinput;
193 iEvent.getByToken(input_.second, RecHitinput);
204 for (
typename std::map<T1, std::vector<T2>>::const_iterator
recHit = recHits_output.begin();
205 recHit != recHits_output.end();
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
edm::ESHandle< CSCGeometry > m_cscGeometry
uint32_t getRawDetId(const T2 &)
bool checkrecHit(const TrackingRecHit &)
edm::RangeMap< T1, edm::OwnVector< T2 > > RecHitCollection
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
const CSCLayerGeometry * geometry() const
C::const_iterator const_iterator
constant access iterator type
edm::EDGetTokenT< CSCStripDigiCollection > m_cscDigisToken
edm::Handle< CSCStripDigiCollection > m_cscDigis
TrackAssociatorParameters parameters_
void setPropagator(const Propagator *)
use a user configured propagator
static const int maxLayerId
highest layer id
double m_digiMaxDistanceX
def unique(seq, keepstr=True)
TrackDetectorAssociator trackAssociator_
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< edm::View< pat::Muon > > mu_input_
const DTTopology & specificTopology() const
static const int maxSuperLayerId
highest superlayer id
float dX(const MatchPair &match)
constexpr uint32_t rawId() const
get the raw id
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
edm::Handle< DTDigiCollection > m_dtDigis
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void fillVetoHits(const TrackingRecHit &, std::vector< uint32_t > *)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
float xOfStrip(int strip, float y=0.) const
edm::ESHandle< DTGeometry > m_dtGeometry
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
edm::EDGetTokenT< DTDigiCollection > m_dtDigisToken
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
std::map< std::string, edm::EDGetTokenT< RecHitCollection > > inputs_