37 #include "CLHEP/Vector/ThreeVector.h"
60 using namespace l1extra;
65 theL1GMTReadoutCollection(iConfig.getParameter<
InputTag>(
"GMTReadoutCollection")),
66 thePropagatorName(iConfig.getParameter<string>(
"Propagator")),
67 theL1MinPt(iConfig.getParameter<double>(
"L1MinPt")),
68 theL1MaxEta(iConfig.getParameter<double>(
"L1MaxEta")),
69 theL1MinQuality(iConfig.getParameter<unsigned int>(
"L1MinQuality")){
80 produces<L2MuonTrajectorySeedCollection>();
91 const std::string
metname =
"Muon|RecoMuon|L2MuonSeedGenerator";
103 LogTrace(metname) <<
"Number of muons " << muColl->size() << endl;
105 L1MuonParticleCollection::const_iterator it;
108 for(it = muColl->begin(); it != muColl->end(); ++it,++l1ParticleIndex) {
111 unsigned int quality = 0;
112 bool valid_charge =
false;;
114 if ( muonCand.
empty() ) {
115 LogWarning(metname) <<
"L2MuonSeedGenerator: WARNING, no L1MuGMTCand! " << endl;
116 LogWarning(metname) <<
"L2MuonSeedGenerator: this should make sense only within MC tests" << endl;
126 float pt = (*it).pt();
127 float eta = (*it).eta();
129 float phi = (*it).phi();
130 int charge = (*it).charge();
132 if (!valid_charge) charge = 0;
133 bool barrel = !(*it).isForward();
137 if ( !(muonCand.
empty()) ) {
139 vector<L1MuRegionalCand> rmc;
140 if ( !muonCand.
isRPC() ) {
150 eta = rmc[idx].etaValue();
153 if (!valid_charge) charge = rmc[idx].chargeValue();
159 LogTrace(metname) <<
"New L2 Muon Seed";
160 LogTrace(metname) <<
"Pt = " << pt <<
" GeV/c";
162 LogTrace(metname) <<
"theta = " << theta <<
" rad";
163 LogTrace(metname) <<
"phi = " << phi <<
" rad";
168 LogTrace(metname) <<
"quality = "<< quality;
176 CLHEP::Hep3Vector vec(0.,1.,0.);
182 LogTrace(metname) <<
"The seed is in the barrel";
186 detLayer =
theService->detLayerGeometry()->idToLayer(
id);
196 if ( pt < 3.5 ) pt = 3.5;
199 LogTrace(metname) <<
"The seed is in the endcap";
208 detLayer =
theService->detLayerGeometry()->idToLayer(
id);
213 if( pt < 1.0) pt = 1.0;
225 mat[0][0] = (0.25/pt)*(0.25/pt);
226 if ( !barrel ) mat[0][0] = (0.4/pt)*(0.4/pt);
229 if (!valid_charge) mat[0][0] = (1./pt)*(1./pt);
231 mat[1][1] = 0.05*0.05;
240 LogTrace(metname) <<
"Free trajectory State from the parameters";
246 LogTrace(metname) <<
"State after the propagation on the layer";
252 std::vector< pair<const GeomDet*,TrajectoryStateOnSurface> >
256 if (detsWithStates.size()){
260 const GeomDet *newTSOSDet = detsWithStates.front().first;
262 LogTrace(metname) <<
"Most compatible det";
T getParameter(std::string const &) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::InputTag theL1GMTReadoutCollection
std::string dumpLayer(const DetLayer *layer) const
const std::string metname
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
std::vector< L1MuRegionalCand > getBrlRPCCands() const
get barrel RPC candidates vector
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
~L2MuonSeedGenerator()
Destructor.
std::string dumpMuonId(const DetId &id) const
std::string dumpFTS(const FreeTrajectoryState &fts) const
std::vector< L1MuRegionalCand > getFwdRPCCands() const
get forward RPC candidates vector
uint32_t rawId() const
get the raw id
const unsigned theL1MinQuality
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
std::vector< L1MuRegionalCand > getCSCCands() const
get CSC candidates vector
virtual void produce(edm::Event &, const edm::EventSetup &)
bool empty() const
is it an empty muon candidate?
Scalar radius() const
Radius of the cylinder.
bool isRPC() const
get RPC bit (true=RPC, false = DT/CSC or matched)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< L2MuonTrajectorySeed > L2MuonTrajectorySeedCollection
bool charge_valid() const
is the charge valid ?
Cos< T >::type cos(const T &t)
unsigned getRPCIndex() const
get index of contributing RPC muon
DetId geographicalId() const
The label of this GeomDet.
tuple Chi2MeasurementEstimator
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int quality() const
get quality
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
MeasurementEstimator * theEstimator
virtual const Surface::PositionType & position() const
Returns position of the surface.
std::vector< L1MuRegionalCand > getDTBXCands() const
get DT candidates vector
T const * product() const
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
std::string thePropagatorName
CLHEP::HepSymMatrix AlgebraicSymMatrix
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
L2MuonSeedGenerator(const edm::ParameterSet &)
Constructor.
bool isFwd() const
get forward bit (true=forward, false=barrel)