325 bool CSCTrackPlus =
false;
bool CSCTrackMinus =
false;
329 for( reco::MuonCollection::const_iterator iMuon = TheCosmics->begin() ; iMuon != TheCosmics->end() ; iMuon++, imucount++ )
334 if( !CSCTrackPlus || !CSCTrackMinus )
336 if( Track->eta() > 0 || Track->outerPosition().z() > 0 || Track->innerPosition().z() > 0 ) CSCTrackPlus =
true ;
337 else if( Track->eta() < 0 || Track->outerPosition().z() < 0 || Track->innerPosition().z() < 0) CSCTrackMinus =
true;
340 float innermost_phi = 0.;
341 float outermost_phi = 0.;
342 float innermost_z = 99999.;
343 float outermost_z = 0.;
344 float innermost_eta = 0.;
345 float outermost_eta = 0.;
346 float innermost_x =0.;
347 float innermost_y =0.;
348 float innermost_r =0.;
349 for(
unsigned int j = 0 ;
j < Track->extra()->recHitsSize();
j++ )
351 auto hit = Track->extra()->recHitRef(
j);
352 DetId TheDetUnitId(
hit->geographicalId());
356 const GeomDetUnit *TheUnit = TheCSCGeometry->idToDetUnit(TheDetUnitId);
359 const GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
361 float z = TheGlobalPosition.
z();
364 innermost_phi = TheGlobalPosition.
phi();
365 innermost_eta = TheGlobalPosition.
eta();
366 innermost_z = TheGlobalPosition.
z();
367 innermost_x = TheGlobalPosition.
x();
368 innermost_y = TheGlobalPosition.
y();
369 innermost_r = TMath::Sqrt( innermost_x*innermost_x + innermost_y*innermost_y );
373 outermost_phi = TheGlobalPosition.
phi() ;
374 outermost_eta = TheGlobalPosition.
eta() ;
375 outermost_z = TheGlobalPosition.
z();
378 float dphi =
TMath::Abs( outermost_phi - innermost_phi );
379 float deta =
TMath::Abs( outermost_eta - innermost_eta );
399 float InnerSegmentTime[2] = {0,0};
400 float OuterSegmentTime[2] = {0,0};
401 float innermost_seg_z[2] = {1500,1500};
402 float outermost_seg_z[2] = {0,0};
403 for (std::vector<const CSCSegment*>::const_iterator segment =MatchedSegments.begin();
404 segment != MatchedSegments.end(); ++segment)
406 CSCDetId TheCSCDetId((*segment)->cscDetId());
407 const CSCChamber* TheCSCChamber = TheCSCGeometry->chamber(TheCSCDetId);
408 LocalPoint TheLocalPosition = (*segment)->localPosition();
409 const GlobalPoint TheGlobalPosition = TheCSCChamber->toGlobal(TheLocalPosition);
410 float z = TheGlobalPosition.
z();
411 int TheEndcap = TheCSCDetId.endcap();
412 if(
TMath::Abs(z) < innermost_seg_z[TheEndcap-1] )
415 InnerSegmentTime[TheEndcap-1] = (*segment)->time();
417 if(
TMath::Abs(z) > outermost_seg_z[TheEndcap-1] )
420 OuterSegmentTime[TheEndcap-1] = (*segment)->time();
424 float dT_Segment = 0;
425 if( innermost_seg_z[0] < outermost_seg_z[0])
426 dT_Segment = OuterSegmentTime[0]-InnerSegmentTime[0];
427 if( innermost_seg_z[1] < outermost_seg_z[1])
431 if (dT_Segment == 0.0 || OuterSegmentTime[1]-InnerSegmentTime[1] < dT_Segment)
432 dT_Segment = OuterSegmentTime[1]-InnerSegmentTime[1] ;
454 std::vector< CSCSegment> vCSCSegments_Plus;
455 std::vector< CSCSegment> vCSCSegments_Minus;
457 bool CSCSegmentPlus =
false;
458 bool CSCSegmentMinus=
false;
463 const std::vector<CSCRecHit2D> vCSCRecHits = iSegment->specificRecHits();
466 if ( iDetId.
endcap() == 1 ) vCSCSegments_Plus.push_back( *iSegment );
467 else vCSCSegments_Minus.push_back( *iSegment );
472 if( vCSCSegments_Plus.size() ) CSCSegmentPlus =
true;
473 if( vCSCSegments_Minus.size() ) CSCSegmentMinus =
true;
478 bool CSCRecHitPlus =
false;
479 bool CSCRecHitMinus =
false;
484 DetId TheDetUnitId(iCSCRecHit->geographicalId());
485 const GeomDetUnit *TheUnit = (*TheCSCGeometry).idToDetUnit(TheDetUnitId);
486 LocalPoint TheLocalPosition = iCSCRecHit->localPosition();
487 const BoundPlane& TheSurface = TheUnit->surface();
488 GlobalPoint TheGlobalPosition = TheSurface.toGlobal(TheLocalPosition);
491 if ( TheGlobalPosition.
z() > 0 ) CSCRecHitPlus =
true;
492 else CSCRecHitMinus =
true;
504 if( iEBRecHit->energy() < 0.5 )
continue;
507 int ieta = EcalId.ieta() ;
522 if( iHBHERecHit->energy() < 1.)
continue;
536 int TheHaloOrigin = 0;
537 if (TheCSCDataHandle.
isValid())
547 float r = TMath::Sqrt(
i->x()*
i->x() +
i->y()*
i->y() );
587 if( TheEcalHaloData.
isValid() )
590 std::vector<PhiWedge> EcalWedges = EcalData.
GetPhiWedges();
591 for(std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end(); iWedge ++ )
614 float angle = vm_Angle[cluster];
615 float roundness = vm_Roundness[cluster];
630 if( TheHcalHaloData.
isValid( ) )
633 std::vector<PhiWedge> HcalWedges = HcalData.
GetPhiWedges();
635 for(std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end(); iWedge ++ )
658 if( TheGlobalHaloData.
isValid() )
665 const CaloMET *RawMET = &(calometcol->front());
673 if( RawMET->
sumEt() )
682 for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge ++ )
695 int iphi =
id.
iphi() ;
696 if( iphi != iWedge->iPhi() )
continue;
697 if( iHBHERecHit->energy() < 1.0)
continue;
699 float time = iHBHERecHit->time();
700 int ieta =
id.ieta();
709 for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge ++ )
721 if( iEBRecHit->energy() < 0.5 )
continue;
724 int iPhi = EcalId.iphi() ;
725 iPhi = (iPhi-1)/5 + 1;
726 if( iPhi != iWedge->iPhi() )
continue;
738 if( TheBeamHaloSummary.
isValid() )
745 if(Dump)*
out << std::setw(15) <<
"CSCLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
756 if(Dump) *
out << std::setw(15) <<
"EcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
767 if(Dump) *
out << std::setw(15) <<
"HcalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
778 if(Dump) *
out << std::setw(15) <<
"GlobalLoose" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
805 const CaloMET *calomet = &(calometcol->front());
808 if(Dump) *
out << std::setw(15) <<
"HighMET" << std::setw(15) << Run << std::setw(15) << Lumi << std::setw(15) << TheEventNumber << std::endl;
811 if( calomet->
pt() > 15.0 )
813 if( TheHaloOrigin > 0 )
815 if( CSCTrackPlus && CSCTrackMinus )
817 else if( CSCTrackPlus && CSCSegmentMinus)
819 else if( CSCTrackPlus && CSCRecHitMinus )
821 else if( CSCTrackPlus )
823 else if( CSCSegmentPlus && CSCTrackMinus )
825 else if( CSCSegmentPlus && CSCSegmentMinus )
827 else if( CSCSegmentPlus && CSCRecHitMinus )
829 else if( CSCSegmentPlus )
831 else if( CSCRecHitPlus && CSCTrackMinus )
833 else if( CSCRecHitPlus && CSCSegmentMinus )
835 else if( CSCRecHitPlus && CSCRecHitMinus )
837 else if( CSCRecHitPlus )
842 else if( TheHaloOrigin < 0 )
844 if( CSCTrackMinus && CSCTrackPlus )
846 else if( CSCTrackMinus && CSCSegmentPlus)
848 else if( CSCTrackMinus && CSCRecHitPlus )
850 else if( CSCTrackMinus )
852 else if( CSCSegmentMinus && CSCTrackPlus)
854 else if( CSCSegmentMinus && CSCSegmentPlus )
856 else if( CSCSegmentMinus && CSCRecHitPlus )
858 else if( CSCSegmentMinus )
860 else if( CSCRecHitMinus && CSCTrackPlus )
862 else if( CSCRecHitMinus && CSCSegmentPlus )
864 else if( CSCRecHitMinus && CSCRecHitPlus )
866 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
virtual float pt() const
transverse momentum
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
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)
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
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
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
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
edm::RefVector< reco::TrackCollection > & GetTracks()
T angle(T x1, T y1, T z1, T x2, T y2, T z2)