81 std::vector<edm::Handle<std::vector<L1MuRegionalCand> > > handleVec;
82 handleVec.push_back(rpcBarrel);
83 handleVec.push_back(rpcForward);
89 float etaGen = 0, phiGen = 0, ptGen = 0;
93 int noOfMatchedRecMuons = 0;
95 bool firstRunForMuonMatchingCnt =
true;
98 double deltarMin = -1;
99 edm::SimTrackContainer::const_iterator simTrk =
simTracks->begin();
100 for (; simTrk !=
simTracks->end(); ++simTrk) {
101 if (simTrk->type() != -13 && simTrk->type() != 13)
104 edm::SimTrackContainer::const_iterator simTrk2 = simTrk;
106 for (; simTrk2 !=
simTracks->end(); ++simTrk2) {
107 if (simTrk2->type() != -13 && simTrk2->type() != 13)
109 double drCand =
reco::deltaR(simTrk2->momentum(), simTrk->momentum());
110 if (drCand < deltarMin || deltarMin < 0)
116 if (deltarMin < 0.7 && deltarMin > 0)
120 for (; simTrk !=
simTracks->end(); simTrk++) {
121 int type = simTrk->type();
125 etaGen = momentum.eta();
126 ptGen = momentum.Pt();
127 phiGen = momentum.phi();
141 it != handleVec.end();
143 std::vector<L1MuRegionalCand>::const_iterator itRPC;
144 for (itRPC = (*it)->begin(); itRPC != (*it)->end(); itRPC++) {
145 int ptCode = itRPC->pt_packed();
147 if (firstRunForMuonMatchingCnt)
150 phiRec = itRPC->phi_packed();
151 qual = itRPC->quality();
152 towerRec = itRPC->eta_packed();
154 towerRec = -((~towerRec & 63) + 1);
157 float pi = 3.14159265;
159 float phiScaled = phiGen;
162 int phiHwGen = (phiScaled) / 2 /
pi * 144;
171 ++noOfMatchedRecMuons;
172 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << towerRec <<
" " << phiRec <<
" " 173 << ptCodeRec <<
" " << qual <<
" " << ghost << std::endl;
178 firstRunForMuonMatchingCnt =
false;
180 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " 190 if (noOfMatchedRecMuons != noOfRecMuons) {
191 edm::LogInfo(
"RPCEffWarn") <<
" MuonCands " << noOfRecMuons <<
" matched " << noOfMatchedRecMuons <<
" in run " 192 << rnNum <<
" event " << evNum;
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned long long EventNumber_t
edm::EDGetTokenT< edm::SimTrackContainer > m_g4Token
edm::EDGetTokenT< std::vector< L1MuRegionalCand > > m_rpcfToken
Abs< T >::type abs(const T &t)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Log< level::Info, false > LogInfo
edm::EDGetTokenT< std::vector< L1MuRegionalCand > > m_rpcbToken
static int towerNumFromEta(const double eta)