CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

EcalZmassTask Class Reference

Inheritance diagram for EcalZmassTask:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
virtual void endJob ()
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void endRun (edm::Run const &, edm::EventSetup const &)

Private Attributes

MonitorElementh_95_ee_invMass_BB
MonitorElementh_95_ee_invMass_EB
MonitorElementh_95_ee_invMass_EE
MonitorElementh_e1_et
MonitorElementh_e1_eta
MonitorElementh_e1_phi
MonitorElementh_e2_et
MonitorElementh_e2_eta
MonitorElementh_e2_phi
MonitorElementh_ee_invMass
MonitorElementh_ee_invMass_BB
MonitorElementh_ee_invMass_EB
MonitorElementh_ee_invMass_EE
const std::string prefixME_
const edm::InputTag theElectronCollectionLabel

Detailed Description

Definition at line 52 of file EcalZmassTask.cc.


Constructor & Destructor Documentation

EcalZmassTask::EcalZmassTask ( const edm::ParameterSet parameters) [explicit]

Definition at line 90 of file EcalZmassTask.cc.

                                                                :
  theElectronCollectionLabel(parameters.getParameter < edm::InputTag > ("electronCollection")),
  prefixME_(parameters.getUntrackedParameter < std::string > ("prefixME", ""))
{
}
EcalZmassTask::~EcalZmassTask ( )

Definition at line 96 of file EcalZmassTask.cc.

{
}

Member Function Documentation

void EcalZmassTask::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 102 of file EcalZmassTask.cc.

References MonitorElement::Fill(), edm::Event::getByLabel(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, and theElectronCollectionLabel.

{
  using namespace edm;
  Handle < reco::GsfElectronCollection > electronCollection;
  iEvent.getByLabel (theElectronCollectionLabel, electronCollection);
  if (!electronCollection.isValid ()) return;

  //get GSF Tracks
  Handle < reco::GsfTrackCollection > gsftracks_h;
  iEvent.getByLabel ("electronGsfTracks", gsftracks_h);

  bool isIsolatedBarrel;
  bool isIDBarrel;
  bool isConvertedBarrel;
  bool isIsolatedEndcap;
  bool isIDEndcap;
  bool isConvertedEndcap;

  int elIsAccepted=0;
  int elIsAcceptedEB=0;
  int elIsAcceptedEE=0;

  std::vector<TLorentzVector> LV;

  for (reco::GsfElectronCollection::const_iterator recoElectron =
         electronCollection->begin ();
       recoElectron != electronCollection->end (); recoElectron++)
    {

      if (recoElectron->et () <= 25)
        continue;

      // Define Isolation variables
      double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
      double IsoEcal =
        (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
      double IsoHcal =
        (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
      double HE = (recoElectron->hcalOverEcal ());

      //Define ID variables

      float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
      float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
      float sigmaIeIe = recoElectron->sigmaIetaIeta ();

      //Define Conversion Rejection Variables

      float Dcot = recoElectron->convDcot ();
      float Dist = recoElectron->convDist ();
      int NumberOfExpectedInnerHits =
        recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
        numberOfHits ();

      //quality flags

      isIsolatedBarrel = false;
      isIDBarrel = false;
      isConvertedBarrel = false;
      isIsolatedEndcap = false;
      isIDEndcap = false;
      isConvertedEndcap = false;


      /***** Barrel WP80 Cuts *****/

      if (fabs (recoElectron->eta ()) <= 1.4442)
        {

          /* Isolation */
          if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
            {
              isIsolatedBarrel = true;
            }

          /* Identification */
          if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
              && sigmaIeIe < 0.01 && HE < 0.04)
            {
              isIDBarrel = true;
            }

          /* Conversion Rejection */
          if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
              && NumberOfExpectedInnerHits <= 1.0)
            {
              isConvertedBarrel = true;
            }
        }

      if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
        elIsAccepted++;
        elIsAcceptedEB++;
        TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
        LV.push_back(b_e2);
      }

      /***** Endcap WP80 Cuts *****/

      if (fabs (recoElectron->eta ()) >= 1.5660
          && fabs (recoElectron->eta ()) <= 2.5000)
        {

          /* Isolation */
          if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
            {
              isIsolatedEndcap = true;
            }

          /* Identification */
          if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
              && sigmaIeIe < 0.031 && HE < 0.15)
            {
              isIDEndcap = true;
            }

          /* Conversion Rejection */
          if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
              && NumberOfExpectedInnerHits <= 1.0)
            {
              isConvertedEndcap = true;
            }
        }
      if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
        elIsAccepted++;
        elIsAcceptedEE++;
        TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
        LV.push_back(e_e2);
      }

    }

  // Calculate the Z invariant masses

  if (elIsAccepted>1){
    double e_ee_invMass=0; 
    if (elIsAccepted>2) edm::LogWarning("EcalZmassTask") << "WARNING: In this events we have more than two electrons accpeted!!!!!!!";
    if (LV.size()==2){
      TLorentzVector e_pair = LV[0] + LV[1];
      e_ee_invMass = e_pair.M ();
    }  
                      
    if (elIsAcceptedEB==2){
      h_ee_invMass_BB->Fill(e_ee_invMass);
    }
    if (elIsAcceptedEE==2){
      h_ee_invMass_EE->Fill(e_ee_invMass);
    }
    if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
      h_ee_invMass_EB->Fill(e_ee_invMass);
    }
                      
    LV.clear();
                                  
  }
}
void EcalZmassTask::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 262 of file EcalZmassTask.cc.

References DQMStore::book1D(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, LogTrace, cppFunctionSkipper::operator, prefixME_, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

{

  DQMStore *theDbe;
  std::string logTraceName("EcalZmassTask");

  h_ee_invMass_EB = 0;
  h_ee_invMass_EE = 0;
  h_ee_invMass_BB = 0;

  LogTrace (logTraceName) << "Parameters initialization";
  theDbe = edm::Service < DQMStore > ().operator-> ();

  if (theDbe != 0)
    {
      theDbe->setCurrentFolder (prefixME_ + "/Zmass");  // Use folder with name of PAG


      h_ee_invMass_EB =
        theDbe->book1D ("Z peak - WP80 EB-EE",
                        "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
      h_ee_invMass_EE =
        theDbe->book1D ("Z peak - WP80 EE-EE",
                        "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
      h_ee_invMass_BB =
        theDbe->book1D ("Z peak - WP80 EB-EB",
                        "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
    }
}
void EcalZmassTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 313 of file EcalZmassTask.cc.

{
}
void EcalZmassTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 300 of file EcalZmassTask.cc.

{

}
void EcalZmassTask::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 294 of file EcalZmassTask.cc.

{
}
void EcalZmassTask::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 320 of file EcalZmassTask.cc.

{
}
void EcalZmassTask::endRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 307 of file EcalZmassTask.cc.

{
}
void EcalZmassTask::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDAnalyzer.

Definition at line 327 of file EcalZmassTask.cc.

References edm::ParameterSetDescription::setUnknown().

{
  //The following says we do not know what parameters are allowed so do no validation
  // Please change this to state exactly what you do use, even if it is no parameters
  edm::ParameterSetDescription desc;
  desc.setUnknown ();
  descriptions.addDefault (desc);
}

Member Data Documentation

Definition at line 86 of file EcalZmassTask.cc.

Definition at line 84 of file EcalZmassTask.cc.

Definition at line 85 of file EcalZmassTask.cc.

Definition at line 78 of file EcalZmassTask.cc.

Definition at line 80 of file EcalZmassTask.cc.

Definition at line 82 of file EcalZmassTask.cc.

Definition at line 79 of file EcalZmassTask.cc.

Definition at line 81 of file EcalZmassTask.cc.

Definition at line 83 of file EcalZmassTask.cc.

Definition at line 77 of file EcalZmassTask.cc.

Definition at line 76 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

Definition at line 74 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

Definition at line 75 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

const std::string EcalZmassTask::prefixME_ [private]

Definition at line 72 of file EcalZmassTask.cc.

Referenced by beginJob().

Definition at line 70 of file EcalZmassTask.cc.

Referenced by analyze().