108 std::vector< edm::Handle<std::vector<L1MuRegionalCand> > > handleVec;
109 handleVec.push_back( rpcBarrel );
110 handleVec.push_back( rpcForward );
116 float etaGen = 0, phiGen = 0, ptGen = 0;
119 int noOfRecMuons = 0;
120 int noOfMatchedRecMuons = 0;
122 bool firstRunForMuonMatchingCnt =
true;
125 double deltarMin = -1;
126 edm::SimTrackContainer::const_iterator simTrk = simTracks->begin();
127 for (; simTrk != simTracks->end(); ++simTrk) {
129 if (simTrk->type() != -13 && simTrk->type()!=13)
continue;
131 edm::SimTrackContainer::const_iterator simTrk2 = simTrk;
133 for (; simTrk2 != simTracks->end(); ++simTrk2) {
134 if (simTrk2->type() != -13 && simTrk2->type()!=13)
continue;
135 double drCand =
reco::deltaR(simTrk2->momentum(), simTrk->momentum());
136 if (drCand < deltarMin || deltarMin < 0) deltarMin = drCand;
143 if (deltarMin < 0.7 && deltarMin > 0)
return;
145 simTrk = simTracks->begin();
146 for (; simTrk != simTracks->end(); simTrk++) {
147 int type = simTrk->type();
148 if (type == 13 || type == -13) {
151 etaGen = momentum.eta();
152 ptGen = momentum.Pt();
153 phiGen = momentum.phi();
156 bool matched =
false;
166 for ( std::vector<
edm::Handle<std::vector<L1MuRegionalCand> > >::iterator it = handleVec.begin();
167 it != handleVec.end();
170 std::vector<L1MuRegionalCand>::const_iterator itRPC;
171 for (itRPC=(*it)->begin(); itRPC!=(*it)->end(); itRPC++){
172 int ptCode = itRPC->pt_packed();
175 if (firstRunForMuonMatchingCnt) ++noOfRecMuons;
177 phiRec=itRPC->phi_packed();
178 qual = itRPC->quality();
179 towerRec = itRPC->eta_packed();
181 towerRec = - ( (~towerRec & 63) + 1);
184 float pi = 3.14159265;
186 float phiScaled = phiGen;
187 if (phiScaled<0) phiScaled += 2*
pi;
188 int phiHwGen = (phiScaled)/2/pi*144;
198 ++noOfMatchedRecMuons;
199 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen
200 <<
" " << towerRec <<
" " << phiRec <<
" " << ptCodeRec <<
" " << qual
207 firstRunForMuonMatchingCnt=
false;
209 m_outfileR << etaGen <<
" " << phiGen <<
" " << ptGen
210 <<
" " << 0 <<
" " << 0 <<
" " << 0 <<
" " << 0
224 if (noOfMatchedRecMuons!=noOfRecMuons) {
225 edm::LogInfo(
"RPCEffWarn") <<
" MuonCands " << noOfRecMuons
226 <<
" matched " << noOfMatchedRecMuons
227 <<
" in run " << rnNum
228 <<
" event " << evNum;
EventNumber_t event() const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned int EventNumber_t
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static int towerNumFromEta(const double eta)