CMS 3D CMS Logo

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

L1CaloClusterAnalyzer Class Reference

#include <SLHCUpgradeSimulations/L1CaloClusterAnalyzer/src/L1CaloClusterAnalyzer.cc>

Inheritance diagram for L1CaloClusterAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

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

float CentralIso
float centralPt
float ClusterEnergy
float ClusterMatch
float ClusterPtMatch
float coneE
edm::InputTag electrons_
float RecoEeta
float RecoEphi
float RecoEpt
float RecoMatch
float RecoPt
int Ring1E
int Ring2E
int Ring3E
int Ring4E
TTree * RRTree
edm::InputTag src_
int TowerEnergy1
int TowerEnergy2
int TowerEnergy3
int TowerEnergy4
float TwoLeadTowerEnergy

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 40 of file L1CaloClusterAnalyzer.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file L1CaloClusterAnalyzer.cc.

References CentralIso, centralPt, ClusterEnergy, ClusterPtMatch, RecoMatch, RecoPt, Ring1E, Ring2E, Ring3E, Ring4E, RRTree, TowerEnergy1, TowerEnergy2, TowerEnergy3, and TowerEnergy4.

                                                                          :
  src_(iConfig.getParameter<edm::InputTag>("src")),
  electrons_(iConfig.getParameter<edm::InputTag>("electrons"))
{
   //now do what ever initialization is needed


  edm::Service<TFileService> fs;
  RRTree = fs->make<TTree>("RRTree","Tree containing RAW RECO info");

  //RRTree->Branch("coneEnergy",&coneE);
  RRTree->Branch("L1Pt",&centralPt);
  RRTree->Branch("RecoPt",&RecoPt);
  RRTree->Branch("RecoMatch",&RecoMatch);
  RRTree->Branch("ClusterPtMatch",&ClusterPtMatch);
  RRTree->Branch("CentralIso",&CentralIso);
  RRTree->Branch("TowerEnergy1",&TowerEnergy1);
  RRTree->Branch("TowerEnergy2",&TowerEnergy2);
  RRTree->Branch("TowerEnergy3",&TowerEnergy3);
  RRTree->Branch("TowerEnergy4",&TowerEnergy4);
  RRTree->Branch("Ring1E",&Ring1E);
  RRTree->Branch("Ring2E",&Ring2E);
  RRTree->Branch("Ring3E",&Ring3E);
  RRTree->Branch("Ring4E",&Ring4E);
  RRTree->Branch("ClusterEnergy",&ClusterEnergy);


}
L1CaloClusterAnalyzer::~L1CaloClusterAnalyzer ( )

Definition at line 55 of file L1CaloClusterAnalyzer.cc.

{

   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 69 of file L1CaloClusterAnalyzer.cc.

References CentralIso, centralPt, ClusterEnergy, ClusterPtMatch, coneE, HI_PhotonSkim_cff::electrons, electrons_, edm::Event::getByLabel(), i, j, RecoMatch, RecoPt, Ring1E, Ring2E, Ring3E, Ring4E, RRTree, src_, TowerEnergy1, TowerEnergy2, TowerEnergy3, and TowerEnergy4.

{
   using namespace edm;

   Handle<l1slhc::L1CaloClusterCollection> clusters;
   iEvent.getByLabel(src_,clusters);

  edm::Handle<reco::GsfElectronCollection> electrons;
   
   bool gotRecoE = iEvent.getByLabel(electrons_,electrons);   
   
   for(unsigned int j=0;j<clusters->size();++j)
     {
       if(clusters->at(j).isCentral() && clusters->at(j).isEGamma() ){
         coneE = clusters->at(j).isoEnergyEG();
         centralPt = clusters->at(j).p4().pt();

         CentralIso = (float) (clusters->at(j).LeadTowerE())/(clusters->at(j).E());

         TowerEnergy1 = clusters->at(j).LeadTowerE();
         TowerEnergy2 = clusters->at(j).SecondTowerE();
         TowerEnergy3 = clusters->at(j).ThirdTowerE();
         TowerEnergy4 = clusters->at(j).FourthTowerE();
         Ring1E = clusters->at(j).Ring1E();
         Ring2E = clusters->at(j).Ring2E();
         Ring3E = clusters->at(j).Ring3E();
         Ring4E = clusters->at(j).Ring4E();

         ClusterEnergy = clusters->at(j).E();

         //printf("CentralIso: %f\n",CentralIso);

         //      printf("Number of Clusters = %i \n",clusters->at(j).isoClusters());

         bool passID = false;
         RecoPt = 0;

         if(gotRecoE)

           for( unsigned int i =1; i<electrons->size() && !passID; ++i){
             if((electrons->at(i).dr04TkSumPt() + electrons->at(i).dr04EcalRecHitSumEt() + electrons->at(i).dr04HcalTowerSumEt())/(electrons->at(i).pt())<0.15)//
               if(electrons->at(i).isEB()||electrons->at(i).isEE())
                 if(fabs(electrons->at(i).sigmaIetaIeta())<0.025)  //sigmaEtaEta_[type])
                   if(fabs(electrons->at(i).deltaEtaSuperClusterTrackAtVtx())<0.02)  //deltaEta_[type])
                     if(fabs(electrons->at(i).deltaPhiSuperClusterTrackAtVtx())<0.1)//deltaPhi_[type])
                       if(fabs(electrons->at(i).hcalOverEcal())<0.01)    //hoE_[type])
                         if((electrons->at(i).dr03TkSumPt()+electrons->at(i).dr03EcalRecHitSumEt()+electrons->at(i).dr03HcalDepth1TowerSumEt())/electrons->at(i).pt()<0.15)
                           if(ROOT::Math::VectorUtil::DeltaR(clusters->at(j).p4(),electrons->at(i).p4())<0.3) {
                             passID=true;
                             RecoPt = electrons->at(i).pt();
                           }
           }

           if(passID){
             ClusterPtMatch = fabs((clusters->at(j).p4().pt()-RecoPt)/RecoPt);
             RecoMatch = 1;
           }
           else{
             ClusterPtMatch = -1;
             RecoMatch = -1;
           }

           RRTree->Fill();
       }
     }

}
void L1CaloClusterAnalyzer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 140 of file L1CaloClusterAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file L1CaloClusterAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file L1CaloClusterAnalyzer.cc.

{
}
void L1CaloClusterAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file L1CaloClusterAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file L1CaloClusterAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file L1CaloClusterAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 175 of file L1CaloClusterAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and 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 88 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 67 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 81 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 70 of file L1CaloClusterAnalyzer.h.

Definition at line 83 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 66 of file L1CaloClusterAnalyzer.h.

Referenced by analyze().

Definition at line 65 of file L1CaloClusterAnalyzer.h.

Referenced by analyze().

Definition at line 86 of file L1CaloClusterAnalyzer.h.

Definition at line 87 of file L1CaloClusterAnalyzer.h.

Definition at line 85 of file L1CaloClusterAnalyzer.h.

Definition at line 69 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 68 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 76 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 77 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 78 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 79 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 62 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 64 of file L1CaloClusterAnalyzer.h.

Referenced by analyze().

Definition at line 72 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 73 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 74 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 75 of file L1CaloClusterAnalyzer.h.

Referenced by analyze(), and L1CaloClusterAnalyzer().

Definition at line 71 of file L1CaloClusterAnalyzer.h.