190 theTrackingGeometryToken_(
192 propagatorAlongToken_(
194 propagatorOppositeToken_(
214 tree_ =
fs->make<TTree>(
"MuonRecoTree",
"MuonRecoTree");
215 tree_->Branch(
"Muon",
"L1Analysis::L1AnalysisRecoMuonDataFormat", &
muonData, 32000, 3);
216 tree_->Branch(
"RpcHit",
"L1Analysis::L1AnalysisRecoRpcHitDataFormat", &
rpcHitData, 32000, 3);
240 double matchDeltaR = 9999;
242 for (
size_t iTrigIndex = 0; iTrigIndex < trigIndices.size(); ++iTrigIndex) {
243 int triggerIndex = trigIndices[iTrigIndex];
248 const unsigned hltFilterIndex =
251 if (hltFilterIndex < triggerEvent->sizeFilters()) {
255 const unsigned nTriggers = triggerVids.size();
256 for (
size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
260 double dRtmp =
deltaR(
mu, trigObject);
262 if (dRtmp < matchDeltaR) {
436 for (; recHitIt != recHitEnd; ++recHitIt) {
437 if ((
unsigned int)iRpcRecHits >
maxRpcHit_ - 1)
440 int cls = recHitIt->clusterSize();
441 int firststrip = recHitIt->firstClusterStrip();
442 int bx = recHitIt->BunchX();
447 int sect = rpcId.
sector();
450 int roll = rpcId.
roll();
453 LocalPoint recHitPosLoc = recHitIt->localPosition();
455 GlobalPoint recHitPosGlob = RPCSurface.toGlobal(recHitPosLoc);
457 float xLoc = recHitPosLoc.
x();
458 float phiGlob = recHitPosGlob.
phi();
500 for (reco::MuonCollection::const_iterator imu = mucand->begin();
505 if (imu->isGlobalMuon())
507 if (imu->isStandAloneMuon())
509 if (imu->isTrackerMuon())
511 if (imu->isCaloMuon())
515 (!
vertex->empty() && imu->isGlobalMuon() && imu->globalTrack()->normalizedChi2() < 10. &&
516 imu->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && imu->numberOfMatchedStations() > 1 &&
517 fabs(imu->innerTrack()->dxy(
vertex->at(0).position())) < 0.2 &&
518 fabs(imu->innerTrack()->dz(
vertex->at(0).position())) < 0.5 &&
519 imu->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
520 imu->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5);
530 bool isSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon() && !imu->isTrackerMuon());
531 bool isTR = (!imu->isGlobalMuon() && imu->isTrackerMuon() && !imu->isStandAloneMuon());
532 bool isGL = (imu->isGlobalMuon());
533 bool isTRSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon() && imu->isTrackerMuon());
551 double isoMatchDeltaR = 9999.;
552 double matchDeltaR = 9999.;
553 int hasIsoTriggered = 0;
554 int hasTriggered = 0;
586 if (isGL || isTR || isSA || isTRSA) {
598 if (!isTR && !isGL && !isTRSA)
600 if (!isSA && !isGL && !isTRSA)
610 const int lutCSC[4][6] = {
611 {26, 24, 22, 21, 23, 25}, {6, 4, 2, 1, 3, 5}, {16, 14, 12, 11, 13, 15}, {36, 34, 32, 31, 33, 35}};
613 int globalTypeRCH = -999999;
616 float globalEtaRCH = -999999;
617 float globalPhiRCH = -999999;
623 for (;
hit != hitEnd; ++
hit) {
624 if (!((*hit)->isValid()))
628 DetId detid = (*hit)->geographicalId();
693 if (lutCSC[
id.
station() - 1][3 - 1] < globalTypeRCH || globalTypeRCH < 0) {
695 globalTypeRCH = lutCSC[
id.station() - 1][3 - 1];
698 globalEtaRCH =
gp.eta();
699 globalPhiRCH =
gp.phi();
702 if (globalPhiRCH < 0)
703 globalPhiRCH = globalPhiRCH + 2 * pig;
708 hit = imu->outerTrack()->recHitsBegin();
710 for (;
hit != hitEnd;
hit++) {
711 if (!((*hit)->isValid()))
714 DetId detId = (*hit)->geographicalId();
725 int sect = rpcId.
sector();
728 int roll = rpcId.
roll();
731 float xLoc = (*hit)->localPosition().x();
754 if (imu->isEnergyValid()) {
756 muon_energy = imu->calEnergy();
773 if (imu->isTimeValid()) {
775 muon_time = imu->time();
829 double cosphi =
xx /
rr;
846 double cosphi =
xx /
rr;
863 double cosphi =
xx /
rr;
883 if (isTR || isGL || isTRSA) {
927 double cosphi =
xx /
rr;
945 double cosphi =
xx /
rr;
962 double cosphi =
xx /
rr;
979 double cosphi =
xx /
rr;
999 double cosphi =
xx /
rr;
1019 double cosphi =
xx /
rr;
1046 if (isGL || isSA || isTRSA) {
1080 double cosphi =
xx /
rr;
1098 double cosphi =
xx /
rr;
1103 double abspseta = -
log(
tan(atan(fabs(
rr /
zz)) / 2.0));
1121 double cosphi =
xx /
rr;
1138 double cosphi =
xx /
rr;
1155 double cosphi =
xx /
rr;
1173 double cosphi =
xx /
rr;
1192 double cosphi =
xx /
rr;
1209 double cosphi =
xx /
rr;
1226 double cosphi =
xx /
rr;
1317 bool changed =
true;
1324 bool enableWildcard =
true;
1325 for (
size_t iTrig = 0; iTrig <
triggerNames_.size(); ++iTrig) {
1328 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1334 if (tmpName.Contains(tNamePattern)) {
1335 tIndex =
int(ipath);
1347 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1353 if (tmpName.Contains(tNamePattern)) {
1354 tIndex =
int(ipath);
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
static const std::string kSharedResource
const std::string & triggerName(unsigned int triggerIndex) const
T getParameter(std::string const &) const
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
Global3DPoint GlobalPoint
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track, const MagneticField *theMagneticField)
edm::InputTag triggerSummaryLabel_
void beginJob(void) override
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho, const MagneticField *theMagneticField, const Propagator &propagatorAlong, const Propagator &propagatorOpposite)
constexpr Detector det() const
get the detector field from this detid
float towerS9
total energy in 3x3 tower shape
float ecal_time
Calorimeter timing.
constexpr std::array< uint8_t, layerIndexSize > layer
~L1MuonRecoTreeProducer() override
static PlanePointer build(Args &&... args)
T getUntrackedParameter(std::string const &, T const &) const
Single trigger physics object (e.g., an isolated muon)
C::const_iterator const_iterator
constant access iterator type
L1MuonRecoTreeProducer(const edm::ParameterSet &)
GlobalPoint globalPosition() const
GlobalPoint position() const
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > theTrackingGeometryToken_
unsigned int size() const
number of trigger paths in trigger table
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
TrajectoryStateClosestToPoint impactPointTSCP() const
TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z, const MagneticField *theMagneticField, const Propagator &propagatorAlong, const Propagator &propagatorOpposite)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAlongToken_
L1Analysis::L1AnalysisRecoMuonDataFormat * muonData
float timeAtIpOutIn
b) particle is moving from outside in
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
double match_trigger(std::vector< int > &trigIndices, const trigger::TriggerObjectCollection &trigObjs, edm::Handle< trigger::TriggerEvent > &triggerEvent, const reco::Muon &mu)
Tan< T >::type tan(const T &t)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getData(T &iHolder) const
L1Analysis::L1AnalysisRecoRpcHitDataFormat * rpcHitData
static std::string const triggerResults
std::string triggerProcessLabel_
int subsector() const
SubSector id : some sectors are divided along the phi direction in subsectors (from 1 to 4 in Barrel...
std::vector< std::string > triggerNames_
void beginRun(const edm::Run &, const edm::EventSetup &)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Log< level::Info, false > LogInfo
const Plane & surface() const
The nominal surface of the GeomDet.
std::vector< int > triggerIndices_
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
constexpr uint32_t rawId() const
get the raw id
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
HLTConfigProvider hltConfig_
std::vector< std::string > isoTriggerNames_
L1AnalysisRecoRpcHitDataFormat * getData()
void endRun(const edm::Run &, const edm::EventSetup &)
Direction direction() const
direction estimation based on time dispersion
std::vector< int > isoTriggerIndices_
float theBField(const float current)
L1Analysis::L1AnalysisRecoRpcHit * rpcHit
L1Analysis::L1AnalysisRecoMuon * muon
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theBFieldToken_