322 int BXN =
iEvent.bunchCrossing();
336 bool CSCTrackPlus =
false;
337 bool CSCTrackMinus =
false;
340 for (reco::MuonCollection::const_iterator iMuon = TheCosmics->begin(); iMuon != TheCosmics->end();
341 iMuon++, imucount++) {
346 if (!CSCTrackPlus || !CSCTrackMinus) {
350 CSCTrackMinus =
true;
353 float innermost_phi = 0.;
354 float outermost_phi = 0.;
355 float innermost_z = 99999.;
356 float outermost_z = 0.;
357 float innermost_eta = 0.;
358 float outermost_eta = 0.;
359 float innermost_x = 0.;
360 float innermost_y = 0.;
361 float innermost_r = 0.;
362 for (
unsigned int j = 0;
j <
Track->
extra()->recHitsSize();
j++) {
364 DetId TheDetUnitId(
hit->geographicalId());
370 const GeomDetUnit* TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
373 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
375 float z = TheGlobalPosition.
z();
376 if (TMath::Abs(
z) < innermost_z) {
377 innermost_phi = TheGlobalPosition.
phi();
378 innermost_eta = TheGlobalPosition.
eta();
379 innermost_z = TheGlobalPosition.
z();
380 innermost_x = TheGlobalPosition.
x();
381 innermost_y = TheGlobalPosition.
y();
382 innermost_r = TMath::Sqrt(innermost_x * innermost_x + innermost_y * innermost_y);
384 if (TMath::Abs(
z) > outermost_z) {
385 outermost_phi = TheGlobalPosition.
phi();
386 outermost_eta = TheGlobalPosition.
eta();
387 outermost_z = TheGlobalPosition.
z();
390 float dphi = TMath::Abs(outermost_phi - innermost_phi);
391 float deta = TMath::Abs(outermost_eta - innermost_eta);
410 float InnerSegmentTime[2] = {0, 0};
411 float OuterSegmentTime[2] = {0, 0};
412 float innermost_seg_z[2] = {1500, 1500};
413 float outermost_seg_z[2] = {0, 0};
414 for (std::vector<const CSCSegment*>::const_iterator segment = MatchedSegments.begin();
415 segment != MatchedSegments.end();
417 CSCDetId TheCSCDetId((*segment)->cscDetId());
418 const CSCChamber* TheCSCChamber = TheCSCGeometry->chamber(TheCSCDetId);
419 LocalPoint TheLocalPosition = (*segment)->localPosition();
420 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
421 float z = TheGlobalPosition.
z();
422 int TheEndcap = TheCSCDetId.endcap();
423 if (TMath::Abs(
z) < innermost_seg_z[TheEndcap - 1]) {
424 innermost_seg_z[TheEndcap - 1] = TMath::Abs(
z);
425 InnerSegmentTime[TheEndcap - 1] = (*segment)->time();
427 if (TMath::Abs(
z) > outermost_seg_z[TheEndcap - 1]) {
428 outermost_seg_z[TheEndcap - 1] = TMath::Abs(
z);
429 OuterSegmentTime[TheEndcap - 1] = (*segment)->time();
433 float dT_Segment = 0;
434 if (innermost_seg_z[0] < outermost_seg_z[0])
435 dT_Segment = OuterSegmentTime[0] - InnerSegmentTime[0];
436 if (innermost_seg_z[1] < outermost_seg_z[1])
440 if (dT_Segment == 0.0 || OuterSegmentTime[1] - InnerSegmentTime[1] < dT_Segment)
441 dT_Segment = OuterSegmentTime[1] - InnerSegmentTime[1];
462 std::vector<CSCSegment> vCSCSegments_Plus;
463 std::vector<CSCSegment> vCSCSegments_Minus;
465 bool CSCSegmentPlus =
false;
466 bool CSCSegmentMinus =
false;
467 if (TheCSCSegments.
isValid()) {
470 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
474 vCSCSegments_Plus.push_back(*iSegment);
476 vCSCSegments_Minus.push_back(*iSegment);
481 if (!vCSCSegments_Plus.empty())
482 CSCSegmentPlus =
true;
483 if (!vCSCSegments_Minus.empty())
484 CSCSegmentMinus =
true;
489 bool CSCRecHitPlus =
false;
490 bool CSCRecHitMinus =
false;
494 DetId TheDetUnitId(iCSCRecHit->geographicalId());
495 const GeomDetUnit* TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
496 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
497 const BoundPlane& TheSurface = TheUnit->surface();
498 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
501 if (TheGlobalPosition.
z() > 0)
502 CSCRecHitPlus =
true;
504 CSCRecHitMinus =
true;
515 if (iEBRecHit->energy() < 0.5)
519 int ieta = EcalId.ieta();
529 if (TheHBHERecHits.
isValid()) {
531 iHBHERecHit != TheHBHERecHits->
end();
533 if (iHBHERecHit->energy() < 1.)
548 int TheHaloOrigin = 0;
549 if (TheCSCDataHandle.
isValid()) {
556 for (std::vector<GlobalPoint>::const_iterator
i =
CSCData.GetCSCTrackImpactPositions().begin();
557 i !=
CSCData.GetCSCTrackImpactPositions().end();
559 float r = TMath::Sqrt(
i->x() *
i->x() +
i->y() *
i->y());
591 if (
CSCData.GetSegmentsInBothEndcaps())
599 if (TheEcalHaloData.
isValid()) {
601 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
602 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
622 float angle = vm_Angle[cluster];
623 float roundness = vm_Roundness[cluster];
637 if (TheHcalHaloData.
isValid()) {
639 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
641 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
660 if (TheGlobalHaloData.
isValid()) {
681 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
688 if (TheHBHERecHits.
isValid()) {
690 iHBHERecHit != TheHBHERecHits->
end();
693 int iphi =
id.iphi();
694 if (
iphi != iWedge->iPhi())
696 if (iHBHERecHit->energy() < 1.0)
699 float time = iHBHERecHit->time();
700 int ieta =
id.ieta();
709 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
719 if (iEBRecHit->energy() < 0.5)
723 int iPhi = EcalId.iphi();
724 iPhi = (iPhi - 1) / 5 + 1;
725 if (iPhi != iWedge->iPhi())
737 if (TheBeamHaloSummary.
isValid()) {
744 *
out << std::setw(15) <<
"CSCLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
745 << TheEventNumber << std::endl;
757 *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
758 << TheEventNumber << std::endl;
770 *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
771 << TheEventNumber << std::endl;
783 *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
784 << TheEventNumber << std::endl;
811 const CaloMET* calomet = &(calometcol->front());
815 *
out << std::setw(15) <<
"HighMET" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
816 << TheEventNumber << std::endl;
819 if (calomet->
pt() > 15.0) {
820 if (TheHaloOrigin > 0) {
821 if (CSCTrackPlus && CSCTrackMinus)
823 else if (CSCTrackPlus && CSCSegmentMinus)
825 else if (CSCTrackPlus && CSCRecHitMinus)
827 else if (CSCTrackPlus)
829 else if (CSCSegmentPlus && CSCTrackMinus)
831 else if (CSCSegmentPlus && CSCSegmentMinus)
833 else if (CSCSegmentPlus && CSCRecHitMinus)
835 else if (CSCSegmentPlus)
837 else if (CSCRecHitPlus && CSCTrackMinus)
839 else if (CSCRecHitPlus && CSCSegmentMinus)
841 else if (CSCRecHitPlus && CSCRecHitMinus)
843 else if (CSCRecHitPlus)
847 }
else if (TheHaloOrigin < 0) {
848 if (CSCTrackMinus && CSCTrackPlus)
850 else if (CSCTrackMinus && CSCSegmentPlus)
852 else if (CSCTrackMinus && CSCRecHitPlus)
854 else if (CSCTrackMinus)
856 else if (CSCSegmentMinus && CSCTrackPlus)
858 else if (CSCSegmentMinus && CSCSegmentPlus)
860 else if (CSCSegmentMinus && CSCRecHitPlus)
862 else if (CSCSegmentMinus)
864 else if (CSCRecHitMinus && CSCTrackPlus)
866 else if (CSCRecHitMinus && CSCSegmentPlus)
868 else if (CSCRecHitMinus && CSCRecHitPlus)
870 else if (CSCRecHitMinus)
MonitorElement * hEcalHaloData_SuperClusterShowerShapes
MonitorElement * hCSCHaloData_NOutOfTimeTriggersMEMinus
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
MonitorElement * hEcalHaloData_SuperClusterNHits
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMaxTime
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
unsigned short numberOfValidHits() const
number of valid hits found
const math::XYZPoint & outerPosition() const
position of the outermost hit
MonitorElement * hCSCHaloData_SegmentdT
MonitorElement * hEcalHaloData_PhiWedgeiPhi
edm::EDGetTokenT< reco::GlobalHaloData > IT_GlobalHaloData
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
Geom::Phi< T > phi() const
edm::ValueMap< float > & GetShowerShapesAngle()
MonitorElement * hHcalHaloData_PhiWedgePlusZDirectionConfidence
MonitorElement * hEcalHaloData_PhiWedgeMultiplicity
MonitorElement * hHcalHaloData_PhiWedgeMaxTime
T const * product() const
const bool GlobalTightHaloId() 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
unsigned long long EventNumber_t
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 EcalLooseHaloId() const
edm::EDGetTokenT< CSCSegmentCollection > IT_CSCSegment
MonitorElement * hCSCHaloData_NFlatSegmentsInBothEndcaps
std::vector< PhiWedge > & GetMatchedEcalPhiWedges()
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeEnergy
MonitorElement * hEcalHaloData_PhiWedgeMinTime
MonitorElement * hCSCHaloData_InnerMostTrackHitRPlusZ
unsigned int LuminosityBlockNumber_t
MonitorElement * hEcalHaloData_PhiWedgeEnergy
MonitorElement * hBeamHaloSummary_Id
MonitorElement * hHcalHaloData_PhiWedgeMinVsMaxTime
MonitorElement * hHcalHaloData_PhiWedgeEnergy
MonitorElement * hCSCHaloData_InnerMostTrackHitRMinusZ
MonitorElement * hCSCHaloData_L1HaloTriggersMEMinus
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeConstituents
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
MonitorElement * hCSCHaloData_InnerMostTrackHitR
MonitorElement * hExtra_InnerMostTrackHitR
MonitorElement * hBeamHaloSummary_BXN
MonitorElement * hCSCHaloData_NOutOfTimeTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeiPhi
const bool LooseId() const
MonitorElement * hExtra_EcalToF
MonitorElement * hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists
MonitorElement * hGlobalHaloData_HaloCorrectedMET
MonitorElement * hEcalHaloData_PhiWedgeMaxTime
MonitorElement * hCSCHaloData_SegmentsInBothEndcaps
MonitorElement * hCSCHaloData_NFlatHaloSegments
MonitorElement * hCSCHaloData_L1HaloTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence
reco::CaloMET GetCorrectedCaloMET(const reco::CaloMET &RawMET) const
MonitorElement * hCSCHaloData_NOutOfTimeTriggers
edm::EDGetTokenT< CSCRecHit2DCollection > IT_CSCRecHit
MonitorElement * hEcalHaloData_SuperClusterPhiVsEta
MonitorElement * hCSCHaloData_NTracksSmalldT
const_iterator begin() const
MuonSegmentMatcher * TheMatcher
MonitorElement * hHcalHaloData_PhiWedgeiPhi
const bool EcalTightHaloId() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMaxTime
edm::EDGetTokenT< reco::MuonTimeExtraMap > IT_CSCTimeMapToken
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeEnergy
edm::EDGetTokenT< reco::EcalHaloData > IT_EcalHaloData
const bool HcalLooseHaloId() const
const_iterator end() const
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< reco::CaloMETCollection > IT_met
MonitorElement * hCSCHaloData_TrackMultiplicity
const Plane & surface() const
The nominal surface of the GeomDet.
size_type size() const
Size of the RefVector.
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity
MonitorElement * hHcalHaloData_PhiWedgeMinTime
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
const bool CSCLooseHaloId() const
MonitorElement * hHcalHaloData_PhiWedgeMultiplicity
MonitorElement * hExtra_InnerMostTrackHitRMinusZ
const bool CSCTightHaloId() const
MonitorElement * hCSCHaloData_HLHaloTriggers
MonitorElement * hEcalHaloData_SuperClusterEnergy
MonitorElement * hCSCHaloData_NTracksSmalldTvsNHaloTracks
MonitorElement * hEcalHaloData_PhiWedgeZDirectionConfidence
MonitorElement * hGlobalHaloData_RawMETOverSumEt
std::vector< PhiWedge > & GetMatchedHcalPhiWedges()
const bool TightId() const
MonitorElement * hCSCHaloData_FreeInverseBeta
MonitorElement * hCSCHaloData_InnerMostTrackHitPhi
MonitorElement * hCSCHaloData_InnerMostTrackHitXY
MonitorElement * hExtra_CSCTrackInnerOuterDEta
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMinTime
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeZDirectionConfidence
MonitorElement * hExtra_InnerMostTrackHitiPhi
MonitorElement * hGlobalHaloData_MEyCorrection
MonitorElement * hEcalHaloData_PhiWedgeConstituents
MonitorElement * hCSCHaloData_NOutOfTimeHits
MonitorElement * hEcalHaloData_PhiWedgePlusZDirectionConfidence
MonitorElement * hCSCHaloData_InnerMostTrackHitiPhi
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeiPhi
const math::XYZPoint & innerPosition() const
position of the innermost hit
MonitorElement * hGlobalHaloData_RawMETMinusHaloCorrectedMET
const std::vector< PhiWedge > & GetPhiWedges() const
MonitorElement * hExtra_CSCActivityWithMET
MonitorElement * hExtra_EcalToF_HaloId
MonitorElement * hCSCHaloData_L1HaloTriggers
EventNumber_t event() const
edm::EDGetTokenT< EBRecHitCollection > IT_EBRecHit
const std::vector< PhiWedge > & GetPhiWedges() const
const TrackExtraRef & extra() const
reference to "extra" object
const bool HcalTightHaloId() const
edm::EDGetTokenT< reco::HcalHaloData > IT_HcalHaloData
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
const bool GlobalLooseHaloId() const
edm::EDGetTokenT< reco::MuonCollection > IT_CosmicStandAloneMuon