82 std::vector<edm::Handle<std::vector<L1MuRegionalCand> > > handleVec;
83 handleVec.push_back(rpcBarrel);
84 handleVec.push_back(rpcForward);
90 float etaGen = 0, phiGen = 0, ptGen = 0;
94 int noOfMatchedRecMuons = 0;
96 bool firstRunForMuonMatchingCnt =
true;
99 double deltarMin = -1;
100 edm::SimTrackContainer::const_iterator simTrk = simTracks->begin();
101 for (; simTrk != simTracks->end(); ++simTrk) {
102 if (simTrk->type() != -13 && simTrk->type() != 13)
105 edm::SimTrackContainer::const_iterator simTrk2 = simTrk;
107 for (; simTrk2 != simTracks->end(); ++simTrk2) {
108 if (simTrk2->type() != -13 && simTrk2->type() != 13)
110 double drCand =
reco::deltaR(simTrk2->momentum(), simTrk->momentum());
111 if (drCand < deltarMin || deltarMin < 0)
117 if (deltarMin < 0.7 && deltarMin > 0)
120 simTrk = simTracks->begin();
121 for (; simTrk != simTracks->end(); simTrk++) {
122 int type = simTrk->type();
123 if (type == 13 || type == -13) {
126 etaGen = momentum.eta();
127 ptGen = momentum.Pt();
128 phiGen = momentum.phi();
141 for (std::vector<
edm::Handle<std::vector<L1MuRegionalCand> > >::iterator it = handleVec.begin();
142 it != handleVec.end();
144 std::vector<L1MuRegionalCand>::const_iterator itRPC;
145 for (itRPC = (*it)->begin(); itRPC != (*it)->end(); itRPC++) {
146 int ptCode = itRPC->pt_packed();
148 if (firstRunForMuonMatchingCnt)
151 phiRec = itRPC->phi_packed();
152 qual = itRPC->quality();
153 towerRec = itRPC->eta_packed();
155 towerRec = -((~towerRec & 63) + 1);
158 float pi = 3.14159265;
160 float phiScaled = phiGen;
163 int phiHwGen = (phiScaled) / 2 / pi * 144;
172 ++noOfMatchedRecMuons;
173 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << towerRec <<
" " << phiRec <<
" " 174 << ptCodeRec <<
" " << qual <<
" " << ghost << std::endl;
179 firstRunForMuonMatchingCnt =
false;
181 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " 191 if (noOfMatchedRecMuons != noOfRecMuons) {
192 edm::LogInfo(
"RPCEffWarn") <<
" MuonCands " << noOfRecMuons <<
" matched " << noOfMatchedRecMuons <<
" in run " 193 << rnNum <<
" event " << evNum;
216 std::stringstream
ss;
222 std::set<int> hwPlanes;
225 for (detUnitIt = rpcDigis->begin(); detUnitIt != rpcDigis->end(); ++detUnitIt) {
229 if (digiIt->bx() == 0) {
238 const RPCDetId&
id = (*detUnitIt).first;
240 int layer =
id.layer();
246 else if (station == 4)
249 else if (station == 1 && layer == 1)
252 else if (station == 1 && layer == 2)
255 else if (station == 2 && layer == 1)
258 else if (station == 2 && layer == 2)
262 std::cout <<
"??????????????" << std::endl;
265 for (std::set<int>::iterator it = hwPlanes.begin(); it != hwPlanes.end(); ++it) {
EventNumber_t event() const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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())
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