323 bool CSCTrackPlus =
false;
bool CSCTrackMinus =
false;
327 for( reco::MuonCollection::const_iterator iMuon = TheCosmics->begin() ; iMuon != TheCosmics->end() ; iMuon++, imucount++ )
332 if( !CSCTrackPlus || !CSCTrackMinus )
334 if( Track->eta() > 0 || Track->outerPosition().z() > 0 || Track->innerPosition().z() > 0 ) CSCTrackPlus =
true ;
335 else if( Track->eta() < 0 || Track->outerPosition().z() < 0 || Track->innerPosition().z() < 0) CSCTrackMinus =
true;
338 float innermost_phi = 0.;
339 float outermost_phi = 0.;
340 float innermost_z = 99999.;
341 float outermost_z = 0.;
342 float innermost_eta = 0.;
343 float outermost_eta = 0.;
344 float innermost_x =0.;
345 float innermost_y =0.;
346 float innermost_r =0.;
347 for(
unsigned int j = 0 ; j < Track->extra()->recHitsSize(); j++ )
349 auto hit = Track->extra()->recHitRef(j);
350 DetId TheDetUnitId(
hit->geographicalId());
357 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
359 float z = TheGlobalPosition.
z();
362 innermost_phi = TheGlobalPosition.
phi();
363 innermost_eta = TheGlobalPosition.
eta();
364 innermost_z = TheGlobalPosition.
z();
365 innermost_x = TheGlobalPosition.
x();
366 innermost_y = TheGlobalPosition.
y();
367 innermost_r = TMath::Sqrt( innermost_x*innermost_x + innermost_y*innermost_y );
371 outermost_phi = TheGlobalPosition.
phi() ;
372 outermost_eta = TheGlobalPosition.
eta() ;
373 outermost_z = TheGlobalPosition.
z();
376 float dphi =
TMath::Abs( outermost_phi - innermost_phi );
377 float deta =
TMath::Abs( outermost_eta - innermost_eta );
397 float InnerSegmentTime[2] = {0,0};
398 float OuterSegmentTime[2] = {0,0};
399 float innermost_seg_z[2] = {1500,1500};
400 float outermost_seg_z[2] = {0,0};
401 for (std::vector<const CSCSegment*>::const_iterator segment =MatchedSegments.begin();
402 segment != MatchedSegments.end(); ++segment)
404 CSCDetId TheCSCDetId((*segment)->cscDetId());
406 LocalPoint TheLocalPosition = (*segment)->localPosition();
407 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
408 float z = TheGlobalPosition.
z();
409 int TheEndcap = TheCSCDetId.endcap();
410 if(
TMath::Abs(z) < innermost_seg_z[TheEndcap-1] )
413 InnerSegmentTime[TheEndcap-1] = (*segment)->time();
415 if(
TMath::Abs(z) > outermost_seg_z[TheEndcap-1] )
418 OuterSegmentTime[TheEndcap-1] = (*segment)->time();
422 float dT_Segment = 0;
423 if( innermost_seg_z[0] < outermost_seg_z[0])
424 dT_Segment = OuterSegmentTime[0]-InnerSegmentTime[0];
425 if( innermost_seg_z[1] < outermost_seg_z[1])
429 if (dT_Segment == 0.0 || OuterSegmentTime[1]-InnerSegmentTime[1] < dT_Segment)
430 dT_Segment = OuterSegmentTime[1]-InnerSegmentTime[1] ;
452 std::vector< CSCSegment> vCSCSegments_Plus;
453 std::vector< CSCSegment> vCSCSegments_Minus;
455 bool CSCSegmentPlus =
false;
456 bool CSCSegmentMinus=
false;
461 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
464 if ( iDetId.
endcap() == 1 ) vCSCSegments_Plus.push_back( *iSegment );
465 else vCSCSegments_Minus.push_back( *iSegment );
470 if( !vCSCSegments_Plus.empty() ) CSCSegmentPlus =
true;
471 if( !vCSCSegments_Minus.empty() ) CSCSegmentMinus =
true;
476 bool CSCRecHitPlus =
false;
477 bool CSCRecHitMinus =
false;
482 DetId TheDetUnitId(iCSCRecHit->geographicalId());
483 const GeomDetUnit *TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
484 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
485 const BoundPlane& TheSurface = TheUnit->surface();
486 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
489 if ( TheGlobalPosition.
z() > 0 ) CSCRecHitPlus =
true;
490 else CSCRecHitMinus =
true;
502 if( iEBRecHit->energy() < 0.5 )
continue;
505 int ieta = EcalId.ieta() ;
520 if( iHBHERecHit->energy() < 1.)
continue;
534 int TheHaloOrigin = 0;
535 if (TheCSCDataHandle.
isValid())
545 float r = TMath::Sqrt(
i->x()*
i->x() +
i->y()*
i->y() );
585 if( TheEcalHaloData.
isValid() )
588 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
589 for(std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end(); iWedge ++ )
612 float angle = vm_Angle[cluster];
613 float roundness = vm_Roundness[cluster];
628 if( TheHcalHaloData.
isValid( ) )
631 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
633 for(std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end(); iWedge ++ )
656 if( TheGlobalHaloData.
isValid() )
671 if( RawMET->
sumEt() )
680 for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge ++ )
693 int iphi =
id.
iphi() ;
694 if( iphi != iWedge->iPhi() )
continue;
695 if( iHBHERecHit->energy() < 1.0)
continue;
697 float time = iHBHERecHit->time();
698 int ieta =
id.ieta();
707 for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge ++ )
719 if( iEBRecHit->energy() < 0.5 )
continue;
722 int iPhi = EcalId.iphi() ;
723 iPhi = (iPhi-1)/5 + 1;
724 if( iPhi != iWedge->iPhi() )
continue;
736 if( TheBeamHaloSummary.
isValid() )
743 if(Dump)*
out << std::setw(15) <<
"CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
754 if(Dump) *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
765 if(Dump) *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
776 if(Dump) *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
803 const CaloMET *calomet = &(calometcol->front());
806 if(Dump) *
out << std::setw(15) <<
"HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
809 if( calomet->
pt() > 15.0 )
811 if( TheHaloOrigin > 0 )
813 if( CSCTrackPlus && CSCTrackMinus )
815 else if( CSCTrackPlus && CSCSegmentMinus)
817 else if( CSCTrackPlus && CSCRecHitMinus )
819 else if( CSCTrackPlus )
821 else if( CSCSegmentPlus && CSCTrackMinus )
823 else if( CSCSegmentPlus && CSCSegmentMinus )
825 else if( CSCSegmentPlus && CSCRecHitMinus )
827 else if( CSCSegmentPlus )
829 else if( CSCRecHitPlus && CSCTrackMinus )
831 else if( CSCRecHitPlus && CSCSegmentMinus )
833 else if( CSCRecHitPlus && CSCRecHitMinus )
835 else if( CSCRecHitPlus )
840 else if( TheHaloOrigin < 0 )
842 if( CSCTrackMinus && CSCTrackPlus )
844 else if( CSCTrackMinus && CSCSegmentPlus)
846 else if( CSCTrackMinus && CSCRecHitPlus )
848 else if( CSCTrackMinus )
850 else if( CSCSegmentMinus && CSCTrackPlus)
852 else if( CSCSegmentMinus && CSCSegmentPlus )
854 else if( CSCSegmentMinus && CSCRecHitPlus )
856 else if( CSCSegmentMinus )
858 else if( CSCRecHitMinus && CSCTrackPlus )
860 else if( CSCRecHitMinus && CSCSegmentPlus )
862 else if( CSCRecHitMinus && CSCRecHitPlus )
864 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< CSCSegmentCollection > IT_CSCSegment
MonitorElement * hExtra_InnerMostTrackHitXY
MonitorElement * hExtra_CSCTrackNHits
const bool HcalTightHaloId() const
MonitorElement * hEcalHaloData_SuperClusterNHits
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMaxTime
edm::EDGetTokenT< reco::HcalHaloData > IT_HcalHaloData
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::MuonCollection > IT_CosmicStandAloneMuon
edm::EDGetTokenT< CSCRecHit2DCollection > IT_CSCRecHit
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
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * hHcalHaloData_PhiWedgeZDirectionConfidence
MonitorElement * hCSCHaloData_FreeInverseBetaVsSegmentdT
int bunchCrossing() const
unsigned long long EventNumber_t
edm::EDGetTokenT< reco::CSCHaloData > IT_CSCHaloData
edm::LuminosityBlockNumber_t luminosityBlock() const
short int NumberOfOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
MonitorElement * hCSCHaloData_TrackMultiplicityMEMinus
double pt() const final
transverse momentum
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
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
edm::EDGetTokenT< HBHERecHitCollection > IT_HBHERecHit
MonitorElement * hExtra_InnerMostTrackHitR
MonitorElement * hBeamHaloSummary_BXN
MonitorElement * hCSCHaloData_NOutOfTimeTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeiPhi
edm::EDGetTokenT< reco::GlobalHaloData > IT_GlobalHaloData
short int NTracksSmalldT() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * hExtra_EcalToF
MonitorElement * hCSCHaloData_NOutOfTimeTriggersvsL1HaloExists
MonitorElement * hGlobalHaloData_HaloCorrectedMET
MonitorElement * hEcalHaloData_PhiWedgeMaxTime
MonitorElement * hCSCHaloData_SegmentsInBothEndcaps
edm::EDGetTokenT< reco::MuonTimeExtraMap > IT_CSCTimeMapToken
MonitorElement * hCSCHaloData_NFlatHaloSegments
const std::vector< GlobalPoint > & GetCSCTrackImpactPositions() const
MonitorElement * hCSCHaloData_L1HaloTriggersMEPlus
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeZDirectionConfidence
MonitorElement * hCSCHaloData_NOutOfTimeTriggers
MonitorElement * hEcalHaloData_SuperClusterPhiVsEta
MonitorElement * hCSCHaloData_NTracksSmalldT
short int NOutOfTimeHits() const
MuonSegmentMatcher * TheMatcher
MonitorElement * hHcalHaloData_PhiWedgeiPhi
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMaxTime
int NumberOfHaloTriggers(HaloData::Endcap z=HaloData::both) const
reco::CaloMET GetCorrectedCaloMET(const reco::CaloMET &RawMET) const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeEnergy
const_iterator end() const
edm::EDGetTokenT< EBRecHitCollection > IT_EBRecHit
int iphi() const
get the cell iphi
MonitorElement * hCSCHaloData_TrackMultiplicity
edm::EDGetTokenT< reco::CaloMETCollection > IT_met
T const * product() const
edm::EDGetTokenT< reco::EcalHaloData > IT_EcalHaloData
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity
MonitorElement * hHcalHaloData_PhiWedgeMinTime
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
MonitorElement * hHcalHaloData_PhiWedgeMultiplicity
MonitorElement * hExtra_InnerMostTrackHitRMinusZ
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
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
MonitorElement * hCSCHaloData_NOutOfTimeHits
edm::EDGetTokenT< reco::BeamHaloSummary > IT_BeamHaloSummary
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
const_iterator begin() const
edm::RefVector< reco::TrackCollection > & GetTracks()
T angle(T x1, T y1, T z1, T x2, T y2, T z2)