337 bool CSCTrackPlus =
false;
338 bool CSCTrackMinus =
false;
341 for (reco::MuonCollection::const_iterator iMuon = TheCosmics->begin(); iMuon != TheCosmics->end();
342 iMuon++, imucount++) {
347 if (!CSCTrackPlus || !CSCTrackMinus) {
348 if (Track->eta() > 0 || Track->outerPosition().z() > 0 || Track->innerPosition().z() > 0)
350 else if (Track->eta() < 0 || Track->outerPosition().z() < 0 || Track->innerPosition().z() < 0)
351 CSCTrackMinus =
true;
354 float innermost_phi = 0.;
355 float outermost_phi = 0.;
356 float innermost_z = 99999.;
357 float outermost_z = 0.;
358 float innermost_eta = 0.;
359 float outermost_eta = 0.;
360 float innermost_x = 0.;
361 float innermost_y = 0.;
362 float innermost_r = 0.;
363 for (
unsigned int j = 0;
j < Track->extra()->recHitsSize();
j++) {
364 auto hit = Track->extra()->recHitRef(
j);
365 DetId TheDetUnitId(
hit->geographicalId());
371 const GeomDetUnit* TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
374 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
376 float z = TheGlobalPosition.
z();
378 innermost_phi = TheGlobalPosition.
phi();
379 innermost_eta = TheGlobalPosition.
eta();
380 innermost_z = TheGlobalPosition.
z();
381 innermost_x = TheGlobalPosition.
x();
382 innermost_y = TheGlobalPosition.
y();
383 innermost_r = TMath::Sqrt(innermost_x * innermost_x + innermost_y * innermost_y);
386 outermost_phi = TheGlobalPosition.
phi();
387 outermost_eta = TheGlobalPosition.
eta();
388 outermost_z = TheGlobalPosition.
z();
391 float dphi =
TMath::Abs(outermost_phi - innermost_phi);
392 float deta =
TMath::Abs(outermost_eta - innermost_eta);
408 std::vector<const CSCSegment*> MatchedSegments =
TheMatcher->
matchCSC(*Track, iEvent);
411 float InnerSegmentTime[2] = {0, 0};
412 float OuterSegmentTime[2] = {0, 0};
413 float innermost_seg_z[2] = {1500, 1500};
414 float outermost_seg_z[2] = {0, 0};
415 for (std::vector<const CSCSegment*>::const_iterator segment = MatchedSegments.begin();
416 segment != MatchedSegments.end();
418 CSCDetId TheCSCDetId((*segment)->cscDetId());
419 const CSCChamber* TheCSCChamber = TheCSCGeometry->chamber(TheCSCDetId);
420 LocalPoint TheLocalPosition = (*segment)->localPosition();
421 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
422 float z = TheGlobalPosition.
z();
423 int TheEndcap = TheCSCDetId.endcap();
424 if (
TMath::Abs(z) < innermost_seg_z[TheEndcap - 1]) {
425 innermost_seg_z[TheEndcap - 1] =
TMath::Abs(z);
426 InnerSegmentTime[TheEndcap - 1] = (*segment)->time();
428 if (
TMath::Abs(z) > outermost_seg_z[TheEndcap - 1]) {
429 outermost_seg_z[TheEndcap - 1] =
TMath::Abs(z);
430 OuterSegmentTime[TheEndcap - 1] = (*segment)->time();
434 float dT_Segment = 0;
435 if (innermost_seg_z[0] < outermost_seg_z[0])
436 dT_Segment = OuterSegmentTime[0] - InnerSegmentTime[0];
437 if (innermost_seg_z[1] < outermost_seg_z[1])
441 if (dT_Segment == 0.0 || OuterSegmentTime[1] - InnerSegmentTime[1] < dT_Segment)
442 dT_Segment = OuterSegmentTime[1] - InnerSegmentTime[1];
463 std::vector<CSCSegment> vCSCSegments_Plus;
464 std::vector<CSCSegment> vCSCSegments_Minus;
466 bool CSCSegmentPlus =
false;
467 bool CSCSegmentMinus =
false;
468 if (TheCSCSegments.
isValid()) {
471 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
475 vCSCSegments_Plus.push_back(*iSegment);
477 vCSCSegments_Minus.push_back(*iSegment);
482 if (!vCSCSegments_Plus.empty())
483 CSCSegmentPlus =
true;
484 if (!vCSCSegments_Minus.empty())
485 CSCSegmentMinus =
true;
490 bool CSCRecHitPlus =
false;
491 bool CSCRecHitMinus =
false;
495 DetId TheDetUnitId(iCSCRecHit->geographicalId());
496 const GeomDetUnit* TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
497 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
498 const BoundPlane& TheSurface = TheUnit->surface();
499 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
502 if (TheGlobalPosition.
z() > 0)
503 CSCRecHitPlus =
true;
505 CSCRecHitMinus =
true;
516 if (iEBRecHit->energy() < 0.5)
520 int ieta = EcalId.ieta();
530 if (TheHBHERecHits.
isValid()) {
532 iHBHERecHit != TheHBHERecHits->end();
534 if (iHBHERecHit->energy() < 1.)
549 int TheHaloOrigin = 0;
550 if (TheCSCDataHandle.
isValid()) {
560 float r = TMath::Sqrt(
i->x() *
i->x() +
i->y() *
i->y());
600 if (TheEcalHaloData.
isValid()) {
602 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
603 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
623 float angle = vm_Angle[cluster];
624 float roundness = vm_Roundness[cluster];
638 if (TheHcalHaloData.
isValid()) {
640 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
642 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
661 if (TheGlobalHaloData.
isValid()) {
666 const CaloMET* RawMET = &(calometcol->front());
682 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
689 if (TheHBHERecHits.
isValid()) {
691 iHBHERecHit != TheHBHERecHits->end();
694 int iphi =
id.
iphi();
695 if (iphi != iWedge->iPhi())
697 if (iHBHERecHit->energy() < 1.0)
700 float time = iHBHERecHit->time();
701 int ieta =
id.ieta();
710 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
720 if (iEBRecHit->energy() < 0.5)
724 int iPhi = EcalId.iphi();
725 iPhi = (iPhi - 1) / 5 + 1;
726 if (iPhi != iWedge->iPhi())
738 if (TheBeamHaloSummary.
isValid()) {
745 *
out << std::setw(15) <<
"CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15)
746 << TheEventNumber << std::endl;
758 *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15)
759 << TheEventNumber << std::endl;
771 *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15)
772 << TheEventNumber << std::endl;
784 *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15)
785 << TheEventNumber << std::endl;
812 const CaloMET* calomet = &(calometcol->front());
816 *
out << std::setw(15) <<
"HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15)
817 << TheEventNumber << std::endl;
820 if (calomet->
pt() > 15.0) {
821 if (TheHaloOrigin > 0) {
822 if (CSCTrackPlus && CSCTrackMinus)
824 else if (CSCTrackPlus && CSCSegmentMinus)
826 else if (CSCTrackPlus && CSCRecHitMinus)
828 else if (CSCTrackPlus)
830 else if (CSCSegmentPlus && CSCTrackMinus)
832 else if (CSCSegmentPlus && CSCSegmentMinus)
834 else if (CSCSegmentPlus && CSCRecHitMinus)
836 else if (CSCSegmentPlus)
838 else if (CSCRecHitPlus && CSCTrackMinus)
840 else if (CSCRecHitPlus && CSCSegmentMinus)
842 else if (CSCRecHitPlus && CSCRecHitMinus)
844 else if (CSCRecHitPlus)
848 }
else if (TheHaloOrigin < 0) {
849 if (CSCTrackMinus && CSCTrackPlus)
851 else if (CSCTrackMinus && CSCSegmentPlus)
853 else if (CSCTrackMinus && CSCRecHitPlus)
855 else if (CSCTrackMinus)
857 else if (CSCSegmentMinus && CSCTrackPlus)
859 else if (CSCSegmentMinus && CSCSegmentPlus)
861 else if (CSCSegmentMinus && CSCRecHitPlus)
863 else if (CSCSegmentMinus)
865 else if (CSCRecHitMinus && CSCTrackPlus)
867 else if (CSCRecHitMinus && CSCSegmentPlus)
869 else if (CSCRecHitMinus && CSCRecHitPlus)
871 else if (CSCRecHitMinus)
short int NOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
MonitorElement * hEcalHaloData_SuperClusterShowerShapes
MonitorElement * hCSCHaloData_NOutOfTimeTriggersMEMinus
const bool EcalTightHaloId() const
EventNumber_t event() const
int NumberOfHaloTracks(HaloData::Endcap z=HaloData::both) const
edm::ValueMap< float > & GetShowerShapesRoundness()
MonitorElement * hHcalHaloData_PhiWedgeConstituents
MonitorElement * hExtra_HcalToF_HaloId
MonitorElement * hExtra_CSCTrackInnerOuterDPhi
edm::EDGetTokenT< HBHERecHitCollection > IT_HBHERecHit
MonitorElement * hExtra_InnerMostTrackHitXY
double pt() const final
transverse momentum
MonitorElement * hExtra_CSCTrackNHits
const bool HcalTightHaloId() const
MonitorElement * hEcalHaloData_SuperClusterNHits
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMaxTime
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
const bool GlobalLooseHaloId() const
MonitorElement * hCSCHaloData_SegmentdT
const std::vector< PhiWedge > & GetPhiWedges() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hEcalHaloData_PhiWedgeiPhi
edm::EDGetTokenT< reco::GlobalHaloData > IT_GlobalHaloData
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
const bool LooseId() const
edm::ValueMap< float > & GetShowerShapesAngle()
MonitorElement * hHcalHaloData_PhiWedgePlusZDirectionConfidence
MonitorElement * hEcalHaloData_PhiWedgeMultiplicity
bool CSCHaloHLTAccept() const
MonitorElement * hHcalHaloData_PhiWedgeMaxTime
short int NTracksSmallBetaAndSmalldT() const
Geom::Phi< T > phi() const
edm::EDGetTokenT< reco::BeamHaloSummary > IT_BeamHaloSummary
edm::EDGetTokenT< reco::CSCHaloData > IT_CSCHaloData
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * hHcalHaloData_PhiWedgeZDirectionConfidence
MonitorElement * hCSCHaloData_FreeInverseBetaVsSegmentdT
int bunchCrossing() const
unsigned long long EventNumber_t
edm::LuminosityBlockNumber_t luminosityBlock() const
short int NumberOfOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
MonitorElement * hCSCHaloData_TrackMultiplicityMEMinus
MonitorElement * hCSCHaloData_NTracksSmallBetaAndSmalldT
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMultiplicity
std::vector< const CSCSegment * > matchCSC(const reco::Track &muon, const edm::Event &event)
MonitorElement * hExtra_CSCTrackChi2Ndof
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeConstituents
const bool TightId() const
const bool GlobalTightHaloId() const
edm::EDGetTokenT< CSCSegmentCollection > IT_CSCSegment
MonitorElement * hCSCHaloData_NFlatSegmentsInBothEndcaps
std::vector< PhiWedge > & GetMatchedEcalPhiWedges()
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeEnergy
MonitorElement * hEcalHaloData_PhiWedgeMinTime
short int NFlatHaloSegments() const
MonitorElement * hCSCHaloData_InnerMostTrackHitRPlusZ
const Plane & surface() const
The nominal surface of the GeomDet.
unsigned int LuminosityBlockNumber_t
MonitorElement * hEcalHaloData_PhiWedgeEnergy
MonitorElement * hBeamHaloSummary_Id
MonitorElement * hHcalHaloData_PhiWedgeMinVsMaxTime
MonitorElement * hHcalHaloData_PhiWedgeEnergy
MonitorElement * hCSCHaloData_InnerMostTrackHitRMinusZ
MonitorElement * hCSCHaloData_L1HaloTriggersMEMinus
bool GetSegmentsInBothEndcaps() const
const bool HcalLooseHaloId() const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeConstituents
const bool CSCTightHaloId() const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMinTime
int Phi_To_iPhi(float phi)
C::const_iterator const_iterator
constant access iterator type
MonitorElement * hEcalHaloData_PhiWedgeMinVsMaxTime
MonitorElement * hExtra_InnerMostTrackHitRPlusZ
MonitorElement * hCSCHaloData_TrackMultiplicityMEPlus
MonitorElement * hGlobalHaloData_MExCorrection
MonitorElement * hExtra_InnerMostTrackHitPhi
MonitorElement * hCSCHaloData_NTracksSmallBeta
MonitorElement * hExtra_HcalToF
short int NTracksSmallBeta() const
MonitorElement * hCSCHaloData_InnerMostTrackHitR
MonitorElement * hExtra_InnerMostTrackHitR
MonitorElement * hBeamHaloSummary_BXN
MonitorElement * hCSCHaloData_NOutOfTimeTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeiPhi
constexpr int iphi() const
get the cell iphi
short int NTracksSmalldT() const
MonitorElement * hExtra_EcalToF
MonitorElement * hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists
MonitorElement * hGlobalHaloData_HaloCorrectedMET
MonitorElement * hEcalHaloData_PhiWedgeMaxTime
MonitorElement * hCSCHaloData_SegmentsInBothEndcaps
MonitorElement * hCSCHaloData_NFlatHaloSegments
const std::vector< GlobalPoint > & GetCSCTrackImpactPositions() const
MonitorElement * hCSCHaloData_L1HaloTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence
MonitorElement * hCSCHaloData_NOutOfTimeTriggers
edm::EDGetTokenT< CSCRecHit2DCollection > IT_CSCRecHit
MonitorElement * hEcalHaloData_SuperClusterPhiVsEta
MonitorElement * hCSCHaloData_NTracksSmalldT
short int NOutOfTimeHits() const
MuonSegmentMatcher * TheMatcher
MonitorElement * hHcalHaloData_PhiWedgeiPhi
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMaxTime
edm::EDGetTokenT< reco::MuonTimeExtraMap > IT_CSCTimeMapToken
int NumberOfHaloTriggers(HaloData::Endcap z=HaloData::both) const
reco::CaloMET GetCorrectedCaloMET(const reco::CaloMET &RawMET) const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeEnergy
edm::EDGetTokenT< reco::EcalHaloData > IT_EcalHaloData
edm::EDGetTokenT< reco::CaloMETCollection > IT_met
MonitorElement * hCSCHaloData_TrackMultiplicity
T const * product() const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity
MonitorElement * hHcalHaloData_PhiWedgeMinTime
MonitorElement * hHcalHaloData_PhiWedgeMultiplicity
MonitorElement * hExtra_InnerMostTrackHitRMinusZ
MonitorElement * hCSCHaloData_HLHaloTriggers
const bool CSCLooseHaloId() const
MonitorElement * hEcalHaloData_SuperClusterEnergy
MonitorElement * hCSCHaloData_NTracksSmalldTvsNHaloTracks
MonitorElement * hEcalHaloData_PhiWedgeZDirectionConfidence
MonitorElement * hGlobalHaloData_RawMETOverSumEt
std::vector< PhiWedge > & GetMatchedHcalPhiWedges()
MonitorElement * hCSCHaloData_FreeInverseBeta
MonitorElement * hCSCHaloData_InnerMostTrackHitPhi
MonitorElement * hCSCHaloData_InnerMostTrackHitXY
MonitorElement * hExtra_CSCTrackInnerOuterDEta
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMinTime
size_type size() const
Size of the RefVector.
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence
const std::vector< PhiWedge > & GetPhiWedges() const
MonitorElement * hExtra_InnerMostTrackHitiPhi
MonitorElement * hGlobalHaloData_MEyCorrection
MonitorElement * hEcalHaloData_PhiWedgeConstituents
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * hCSCHaloData_NOutOfTimeHits
MonitorElement * hEcalHaloData_PhiWedgePlusZDirectionConfidence
MonitorElement * hCSCHaloData_InnerMostTrackHitiPhi
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeiPhi
MonitorElement * hGlobalHaloData_RawMETMinusHaloCorrectedMET
const bool EcalLooseHaloId() const
MonitorElement * hExtra_CSCActivityWithMET
MonitorElement * hExtra_EcalToF_HaloId
MonitorElement * hCSCHaloData_L1HaloTriggers
edm::EDGetTokenT< EBRecHitCollection > IT_EBRecHit
edm::EDGetTokenT< reco::HcalHaloData > IT_HcalHaloData
edm::RefVector< reco::TrackCollection > & GetTracks()
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
edm::EDGetTokenT< reco::MuonCollection > IT_CosmicStandAloneMuon