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;
92 int noOfMatchedRecMuons = 0;
94 bool firstRunForMuonMatchingCnt =
true;
97 double deltarMin = -1;
98 edm::SimTrackContainer::const_iterator simTrk =
simTracks->begin();
99 for (; simTrk !=
simTracks->end(); ++simTrk) {
100 if (simTrk->type() != -13 && simTrk->type() != 13)
103 edm::SimTrackContainer::const_iterator simTrk2 = simTrk;
105 for (; simTrk2 !=
simTracks->end(); ++simTrk2) {
106 if (simTrk2->type() != -13 && simTrk2->type() != 13)
108 double drCand =
reco::deltaR(simTrk2->momentum(), simTrk->momentum());
109 if (drCand < deltarMin || deltarMin < 0)
115 if (deltarMin < 0.7 && deltarMin > 0)
119 for (; simTrk !=
simTracks->end(); simTrk++) {
120 int type = simTrk->type();
124 etaGen = momentum.eta();
125 ptGen = momentum.Pt();
126 phiGen = momentum.phi();
139 it != handleVec.end();
141 std::vector<L1MuRegionalCand>::const_iterator itRPC;
142 for (itRPC = (*it)->begin(); itRPC != (*it)->end(); itRPC++) {
143 int ptCode = itRPC->pt_packed();
145 if (firstRunForMuonMatchingCnt)
148 phiRec = itRPC->phi_packed();
149 qual = itRPC->quality();
150 towerRec = itRPC->eta_packed();
152 towerRec = -((~towerRec & 63) + 1);
155 float pi = 3.14159265;
157 float phiScaled = phiGen;
160 int phiHwGen = (phiScaled) / 2 /
pi * 144;
169 ++noOfMatchedRecMuons;
170 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << towerRec <<
" " << phiRec <<
" " 171 << ptCodeRec <<
" " << qual <<
" " << ghost << std::endl;
176 firstRunForMuonMatchingCnt =
false;
178 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " 188 if (noOfMatchedRecMuons != noOfRecMuons) {
189 edm::LogInfo(
"RPCEffWarn") <<
" MuonCands " << noOfRecMuons <<
" matched " << noOfMatchedRecMuons <<
" in run " 190 << rnNum <<
" event " << evNum;
213 std::stringstream
ss;
219 std::set<int> hwPlanes;
222 for (detUnitIt = rpcDigis->begin(); detUnitIt != rpcDigis->end(); ++detUnitIt) {
226 if (digiIt->bx() == 0) {
235 const RPCDetId&
id = (*detUnitIt).first;
237 int layer =
id.layer();
259 std::cout <<
"??????????????" << std::endl;
262 for (std::set<int>::iterator
it = hwPlanes.begin();
it != hwPlanes.end(); ++
it) {
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned long long EventNumber_t
RPCPhiEff(const edm::ParameterSet &)
edm::EDGetTokenT< edm::SimTrackContainer > m_g4Token
std::string fromRaw(const edm::Event &iEvent)
edm::EDGetTokenT< std::vector< L1MuRegionalCand > > m_rpcfToken
Abs< T >::type abs(const T &t)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< RPCDigiCollection > m_rpcdigiToken
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Log< level::Info, false > LogInfo
std::pair< const_iterator, const_iterator > Range
std::vector< RPCDigi >::const_iterator const_iterator
edm::EDGetTokenT< std::vector< L1MuRegionalCand > > m_rpcbToken
static int towerNumFromEta(const double eta)
std::string fromCones(const edm::Event &iEvent)
std::vector< SimTrack > SimTrackContainer