309 int TheEventNumber = TheEvent.
event();
326 bool CSCTrackPlus =
false;
bool CSCTrackMinus =
false;
330 for( reco::MuonCollection::const_iterator iMuon = TheCosmics->begin() ; iMuon != TheCosmics->end() ; iMuon++, imucount++ )
335 if( !CSCTrackPlus || !CSCTrackMinus )
337 if( Track->eta() > 0 || Track->outerPosition().z() > 0 || Track->innerPosition().z() > 0 ) CSCTrackPlus =
true ;
338 else if( Track->eta() < 0 || Track->outerPosition().z() < 0 || Track->innerPosition().z() < 0) CSCTrackMinus =
true;
341 float innermost_phi = 0.;
342 float outermost_phi = 0.;
343 float innermost_z = 99999.;
344 float outermost_z = 0.;
345 float innermost_eta = 0.;
346 float outermost_eta = 0.;
347 float innermost_x =0.;
348 float innermost_y =0.;
349 float innermost_r =0.;
350 for(
unsigned int j = 0 ;
j < Track->extra()->recHits().size();
j++ )
353 DetId TheDetUnitId(
hit->geographicalId());
357 const GeomDetUnit *TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
360 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
362 float z = TheGlobalPosition.
z();
363 if( TMath::Abs(z) < innermost_z )
365 innermost_phi = TheGlobalPosition.
phi();
366 innermost_eta = TheGlobalPosition.
eta();
367 innermost_z = TheGlobalPosition.
z();
368 innermost_x = TheGlobalPosition.
x();
369 innermost_y = TheGlobalPosition.
y();
370 innermost_r = TMath::Sqrt( innermost_x*innermost_x + innermost_y*innermost_y );
372 if( TMath::Abs(z) > outermost_z)
374 outermost_phi = TheGlobalPosition.
phi() ;
375 outermost_eta = TheGlobalPosition.
eta() ;
376 outermost_z = TheGlobalPosition.
z();
379 float dphi = TMath::Abs( outermost_phi - innermost_phi );
380 float deta = TMath::Abs( outermost_eta - innermost_eta );
400 float InnerSegmentTime[2] = {0,0};
401 float OuterSegmentTime[2] = {0,0};
402 float innermost_seg_z[2] = {1500,1500};
403 float outermost_seg_z[2] = {0,0};
404 for (std::vector<const CSCSegment*>::const_iterator segment =MatchedSegments.begin();
405 segment != MatchedSegments.end(); ++segment)
407 CSCDetId TheCSCDetId((*segment)->cscDetId());
408 const CSCChamber* TheCSCChamber = TheCSCGeometry->chamber(TheCSCDetId);
409 LocalPoint TheLocalPosition = (*segment)->localPosition();
410 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
411 float z = TheGlobalPosition.
z();
412 int TheEndcap = TheCSCDetId.endcap();
413 if( TMath::Abs(z) < innermost_seg_z[TheEndcap-1] )
415 innermost_seg_z[TheEndcap-1] = TMath::Abs(z);
416 InnerSegmentTime[TheEndcap-1] = (*segment)->time();
418 if( TMath::Abs(z) > outermost_seg_z[TheEndcap-1] )
420 outermost_seg_z[TheEndcap-1] = TMath::Abs(z);
421 OuterSegmentTime[TheEndcap-1] = (*segment)->time();
425 float dT_Segment = 0;
426 if( innermost_seg_z[0] < outermost_seg_z[0])
427 dT_Segment = OuterSegmentTime[0]-InnerSegmentTime[0];
428 if( innermost_seg_z[1] < outermost_seg_z[1])
432 if (dT_Segment == 0.0 || OuterSegmentTime[1]-InnerSegmentTime[1] < dT_Segment)
433 dT_Segment = OuterSegmentTime[1]-InnerSegmentTime[1] ;
455 std::vector< CSCSegment> vCSCSegments_Plus;
456 std::vector< CSCSegment> vCSCSegments_Minus;
458 bool CSCSegmentPlus =
false;
459 bool CSCSegmentMinus=
false;
464 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
467 if ( iDetId.
endcap() == 1 ) vCSCSegments_Plus.push_back( *iSegment );
468 else vCSCSegments_Minus.push_back( *iSegment );
473 if( vCSCSegments_Plus.size() ) CSCSegmentPlus =
true;
474 if( vCSCSegments_Minus.size() ) CSCSegmentMinus =
true;
479 bool CSCRecHitPlus =
false;
480 bool CSCRecHitMinus =
false;
485 DetId TheDetUnitId(iCSCRecHit->geographicalId());
486 const GeomDetUnit *TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
487 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
488 const BoundPlane& TheSurface = TheUnit->surface();
489 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
492 if ( TheGlobalPosition.
z() > 0 ) CSCRecHitPlus =
true;
493 else CSCRecHitMinus =
true;
505 if( iEBRecHit->energy() < 0.5 )
continue;
508 int ieta = EcalId.ieta() ;
523 if( iHBHERecHit->energy() < 1.)
continue;
537 int TheHaloOrigin = 0;
538 if (TheCSCDataHandle.
isValid())
548 float r = TMath::Sqrt(
i->x()*
i->x() +
i->y()*
i->y() );
588 if( TheEcalHaloData.
isValid() )
591 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
592 for(std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end(); iWedge ++ )
615 float angle = vm_Angle[cluster];
616 float roundness = vm_Roundness[cluster];
631 if( TheHcalHaloData.
isValid( ) )
634 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
636 for(std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end(); iWedge ++ )
659 if( TheGlobalHaloData.
isValid() )
666 const CaloMET *RawMET = &(calometcol->front());
674 if( RawMET->
sumEt() )
683 for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge ++ )
696 int iphi =
id.
iphi() ;
697 if( iphi != iWedge->iPhi() )
continue;
698 if( iHBHERecHit->energy() < 1.0)
continue;
700 float time = iHBHERecHit->time();
701 int ieta =
id.ieta();
710 for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge ++ )
722 if( iEBRecHit->energy() < 0.5 )
continue;
725 int iPhi = EcalId.iphi() ;
726 iPhi = (iPhi-1)/5 + 1;
727 if( iPhi != iWedge->iPhi() )
continue;
739 if( TheBeamHaloSummary.
isValid() )
746 if(Dump)*
out << std::setw(15) <<
"CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
757 if(Dump) *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
768 if(Dump) *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
779 if(Dump) *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
806 const CaloMET *calomet = &(calometcol->front());
809 if(Dump) *
out << std::setw(15) <<
"HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
812 if( calomet->
pt() > 15.0 )
814 if( TheHaloOrigin > 0 )
816 if( CSCTrackPlus && CSCTrackMinus )
818 else if( CSCTrackPlus && CSCSegmentMinus)
820 else if( CSCTrackPlus && CSCRecHitMinus )
822 else if( CSCTrackPlus )
824 else if( CSCSegmentPlus && CSCTrackMinus )
826 else if( CSCSegmentPlus && CSCSegmentMinus )
828 else if( CSCSegmentPlus && CSCRecHitMinus )
830 else if( CSCSegmentPlus )
832 else if( CSCRecHitPlus && CSCTrackMinus )
834 else if( CSCRecHitPlus && CSCSegmentMinus )
836 else if( CSCRecHitPlus && CSCRecHitMinus )
838 else if( CSCRecHitPlus )
843 else if( TheHaloOrigin < 0 )
845 if( CSCTrackMinus && CSCTrackPlus )
847 else if( CSCTrackMinus && CSCSegmentPlus)
849 else if( CSCTrackMinus && CSCRecHitPlus )
851 else if( CSCTrackMinus )
853 else if( CSCSegmentMinus && CSCTrackPlus)
855 else if( CSCSegmentMinus && CSCSegmentPlus )
857 else if( CSCSegmentMinus && CSCRecHitPlus )
859 else if( CSCSegmentMinus )
861 else if( CSCRecHitMinus && CSCTrackPlus )
863 else if( CSCRecHitMinus && CSCSegmentPlus )
865 else if( CSCRecHitMinus && CSCRecHitPlus )
867 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::InputTag IT_HcalHaloData
edm::InputTag IT_BeamHaloSummary
MonitorElement * hExtra_InnerMostTrackHitXY
MonitorElement * hExtra_CSCTrackNHits
const bool HcalTightHaloId() const
MonitorElement * hEcalHaloData_SuperClusterNHits
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeMaxTime
const bool GlobalLooseHaloId() const
MonitorElement * hCSCHaloData_SegmentdT
const std::vector< PhiWedge > & GetPhiWedges() const
MonitorElement * hEcalHaloData_PhiWedgeiPhi
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::InputTag IT_GlobalHaloData
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * hHcalHaloData_PhiWedgeZDirectionConfidence
MonitorElement * hCSCHaloData_FreeInverseBetaVsSegmentdT
int bunchCrossing() const
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
edm::InputTag IT_EBRecHit
const bool GlobalTightHaloId() const
MonitorElement * hCSCHaloData_NFlatSegmentsInBothEndcaps
std::vector< PhiWedge > & GetMatchedEcalPhiWedges()
MonitorElement * hGlobalHaloData_MatchedEcalPhiWedgeEnergy
edm::InputTag IT_CSCRecHit
MonitorElement * hEcalHaloData_PhiWedgeMinTime
short int NFlatHaloSegments() const
MonitorElement * hCSCHaloData_InnerMostTrackHitRPlusZ
const Plane & surface() const
The nominal surface of the GeomDet.
edm::InputTag IT_EcalHaloData
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
edm::InputTag IT_CosmicStandAloneMuon
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeConstituents
const bool CSCTightHaloId() const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMinTime
edm::InputTag IT_HBHERecHit
int Phi_To_iPhi(float phi)
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
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
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMaxTime
int NumberOfHaloTriggers(HaloData::Endcap z=HaloData::both) const
reco::CaloMET GetCorrectedCaloMET(const reco::CaloMET &RawMET) const
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeEnergy
int iphi() const
get the cell iphi
MonitorElement * hCSCHaloData_TrackMultiplicity
MonitorElement * hGlobalHaloData_MatchedHcalPhiWedgeMultiplicity
MonitorElement * hHcalHaloData_PhiWedgeMinTime
edm::InputTag IT_CSCHaloData
MonitorElement * hHcalHaloData_PhiWedgeMultiplicity
T const * product() const
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
MonitorElement * hCSCHaloData_NOutOfTimeHits
virtual float pt() const GCC11_FINAL
transverse momentum
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::InputTag IT_CSCSegment
edm::RefVector< reco::TrackCollection > & GetTracks()
T angle(T x1, T y1, T z1, T x2, T y2, T z2)