204 tree_ =
fs_->
make<TTree>(
"MuonRecoTree",
"MuonRecoTree");
205 tree_->Branch(
"Muon",
"L1Analysis::L1AnalysisRecoMuonDataFormat", &
muonData, 32000, 3);
206 tree_->Branch(
"RpcHit",
"L1Analysis::L1AnalysisRecoRpcHitDataFormat", &
rpcHitData, 32000, 3);
230 double matchDeltaR = 9999;
232 for (
size_t iTrigIndex = 0; iTrigIndex < trigIndices.size(); ++iTrigIndex) {
233 int triggerIndex = trigIndices[iTrigIndex];
238 const unsigned hltFilterIndex =
241 if (hltFilterIndex < triggerEvent->sizeFilters()) {
242 const trigger::Keys triggerKeys(triggerEvent->filterKeys(hltFilterIndex));
243 const trigger::Vids triggerVids(triggerEvent->filterIds(hltFilterIndex));
245 const unsigned nTriggers = triggerVids.size();
246 for (
size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
250 double dRtmp =
deltaR(mu, trigObject);
252 if (dRtmp < matchDeltaR) {
432 for (; recHitIt != recHitEnd; ++recHitIt) {
433 if ((
unsigned int)iRpcRecHits >
maxRpcHit_ - 1)
436 int cls = recHitIt->clusterSize();
437 int firststrip = recHitIt->firstClusterStrip();
438 int bx = recHitIt->BunchX();
443 int sect = rpcId.
sector();
446 int roll = rpcId.
roll();
449 LocalPoint recHitPosLoc = recHitIt->localPosition();
451 GlobalPoint recHitPosGlob = RPCSurface.toGlobal(recHitPosLoc);
453 float xLoc = recHitPosLoc.
x();
454 float phiGlob = recHitPosGlob.
phi();
486 iEvent.
getByLabel(
"offlineBeamSpot", beamSpot);
496 for (reco::MuonCollection::const_iterator imu = mucand->begin();
501 if (imu->isGlobalMuon())
503 if (imu->isStandAloneMuon())
505 if (imu->isTrackerMuon())
507 if (imu->isCaloMuon())
511 (!vertex->empty() && imu->isGlobalMuon() && imu->globalTrack()->normalizedChi2() < 10. &&
512 imu->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && imu->numberOfMatchedStations() > 1 &&
513 fabs(imu->innerTrack()->dxy(vertex->at(0).position())) < 0.2 &&
514 fabs(imu->innerTrack()->dz(vertex->at(0).position())) < 0.5 &&
515 imu->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
516 imu->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5);
526 bool isSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon() && !imu->isTrackerMuon());
527 bool isTR = (!imu->isGlobalMuon() && imu->isTrackerMuon() && !imu->isStandAloneMuon());
528 bool isGL = (imu->isGlobalMuon());
529 bool isTRSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon() && imu->isTrackerMuon());
547 double isoMatchDeltaR = 9999.;
548 double matchDeltaR = 9999.;
549 int hasIsoTriggered = 0;
550 int hasTriggered = 0;
556 if (triggerResults.
isValid()) {
582 if (isGL || isTR || isSA || isTRSA) {
594 if (!isTR && !isGL && !isTRSA)
596 if (!isSA && !isGL && !isTRSA)
606 const int lutCSC[4][6] = {
607 {26, 24, 22, 21, 23, 25}, {6, 4, 2, 1, 3, 5}, {16, 14, 12, 11, 13, 15}, {36, 34, 32, 31, 33, 35}};
609 int globalTypeRCH = -999999;
612 float globalEtaRCH = -999999;
613 float globalPhiRCH = -999999;
619 for (; hit != hitEnd; ++hit) {
620 if (!((*hit)->isValid()))
624 DetId detid = (*hit)->geographicalId();
647 if (cscSegment ==
nullptr)
669 gp = cscchamber->
toGlobal(rhitlocal);
689 if (lutCSC[
id.
station() - 1][3 - 1] < globalTypeRCH || globalTypeRCH < 0) {
691 globalTypeRCH = lutCSC[
id.station() - 1][3 - 1];
694 globalEtaRCH = gp.
eta();
695 globalPhiRCH = gp.
phi();
698 if (globalPhiRCH < 0)
699 globalPhiRCH = globalPhiRCH + 2 * pig;
704 hit = imu->outerTrack()->recHitsBegin();
706 for (; hit != hitEnd; hit++) {
707 if (!((*hit)->isValid()))
710 DetId detId = (*hit)->geographicalId();
721 int sect = rpcId.
sector();
724 int roll = rpcId.
roll();
727 float xLoc = (*hit)->localPosition().x();
750 if (imu->isEnergyValid()) {
752 muon_energy = imu->calEnergy();
769 if (imu->isTimeValid()) {
771 muon_time = imu->time();
824 double rr =
sqrt(xx * xx + yy * yy);
825 double cosphi = xx /
rr;
840 double rr =
sqrt(xx * xx + yy * yy);
842 double cosphi = xx /
rr;
857 double rr =
sqrt(xx * xx + yy * yy);
859 double cosphi = xx /
rr;
879 if (isTR || isGL || isTRSA) {
895 iEvent.
getByLabel(
"offlineBeamSpot", beamSpot);
921 double rr =
sqrt(xx * xx + yy * yy);
922 double cosphi = xx /
rr;
938 double rr =
sqrt(xx * xx + yy * yy);
939 double cosphi = xx /
rr;
953 double rr =
sqrt(xx * xx + yy * yy);
955 double cosphi = xx /
rr;
969 double rr =
sqrt(xx * xx + yy * yy);
971 double cosphi = xx /
rr;
985 double rr =
sqrt(xx * xx + yy * yy);
987 double cosphi = xx /
rr;
1001 double rr =
sqrt(xx * xx + yy * yy);
1003 double cosphi = xx /
rr;
1030 if (isGL || isSA || isTRSA) {
1062 double rr =
sqrt(xx * xx + yy * yy);
1063 double cosphi = xx /
rr;
1079 double rr =
sqrt(xx * xx + yy * yy);
1080 double cosphi = xx /
rr;
1085 double abspseta = -
log(
tan(atan(fabs(rr / zz)) / 2.0));
1100 double rr =
sqrt(xx * xx + yy * yy);
1102 double cosphi = xx /
rr;
1117 double rr =
sqrt(xx * xx + yy * yy);
1119 double cosphi = xx /
rr;
1133 double rr =
sqrt(xx * xx + yy * yy);
1135 double cosphi = xx /
rr;
1150 double rr =
sqrt(xx * xx + yy * yy);
1152 double cosphi = xx /
rr;
1169 double rr =
sqrt(xx * xx + yy * yy);
1170 double cosphi = xx /
rr;
1185 double rr =
sqrt(xx * xx + yy * yy);
1187 double cosphi = xx /
rr;
1202 double rr =
sqrt(xx * xx + yy * yy);
1204 double cosphi = xx /
rr;
1274 GlobalPoint innerPoint(track->innerPosition().x(), track->innerPosition().y(), track->innerPosition().z());
1275 GlobalVector innerVec(track->innerMomentum().x(), track->innerMomentum().y(), track->innerMomentum().z());
1286 bool changed =
true;
1293 bool enableWildcard =
true;
1294 for (
size_t iTrig = 0; iTrig <
triggerNames_.size(); ++iTrig) {
1297 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1303 if (tmpName.Contains(tNamePattern)) {
1304 tIndex = int(ipath);
1316 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1322 if (tmpName.Contains(tNamePattern)) {
1323 tIndex = int(ipath);
void beginRun(const edm::Run &, const edm::EventSetup &) override
unsigned int size() const
number of trigger paths in trigger table
T getUntrackedParameter(std::string const &, T const &) const
GlobalPoint position() const
edm::ESHandle< DTGeometry > dtGeom
static std::vector< std::string > checklist log
LocalPoint localPosition() const override
const std::string & triggerName(unsigned int triggerIndex) const
uint16_t *__restrict__ id
edm::ESHandle< CSCGeometry > cscGeom
void analyze(const edm::Event &, const edm::EventSetup &) override
TrajectoryStateClosestToPoint impactPointTSCP() const
TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z)
#define DEFINE_FWK_MODULE(type)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
GlobalPoint globalPosition() const
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
T * make(const Args &...args) const
make new ROOT object
edm::InputTag triggerSummaryLabel_
void beginJob(void) override
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
float towerS9
total energy in 3x3 tower shape
float ecal_time
Calorimeter timing.
constexpr std::array< uint8_t, layerIndexSize > layer
~L1MuonRecoTreeProducer() override
Single trigger physics object (e.g., an isolated muon)
C::const_iterator const_iterator
constant access iterator type
L1MuonRecoTreeProducer(const edm::ParameterSet &)
Direction direction() const
direction estimation based on time dispersion
edm::ESHandle< RPCGeometry > rpcGeom
static PlanePointer build(Args &&...args)
L1Analysis::L1AnalysisRecoMuonDataFormat * muonData
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
float timeAtIpOutIn
b) particle is moving from outside in
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)
edm::Service< TFileService > fs_
edm::ESHandle< MagneticField > theBField
L1Analysis::L1AnalysisRecoRpcHitDataFormat * rpcHitData
static std::string const triggerResults
std::string triggerProcessLabel_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< std::string > triggerNames_
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Log< level::Info, false > LogInfo
std::vector< int > triggerIndices_
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
edm::ESHandle< Propagator > propagatorOpposite
std::vector< size_type > Keys
edm::ESHandle< Propagator > propagatorAlong
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
T getParameter(std::string const &) const
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
HLTConfigProvider hltConfig_
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 > isoTriggerNames_
L1AnalysisRecoRpcHitDataFormat * getData()
std::vector< int > isoTriggerIndices_
L1Analysis::L1AnalysisRecoRpcHit * rpcHit
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
L1Analysis::L1AnalysisRecoMuon * muon
void endRun(const edm::Run &, const edm::EventSetup &) override
constexpr Detector det() const
get the detector field from this detid
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.