66 m_rpcb( ps.getParameter< edm::InputTag >(
"rpcb") ),
67 m_rpcf( ps.getParameter< edm::InputTag >(
"rpcf") ),
68 m_g4( ps.getParameter< edm::InputTag >(
"g4") ),
69 m_rpcdigi( ps.getParameter< edm::InputTag >(
"rpcdigi") )
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;
307 std::stringstream ss;
313 std::set<int> hwPlanes;
316 for (detUnitIt=rpcDigis->begin();
317 detUnitIt!=rpcDigis->end();
324 digiIt!=range.second;
327 if (digiIt->bx() == 0) {
333 if (!hasBX0)
continue;
335 const RPCDetId&
id = (*detUnitIt).first;
337 int layer =
id.layer();
343 else if (station == 4)
346 else if (station == 1 && layer == 1)
349 else if (station == 1 && layer == 2)
352 else if (station == 2 && layer == 1)
355 else if (station == 2 && layer == 2)
359 std::cout <<
"??????????????" << std::endl;
364 for (std::set<int>::iterator it= hwPlanes.begin();
EventNumber_t event() const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned int EventNumber_t
RPCPhiEff(const edm::ParameterSet &)
double deltaR(double eta1, double phi1, double eta2, double phi2)
std::string fromRaw(const edm::Event &iEvent)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< DigiType >::const_iterator const_iterator
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::pair< const_iterator, const_iterator > Range
static int towerNumFromEta(const double eta)
std::string fromCones(const edm::Event &iEvent)