221 tree_->Branch(
"Muon",
"L1Analysis::L1AnalysisRecoMuonDataFormat", &
muonData, 32000, 3);
222 tree_->Branch(
"RpcHit",
"L1Analysis::L1AnalysisRecoRpcHitDataFormat", &
rpcHitData, 32000, 3);
253 double matchDeltaR = 9999;
255 for(
size_t iTrigIndex = 0; iTrigIndex < trigIndices.size(); ++iTrigIndex) {
256 int triggerIndex = trigIndices[iTrigIndex];
263 if (hltFilterIndex < triggerEvent->sizeFilters()) {
267 const unsigned nTriggers = triggerVids.size();
268 for (
size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
272 double dRtmp =
deltaR( mu, trigObject );
274 if ( dRtmp < matchDeltaR ) {
464 for(; recHitIt != recHitEnd; ++recHitIt){
466 if((
unsigned int) iRpcRecHits>
maxRpcHit_-1)
continue;
468 int cls = recHitIt->clusterSize();
469 int firststrip = recHitIt->firstClusterStrip();
470 int bx = recHitIt->BunchX();
473 int region = rpcId.
region();
475 int sect = rpcId.
sector();
476 int layer = rpcId.
layer();
478 int roll = rpcId.
roll();
481 LocalPoint recHitPosLoc = recHitIt->localPosition();
483 GlobalPoint recHitPosGlob = RPCSurface.toGlobal(recHitPosLoc);
485 float xLoc = recHitPosLoc.
x();
486 float phiGlob = recHitPosGlob.
phi();
520 iEvent.
getByLabel(
"offlineBeamSpot", beamSpot);
530 for(reco::MuonCollection::const_iterator imu = mucand->begin();
535 if (imu->isGlobalMuon()) type=type+1;
536 if (imu->isStandAloneMuon()) type=type+2;
537 if (imu->isTrackerMuon()) type=type+4;
538 if (imu->isCaloMuon()) type=type+8;
540 bool isTIGHT = (vertex->size() > 0 &&
541 imu->isGlobalMuon() && imu->globalTrack()->normalizedChi2() < 10. &&
542 imu->globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
543 imu->numberOfMatchedStations() > 1 &&
544 fabs(imu->innerTrack()->dxy(vertex->at(0).position())) < 0.2 &&
545 fabs(imu->innerTrack()->dz(vertex->at(0).position())) < 0.5 &&
546 imu->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
547 imu->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5);
549 if (isTIGHT) type=type+16;
550 if (imu->isPFMuon()) type=type+32;
555 bool isSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon() && !imu->isTrackerMuon());
556 bool isTR = (!imu->isGlobalMuon() && imu->isTrackerMuon() && !imu->isStandAloneMuon());
557 bool isGL = (imu->isGlobalMuon());
558 bool isTRSA = (!imu->isGlobalMuon() && imu->isStandAloneMuon()&&imu->isTrackerMuon());
578 double isoMatchDeltaR = 9999.;
579 double matchDeltaR = 9999.;
580 int hasIsoTriggered = 0;
581 int hasTriggered = 0;
587 if (triggerResults.
isValid()) {
613 if (isGL || isTR || isSA || isTRSA){
630 const int lutCSC[4][6] = { {26,24,22,21,23,25} ,
631 { 6, 4, 2, 1, 3, 5} ,
632 {16,14,12,11,13,15} ,
633 {36,34,32,31,33,35} };
635 int globalTypeRCH = -999999;
638 float globalEtaRCH = -999999;
639 float globalPhiRCH = -999999;
646 for(; hit != hitEnd; ++hit) {
648 if ( !((*hit)->isValid()) )
continue;
651 DetId detid = (*hit)->geographicalId();
663 if (
id.
station() < 1)
continue;
671 if (cscSegment ==
NULL)
continue;
689 if (!cscchamber)
continue;
691 gp = cscchamber->
toGlobal(rhitlocal);
711 if( lutCSC[
id.
station()-1][3-1]<globalTypeRCH || globalTypeRCH<0 ){
713 globalTypeRCH = lutCSC[
id.station()-1][3-1];
716 globalEtaRCH = gp.
eta();
717 globalPhiRCH = gp.
phi();
720 if(globalPhiRCH < 0) globalPhiRCH = globalPhiRCH + 2*pig;
725 hit = imu->outerTrack()->recHitsBegin();
727 for(; hit != hitEnd; hit++) {
729 if ( !((*hit)->isValid()) )
continue;
731 DetId detId = (*hit)->geographicalId();
738 int region = rpcId.
region();
740 int sect = rpcId.
sector();
741 int layer = rpcId.
layer();
743 int roll = rpcId.
roll();
746 float xLoc = (*hit)->localPosition().x();
771 muonData -> rchCSCtype.push_back(globalTypeRCH);
772 muonData -> rchPhi.push_back(globalPhiRCH);
773 muonData -> rchEta.push_back(globalEtaRCH);
778 if (imu->isEnergyValid()){
780 muon_energy = imu->calEnergy();
797 if (imu->isTimeValid()){
799 muon_time = imu->time();
852 double rr =
sqrt(xx*xx + yy*yy);
853 double cosphi = xx/
rr;
869 double rr =
sqrt(xx*xx + yy*yy);
871 double cosphi = xx/
rr;
887 double rr =
sqrt(xx*xx + yy*yy);
889 double cosphi = xx/
rr;
911 if (isTR || isGL || isTRSA){
928 iEvent.
getByLabel(
"offlineBeamSpot", beamSpot);
956 double rr =
sqrt(xx*xx + yy*yy);
957 double cosphi = xx/
rr;
974 double rr =
sqrt(xx*xx + yy*yy);
975 double cosphi = xx/
rr;
990 double rr =
sqrt(xx*xx + yy*yy);
992 double cosphi = xx/
rr;
1007 double rr =
sqrt(xx*xx + yy*yy);
1009 double cosphi = xx/
rr;
1024 double rr =
sqrt(xx*xx + yy*yy);
1026 double cosphi = xx/
rr;
1041 double rr =
sqrt(xx*xx + yy*yy);
1043 double cosphi = xx/
rr;
1072 if (isGL || isSA || isTRSA){
1106 double rr =
sqrt(xx*xx + yy*yy);
1107 double cosphi = xx/
rr;
1124 double rr =
sqrt(xx*xx + yy*yy);
1125 double cosphi = xx/
rr;
1130 double abspseta = -
log(
tan( atan(fabs(rr/zz))/2.0 ) );
1146 double rr =
sqrt(xx*xx + yy*yy);
1148 double cosphi = xx/
rr;
1164 double rr =
sqrt(xx*xx + yy*yy);
1166 double cosphi = xx/
rr;
1181 double rr =
sqrt(xx*xx + yy*yy);
1183 double cosphi = xx/
rr;
1199 double rr =
sqrt(xx*xx + yy*yy);
1201 double cosphi = xx/
rr;
1219 double rr =
sqrt(xx*xx + yy*yy);
1220 double cosphi = xx/
rr;
1236 double rr =
sqrt(xx*xx + yy*yy);
1238 double cosphi = xx/
rr;
1254 double rr =
sqrt(xx*xx + yy*yy);
1256 double cosphi = xx/
rr;
1335 GlobalPoint innerPoint(track->innerPosition().x(), track->innerPosition().y(), track->innerPosition().z());
1336 GlobalVector innerVec (track->innerMomentum().x(), track->innerMomentum().y(), track->innerMomentum().z());
1347 bool changed =
true;
1354 bool enableWildcard =
true;
1355 for (
size_t iTrig = 0; iTrig <
triggerNames_.size(); ++iTrig) {
1358 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1364 if (tmpName.Contains(tNamePattern)) {
1365 tIndex =
int(ipath);
1377 TRegexp tNamePattern = TRegexp(tNameTmp, enableWildcard);
1383 if (tmpName.Contains(tNamePattern)) {
1384 tIndex =
int(ipath);
unsigned int size() const
number of trigger paths in trigger table
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
GlobalPoint position() const
edm::ESHandle< DTGeometry > dtGeom
const std::string & triggerName(unsigned int triggerIndex) const
edm::ESHandle< CSCGeometry > cscGeom
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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.
const Keys & filterKeys(trigger::size_type index) const
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
GlobalPoint globalPosition() const
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
T * make(const Args &...args) const
make new ROOT object
edm::InputTag triggerSummaryLabel_
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
float towerS9
total energy in 3x3 tower shape
const Plane & surface() const
The nominal surface of the GeomDet.
float ecal_time
Calorimeter timing.
uint32_t rawId() const
get the raw id
Single trigger physics object (e.g., an isolated muon)
L1MuonRecoTreeProducer(const edm::ParameterSet &)
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Direction direction() const
direction estimation based on time dispersion
const Vids & filterIds(trigger::size_type index) const
virtual void beginJob(void)
edm::ESHandle< RPCGeometry > rpcGeom
const TriggerObjectCollection & getObjects() const
static PlanePointer build(Args &&...args)
L1Analysis::L1AnalysisRecoMuonDataFormat * muonData
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)
LocalPoint localPosition() const override
edm::Service< TFileService > fs_
edm::ESHandle< MagneticField > theBField
L1Analysis::L1AnalysisRecoRpcHitDataFormat * rpcHitData
static std::string const triggerResults
std::string triggerProcessLabel_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< std::string > triggerNames_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< int > triggerIndices_
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
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) 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()
virtual void endRun(const edm::Run &, const edm::EventSetup &)
~L1MuonRecoTreeProducer()
std::vector< int > isoTriggerIndices_
const Point & position() const
position
L1Analysis::L1AnalysisRecoRpcHit * rpcHit
Detector det() const
get the detector field from this detid
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
L1Analysis::L1AnalysisRecoMuon * muon
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.