CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::BeamHaloSummaryProducer Class Reference

#include <BeamHaloSummaryProducer.h>

Inheritance diagram for reco::BeamHaloSummaryProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 BeamHaloSummaryProducer (const edm::ParameterSet &)
 ~BeamHaloSummaryProducer ()

Private Member Functions

virtual void beginJob ()
virtual void beginRun (edm::Run &, const edm::EventSetup &)
virtual void endJob ()
virtual void endRun (edm::Run &, const edm::EventSetup &)
virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag IT_CSCHaloData
edm::InputTag IT_EcalHaloData
edm::InputTag IT_GlobalHaloData
edm::InputTag IT_HcalHaloData
float L_EcalPhiWedgeConfidence
int L_EcalPhiWedgeConstituents
float L_EcalPhiWedgeEnergy
float L_EcalPhiWedgeToF
float L_EcalShowerShapesAngle
float L_EcalShowerShapesRoundness
float L_EcalSuperClusterEnergy
int L_EcalSuperClusterSize
float L_HcalPhiWedgeConfidence
int L_HcalPhiWedgeConstituents
float L_HcalPhiWedgeEnergy
float L_HcalPhiWedgeToF
float T_EcalPhiWedgeConfidence
int T_EcalPhiWedgeConstituents
float T_EcalPhiWedgeEnergy
float T_EcalPhiWedgeToF
float T_EcalShowerShapesAngle
float T_EcalShowerShapesRoundness
float T_EcalSuperClusterEnergy
int T_EcalSuperClusterSize
float T_HcalPhiWedgeConfidence
int T_HcalPhiWedgeConstituents
float T_HcalPhiWedgeEnergy
float T_HcalPhiWedgeToF

Detailed Description

Definition at line 57 of file BeamHaloSummaryProducer.h.


Constructor & Destructor Documentation

BeamHaloSummaryProducer::BeamHaloSummaryProducer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 14 of file BeamHaloSummaryProducer.cc.

References edm::ParameterSet::getParameter().

{
  IT_CSCHaloData = iConfig.getParameter<edm::InputTag>("CSCHaloDataLabel");
  IT_EcalHaloData = iConfig.getParameter<edm::InputTag>("EcalHaloDataLabel");
  IT_HcalHaloData = iConfig.getParameter<edm::InputTag>("HcalHaloDataLabel");
  IT_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
  
  L_EcalPhiWedgeEnergy = (float) iConfig.getParameter<double>("l_EcalPhiWedgeEnergy");
  L_EcalPhiWedgeConstituents = iConfig.getParameter<int>("l_EcalPhiWedgeConstituents");
  L_EcalPhiWedgeToF = (float)iConfig.getParameter<double>("l_EcalPhiWedgeToF");
  L_EcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("l_EcalPhiWedgeConfidence");
  L_EcalShowerShapesRoundness = (float)iConfig.getParameter<double>("l_EcalShowerShapesRoundness");
  L_EcalShowerShapesAngle =(float) iConfig.getParameter<double>("l_EcalShowerShapesAngle");  
  L_EcalSuperClusterSize = (int) iConfig.getParameter<int>("l_EcalSuperClusterSize");
  L_EcalSuperClusterEnergy = (float) iConfig.getParameter<double>("l_EcalSuperClusterEnergy");

  T_EcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("t_EcalPhiWedgeEnergy");
  T_EcalPhiWedgeConstituents = iConfig.getParameter<int>("t_EcalPhiWedgeConstituents");
  T_EcalPhiWedgeToF = (float)iConfig.getParameter<double>("t_EcalPhiWedgeToF");
  T_EcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("t_EcalPhiWedgeConfidence");
  T_EcalShowerShapesRoundness = (float)iConfig.getParameter<double>("t_EcalShowerShapesRoundness");
  T_EcalShowerShapesAngle = (float)iConfig.getParameter<double>("t_EcalShowerShapesAngle");
  T_EcalSuperClusterSize = (int) iConfig.getParameter<int>("t_EcalSuperClusterSize");
  T_EcalSuperClusterEnergy = (float) iConfig.getParameter<double>("t_EcalSuperClusterEnergy");

  L_HcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("l_HcalPhiWedgeEnergy");
  L_HcalPhiWedgeConstituents = iConfig.getParameter<int>("l_HcalPhiWedgeConstituents");
  L_HcalPhiWedgeToF = (float)iConfig.getParameter<double>("l_HcalPhiWedgeToF");
  L_HcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("l_HcalPhiWedgeConfidence");
  
  T_HcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("t_HcalPhiWedgeEnergy");
  T_HcalPhiWedgeConstituents = iConfig.getParameter<int>("t_HcalPhiWedgeConstituents");
  T_HcalPhiWedgeToF = (float)iConfig.getParameter<double>("t_HcalPhiWedgeToF");
  T_HcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("t_HcalPhiWedgeConfidence");

  produces<BeamHaloSummary>();
}
BeamHaloSummaryProducer::~BeamHaloSummaryProducer ( )

Definition at line 246 of file BeamHaloSummaryProducer.cc.

{}

Member Function Documentation

void BeamHaloSummaryProducer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 242 of file BeamHaloSummaryProducer.cc.

{return;}
void BeamHaloSummaryProducer::beginRun ( edm::Run ,
const edm::EventSetup  
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 244 of file BeamHaloSummaryProducer.cc.

{return;}
void BeamHaloSummaryProducer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 243 of file BeamHaloSummaryProducer.cc.

{return;}
void BeamHaloSummaryProducer::endRun ( edm::Run ,
const edm::EventSetup  
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 245 of file BeamHaloSummaryProducer.cc.

{return;}
void BeamHaloSummaryProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 52 of file BeamHaloSummaryProducer.cc.

References abs, angle(), BeamHaloSummary_cfi::BeamHaloSummary, edm::Event::getByLabel(), reco::GlobalHaloData::GetMatchedEcalPhiWedges(), reco::GlobalHaloData::GetMatchedHcalPhiWedges(), reco::HcalHaloData::GetPhiWedges(), reco::CSCHaloData::GetSegmentsInBothEndcaps(), reco::EcalHaloData::GetShowerShapesAngle(), reco::EcalHaloData::GetShowerShapesRoundness(), reco::EcalHaloData::GetSuperClusters(), i, n, reco::CSCHaloData::NFlatHaloSegments(), reco::CSCHaloData::NOutOfTimeHits(), reco::CSCHaloData::NTracksSmalldT(), reco::CSCHaloData::NumberOfHaloTracks(), reco::CSCHaloData::NumberOfHaloTriggers(), reco::CSCHaloData::NumberOfOutOfTimeTriggers(), edm::Handle< T >::product(), edm::Event::put(), and edm::RefVector< C, T, F >::size().

{
  // BeamHaloSummary object 
  std::auto_ptr<BeamHaloSummary> TheBeamHaloSummary( new BeamHaloSummary() );

  // CSC Specific Halo Data
  Handle<CSCHaloData> TheCSCHaloData;
  iEvent.getByLabel(IT_CSCHaloData, TheCSCHaloData);

  const CSCHaloData CSCData = (*TheCSCHaloData.product() );

  //CSCLoose Id for 2011 
  if( CSCData.NumberOfHaloTriggers() ||
      CSCData.NumberOfHaloTracks()   ||
      (CSCData.NOutOfTimeHits() > 10 && CSCData.NFlatHaloSegments() > 2 ) ||
      CSCData.GetSegmentsInBothEndcaps() ||
      CSCData.NTracksSmalldT() )
    TheBeamHaloSummary->GetCSCHaloReport()[0] = 1;

  //CSCTight Id for 2011
  if( (CSCData.NumberOfHaloTriggers() && CSCData.NumberOfHaloTracks()) ||
      (CSCData.NOutOfTimeHits() > 10 && CSCData.NumberOfHaloTriggers() ) ||
      (CSCData.NOutOfTimeHits() > 10 && CSCData.NumberOfHaloTracks() ) ||
      CSCData.GetSegmentsInBothEndcaps() ||
      (CSCData.NTracksSmalldT() && CSCData.NumberOfHaloTracks() ) ||
      (CSCData.NFlatHaloSegments() > 3 && (CSCData.NumberOfHaloTriggers() || CSCData.NumberOfHaloTracks()) ))
    TheBeamHaloSummary->GetCSCHaloReport()[1] = 1;

  //CSCLoose Id from 2010
  if( CSCData.NumberOfHaloTriggers() || CSCData.NumberOfHaloTracks() || CSCData.NumberOfOutOfTimeTriggers() )
    TheBeamHaloSummary->GetCSCHaloReport()[2] = 1;

  //CSCTight Id from 2010
  if( (CSCData.NumberOfHaloTriggers() && CSCData.NumberOfHaloTracks()) ||
      (CSCData.NumberOfHaloTriggers() && CSCData.NumberOfOutOfTimeTriggers()) ||
      (CSCData.NumberOfHaloTracks() && CSCData.NumberOfOutOfTimeTriggers() ) )
    TheBeamHaloSummary->GetCSCHaloReport()[3] = 1;


  //Ecal Specific Halo Data
  Handle<EcalHaloData> TheEcalHaloData;
  iEvent.getByLabel(IT_EcalHaloData, TheEcalHaloData);
  
  const EcalHaloData EcalData = (*TheEcalHaloData.product() );
  
  bool EcalLooseId = false, EcalTightId = false;
  /*  COMMENTED OUT, NEEDS TO BE TUNED 
      const std::vector<PhiWedge> EcalWedges = EcalData.GetPhiWedges();
      for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge++ )
    {
      bool EcaliPhi = false;
      
      //Loose Id
      if(iWedge-> Energy() > L_EcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > L_EcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > L_EcalPhiWedgeConfidence)
        {
          EcalLooseId = true;
          EcaliPhi = true;
        }

      //Tight Id
      if( iWedge-> Energy() > T_EcalPhiWedgeEnergy  && iWedge->NumberOfConstituents() > T_EcalPhiWedgeConstituents && iWedge->ZDirectionConfidence() > L_EcalPhiWedgeConfidence )
        {
          EcalTightId = true;
          EcaliPhi = true;
        }

      for( unsigned int i = 0 ; i < TheBeamHaloSummary->GetEcaliPhiSuspects().size() ; i++ )
        {
          if( iWedge->iPhi() == TheBeamHaloSummary->GetEcaliPhiSuspects()[i] )
            {
              EcaliPhi = false;  // already stored this iPhi 
              continue;
            }
        }

      if( EcaliPhi ) 
        TheBeamHaloSummary->GetEcaliPhiSuspects().push_back( iWedge->iPhi() ) ;
        }
  */

  edm::ValueMap<float> vm_Angle = EcalData.GetShowerShapesAngle();
  edm::ValueMap<float> vm_Roundness = EcalData.GetShowerShapesRoundness();
  
  //Access selected SuperClusters
  for(unsigned int n = 0 ; n < EcalData.GetSuperClusters().size() ; n++ )
    {
      edm::Ref<SuperClusterCollection> cluster(EcalData.GetSuperClusters(), n );
      
      float angle = vm_Angle[cluster];
      float roundness = vm_Roundness[cluster];
      
      //Loose Selection
      if(  (angle > 0. && angle < L_EcalShowerShapesAngle ) && ( roundness > 0. && roundness < L_EcalShowerShapesRoundness ) )
        {
          if( cluster->energy() > L_EcalSuperClusterEnergy && cluster->size() > (unsigned int) L_EcalSuperClusterSize )
            EcalLooseId = true;
        }

      //Tight Selection 
      if(  (angle > 0. && angle < T_EcalShowerShapesAngle ) && ( roundness > 0. && roundness < T_EcalShowerShapesRoundness ) )
        {
          if( cluster->energy() > T_EcalSuperClusterEnergy && cluster->size() > (unsigned int)T_EcalSuperClusterSize )
            EcalTightId = true;
        }
    }
  
  if( EcalLooseId ) 
    TheBeamHaloSummary->GetEcalHaloReport()[0] = 1;
  if( EcalTightId ) 
    TheBeamHaloSummary->GetEcalHaloReport()[1] = 1;

  // Hcal Specific Halo Data
  Handle<HcalHaloData> TheHcalHaloData;
  iEvent.getByLabel(IT_HcalHaloData, TheHcalHaloData);
  const HcalHaloData HcalData = (*TheHcalHaloData.product() );
  const std::vector<PhiWedge> HcalWedges = HcalData.GetPhiWedges();
  bool HcalLooseId = false, HcalTightId = false;
  for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge++ )
    {
      bool HcaliPhi = false;
      //Loose Id
      if( iWedge-> Energy() > L_HcalPhiWedgeEnergy  && iWedge->NumberOfConstituents() > L_HcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > L_HcalPhiWedgeConfidence)
        {
          HcalLooseId = true;
          HcaliPhi = true;
        }

      //Tight Id
      if( iWedge-> Energy() > T_HcalPhiWedgeEnergy  && iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence)
        {
          HcalTightId = true;
          HcaliPhi = true;
        }
      
      for( unsigned int i = 0 ; i < TheBeamHaloSummary->GetHcaliPhiSuspects().size() ; i++ )
        {
          if( iWedge->iPhi() == TheBeamHaloSummary->GetHcaliPhiSuspects()[i] )
            {
              HcaliPhi = false;  // already stored this iPhi 
              continue;
            }
        }
      if( HcaliPhi ) 
        TheBeamHaloSummary->GetHcaliPhiSuspects().push_back( iWedge->iPhi() ) ;
    }
  
  if( HcalLooseId ) 
    TheBeamHaloSummary->GetHcalHaloReport()[0] = 1;
  if( HcalTightId ) 
    TheBeamHaloSummary->GetHcalHaloReport()[1] = 1;

  // Global Halo Data
  Handle<GlobalHaloData> TheGlobalHaloData;
  iEvent.getByLabel(IT_GlobalHaloData, TheGlobalHaloData);
  bool GlobalLooseId = false;
  bool GlobalTightId = false;
  const GlobalHaloData GlobalData = (*TheGlobalHaloData.product() );
  const std::vector<PhiWedge> MatchedHcalWedges = GlobalData.GetMatchedHcalPhiWedges();
  const std::vector<PhiWedge> MatchedEcalWedges = GlobalData.GetMatchedEcalPhiWedges();

  //Loose Id
  if( MatchedEcalWedges.size() || MatchedHcalWedges.size() ) 
    GlobalLooseId = true;

  //Tight Id
  for( std::vector<PhiWedge>::const_iterator iWedge = MatchedEcalWedges.begin() ; iWedge != MatchedEcalWedges.end(); iWedge ++ )
    {
      if( iWedge->NumberOfConstituents() > T_EcalPhiWedgeConstituents )
        GlobalTightId = true;
      if( std::abs(iWedge->ZDirectionConfidence() > T_EcalPhiWedgeConfidence) )
        GlobalTightId = true;
    }

  for( std::vector<PhiWedge>::const_iterator iWedge = MatchedHcalWedges.begin() ; iWedge != MatchedHcalWedges.end(); iWedge ++ )
    {
      if( iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents )
        GlobalTightId = true;
      if( std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence )
        GlobalTightId = true;
    }

  if( GlobalLooseId ) 
    TheBeamHaloSummary->GetGlobalHaloReport()[0] = 1;
  if( GlobalTightId )
    TheBeamHaloSummary->GetGlobalHaloReport()[1] = 1;
 
  iEvent.put(TheBeamHaloSummary);
  return;
}

Member Data Documentation

Definition at line 71 of file BeamHaloSummaryProducer.h.

Definition at line 72 of file BeamHaloSummaryProducer.h.

Definition at line 74 of file BeamHaloSummaryProducer.h.

Definition at line 73 of file BeamHaloSummaryProducer.h.

Definition at line 79 of file BeamHaloSummaryProducer.h.

Definition at line 77 of file BeamHaloSummaryProducer.h.

Definition at line 76 of file BeamHaloSummaryProducer.h.

Definition at line 78 of file BeamHaloSummaryProducer.h.

Definition at line 81 of file BeamHaloSummaryProducer.h.

Definition at line 80 of file BeamHaloSummaryProducer.h.

Definition at line 83 of file BeamHaloSummaryProducer.h.

Definition at line 82 of file BeamHaloSummaryProducer.h.

Definition at line 97 of file BeamHaloSummaryProducer.h.

Definition at line 95 of file BeamHaloSummaryProducer.h.

Definition at line 94 of file BeamHaloSummaryProducer.h.

Definition at line 96 of file BeamHaloSummaryProducer.h.

Definition at line 88 of file BeamHaloSummaryProducer.h.

Definition at line 86 of file BeamHaloSummaryProducer.h.

Definition at line 85 of file BeamHaloSummaryProducer.h.

Definition at line 87 of file BeamHaloSummaryProducer.h.

Definition at line 90 of file BeamHaloSummaryProducer.h.

Definition at line 89 of file BeamHaloSummaryProducer.h.

Definition at line 92 of file BeamHaloSummaryProducer.h.

Definition at line 91 of file BeamHaloSummaryProducer.h.

Definition at line 102 of file BeamHaloSummaryProducer.h.

Definition at line 100 of file BeamHaloSummaryProducer.h.

Definition at line 99 of file BeamHaloSummaryProducer.h.

Definition at line 101 of file BeamHaloSummaryProducer.h.