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;
514 if (iEBRecHit->energy() < 0.5)
518 int ieta = EcalId.ieta();
527 if (TheHBHERecHits.
isValid()) {
529 iHBHERecHit != TheHBHERecHits->
end();
531 if (iHBHERecHit->energy() < 1.)
546 int TheHaloOrigin = 0;
547 if (TheCSCDataHandle.
isValid()) {
554 for (std::vector<GlobalPoint>::const_iterator
i =
CSCData.GetCSCTrackImpactPositions().begin();
555 i !=
CSCData.GetCSCTrackImpactPositions().end();
557 float r = TMath::Sqrt(
i->x() *
i->x() +
i->y() *
i->y());
589 if (
CSCData.GetSegmentsInBothEndcaps())
597 if (TheEcalHaloData.
isValid()) {
599 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
600 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
620 float angle = vm_Angle[cluster];
621 float roundness = vm_Roundness[cluster];
635 if (TheHcalHaloData.
isValid()) {
637 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
639 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
658 if (TheGlobalHaloData.
isValid()) {
679 for (std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin(); iWedge != HcalWedges.end(); iWedge++) {
686 if (TheHBHERecHits.
isValid()) {
688 iHBHERecHit != TheHBHERecHits->
end();
691 int iphi =
id.iphi();
692 if (
iphi != iWedge->iPhi())
694 if (iHBHERecHit->energy() < 1.0)
697 float time = iHBHERecHit->time();
698 int ieta =
id.ieta();
707 for (std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin(); iWedge != EcalWedges.end(); iWedge++) {
717 if (iEBRecHit->energy() < 0.5)
721 int iPhi = EcalId.iphi();
722 iPhi = (iPhi - 1) / 5 + 1;
723 if (iPhi != iWedge->iPhi())
735 if (TheBeamHaloSummary.
isValid()) {
742 *
out << std::setw(15) <<
"CSCLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
743 << TheEventNumber << std::endl;
755 *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
756 << TheEventNumber << std::endl;
768 *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
769 << TheEventNumber << std::endl;
781 *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
782 << TheEventNumber << std::endl;
809 const CaloMET* calomet = &(calometcol->front());
813 *
out << std::setw(15) <<
"HighMET" << std::setw(15) <<
Run << std::setw(15) <<
Lumi << std::setw(15)
814 << TheEventNumber << std::endl;
817 if (calomet->
pt() > 15.0) {
818 if (TheHaloOrigin > 0) {
819 if (CSCTrackPlus && CSCTrackMinus)
821 else if (CSCTrackPlus && CSCSegmentMinus)
823 else if (CSCTrackPlus && CSCRecHitMinus)
825 else if (CSCTrackPlus)
827 else if (CSCSegmentPlus && CSCTrackMinus)
829 else if (CSCSegmentPlus && CSCSegmentMinus)
831 else if (CSCSegmentPlus && CSCRecHitMinus)
833 else if (CSCSegmentPlus)
835 else if (CSCRecHitPlus && CSCTrackMinus)
837 else if (CSCRecHitPlus && CSCSegmentMinus)
839 else if (CSCRecHitPlus && CSCRecHitMinus)
841 else if (CSCRecHitPlus)
845 }
else if (TheHaloOrigin < 0) {
846 if (CSCTrackMinus && CSCTrackPlus)
848 else if (CSCTrackMinus && CSCSegmentPlus)
850 else if (CSCTrackMinus && CSCRecHitPlus)
852 else if (CSCTrackMinus)
854 else if (CSCSegmentMinus && CSCTrackPlus)
856 else if (CSCSegmentMinus && CSCSegmentPlus)
858 else if (CSCSegmentMinus && CSCRecHitPlus)
860 else if (CSCSegmentMinus)
862 else if (CSCRecHitMinus && CSCTrackPlus)
864 else if (CSCRecHitMinus && CSCSegmentPlus)
866 else if (CSCRecHitMinus && CSCRecHitPlus)
868 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