CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CaloTriggerAnalyzerOnDataTrees Class Reference

#include <CaloTriggerAnalyzerOnDataTrees.h>

Inheritance diagram for CaloTriggerAnalyzerOnDataTrees:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void matchSLHC (const reco::Candidate *recoCAND)

Private Attributes

TH1F * absEta
TH1F * dEta
TH1F * dPhi
TH1F * dPt
TH1F * dR
double DR_
edm::InputTag electrons_
TH1F * eta
TH1F * etaDenom
TH1F * etaNum
float highestGenPt
TH1F * highestPt
TH1F * highestPtGen
float highEta
float highPhi
float highPt
float highRecoPt
double iso_
TH1F * LHChighestPt
edm::InputTag LHCisosrc_
float LHCL1eta
float LHCL1phi
float LHCL1pt
TH1F * LHCpt
TH1F * LHCsecondPt
edm::InputTag LHCsrc_
double maxEta_
float numVertices
TH1F * pt
TH1F * ptDenom
TH1F * ptNum
float RecoEeta
float RecoEphi
float RecoEpt
TH1F * RECOpt
edm::InputTag ref_
TH1F * RPt
TProfile * RPtEta
TProfile * RPtEtaFull
TTree * RRTree
float secondGenPt
TH1F * secondPt
float secondPtf
TH1F * secondPtGen
float SLHCCentralTowerE
TH1F * SLHChighestPt
float SLHCL1eta
float SLHCL1phi
float SLHCL1pt
TH1F * SLHCpt
TH1F * SLHCsecondPt
edm::InputTag SLHCsrc_
double threshold_
edm::InputTag vertices_

Detailed Description

Definition at line 50 of file CaloTriggerAnalyzerOnDataTrees.h.


Constructor & Destructor Documentation

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

Definition at line 8 of file CaloTriggerAnalyzerOnDataTrees.cc.

References highestPt, LHChighestPt, LHCL1eta, LHCL1phi, LHCL1pt, LHCpt, LHCsecondPt, numVertices, pt, RecoEeta, RecoEphi, RecoEpt, RECOpt, RRTree, SLHChighestPt, SLHCL1eta, SLHCL1phi, SLHCL1pt, SLHCpt, and SLHCsecondPt.

                                                                                            :
  vertices_(iConfig.getParameter<edm::InputTag>("VertexCollection")),
  SLHCsrc_(iConfig.getParameter<edm::InputTag>("SLHCsrc")),
  LHCsrc_(iConfig.getParameter<edm::InputTag>("LHCsrc")),
  LHCisosrc_(iConfig.getParameter<edm::InputTag>("LHCisosrc")),
  electrons_(iConfig.getParameter<edm::InputTag>("electrons")),
  iso_(iConfig.getParameter<double>("iso")),
  DR_(iConfig.getParameter<double>("deltaR")),
  threshold_(iConfig.getParameter<double>("threshold"))
{
  //now do what ever initialization is needed

  edm::Service<TFileService> fs;

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

  RRTree->Branch("RecoEpt",&RecoEpt);
  RRTree->Branch("RecoEeta",&RecoEeta);
  RRTree->Branch("RecoEphi",&RecoEphi);

  RRTree->Branch("LHCL1pt",&LHCL1pt);
  RRTree->Branch("LHCL1eta",&LHCL1eta);
  RRTree->Branch("LHCL1phi",&LHCL1phi);

  RRTree->Branch("SLHCL1pt",&SLHCL1pt);
  RRTree->Branch("SLHCL1eta",&SLHCL1eta);
  RRTree->Branch("SLHCL1phi",&SLHCL1phi);
  RRTree->Branch("Vertices",&numVertices);

  RECOpt       = fs->make<TH1F>( "RECOpt"   , "RECOpt",  20  ,  0. , 100. );
  LHCpt       = fs->make<TH1F>( "LHCpt"   , "LHCpt",  20  ,  0. , 100. );
  SLHCpt       = fs->make<TH1F>( "SLHCpt" , "SLHCpt", 20  ,  0. , 100. );
  pt       = fs->make<TH1F>( "pt"      , "pt", 20  ,  0. , 100. );
  highestPt= fs->make<TH1F>( "highestPt"      , "highestPt", 50  ,  0. , 100. );


  SLHChighestPt= fs->make<TH1F>( "SLHChighestPt"      , "SLHChighestPt", 50  ,  0. , 100. );
  SLHCsecondPt = fs->make<TH1F>( "SLHCsecondHighestPt", "SLHCsecondHighestPt", 50  ,  0. , 100. );
  LHChighestPt= fs->make<TH1F>( "LHChighestPt"      , "LHChighestPt", 50  ,  0. , 100. );
  LHCsecondPt = fs->make<TH1F>( "LHCsecondHighestPt", "LHCsecondHighestPt", 50  ,  0. , 100. );

  
}
CaloTriggerAnalyzerOnDataTrees::~CaloTriggerAnalyzerOnDataTrees ( )

Definition at line 53 of file CaloTriggerAnalyzerOnDataTrees.cc.

{

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

}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 68 of file CaloTriggerAnalyzerOnDataTrees.cc.

References DR_, HI_PhotonSkim_cff::electrons, electrons_, edm::Event::getByLabel(), highEta, highPhi, highPt, highRecoPt, i, iso_, j, prof2calltree::l, LHCisosrc_, LHCL1eta, LHCL1phi, LHCL1pt, LHCpt, LHCsrc_, numVertices, RecoEeta, RecoEphi, RecoEpt, RECOpt, RRTree, secondPtf, SLHCL1eta, SLHCL1phi, SLHCL1pt, SLHCpt, SLHCsrc_, and vertices_.

{
  edm::Handle<edm::View<reco::Candidate> > LHCsrc;
  edm::Handle<edm::View<reco::Candidate> > SLHCsrc;
  edm::Handle<edm::View<reco::Candidate> > LHCisosrc;

  edm::Handle<reco::GsfElectronCollection> electrons;
  edm::Handle<reco::VertexCollection> vertices;
  iEvent.getByLabel(vertices_, vertices);
  
  bool gotLHCsrc = iEvent.getByLabel(LHCsrc_,LHCsrc);
  bool gotSLHCsrc = iEvent.getByLabel(SLHCsrc_,SLHCsrc);
  bool gotLHCisosrc = iEvent.getByLabel(LHCisosrc_,LHCisosrc);
  bool gotRecoE = iEvent.getByLabel(electrons_,electrons);

    
  
  if(gotRecoE) {
    highRecoPt=0;
    //    secondPtf=0;

    numVertices = vertices->size();
    printf("Vertices: %f \n",numVertices);
    for(unsigned int i=1; i<electrons->size();++i){
      RecoEpt = -50;      
      RecoEeta = -50;
      RecoEphi = -50;
      
      bool passID = false;
      
      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])
                  {printf("\n Electrons pass ID\n");
                    if((electrons->at(i).dr03TkSumPt()+electrons->at(i).dr03EcalRecHitSumEt()+electrons->at(i).dr03HcalDepth1TowerSumEt())/electrons->at(i).pt()<0.15)
                      {
                        passID=true;
                        printf("\n Electrons Isolated!\n");}
                  }
      
      
            if(passID == true){
              RECOpt->Fill(electrons->at(i).pt());
              RecoEpt=electrons->at(i).pt();
              
              RecoEeta=electrons->at(i).eta();
              RecoEphi=electrons->at(i).phi();
              //printf("RecoPt=%f\n",RecoEpt);
              //printf("RecoEta=%f\n",RecoEeta);
              //printf("RecoPhi=%f\n",RecoEphi);
              LHCL1pt=-20;
              LHCL1eta=-20;
              LHCL1phi=-20;
              SLHCL1pt=-20;
              SLHCL1eta=-20;
              SLHCL1phi=-20;
              
              highPt=0;
              highEta=0;
              highPhi=0;
          
              if(gotSLHCsrc) {
        
                secondPtf=0;
                for(edm::View<reco::Candidate>::const_iterator j = SLHCsrc->begin(); j!= SLHCsrc->end();++j)
                  {
                    if(ROOT::Math::VectorUtil::DeltaR(electrons->at(i).p4(),j->p4())<DR_) {
                      if (j->pt()>highPt){
                        secondPtf=highPt;
                        highPt = j->pt();
                        SLHCL1pt=j->pt();
                        SLHCL1eta=j->eta();
                        SLHCL1phi=j->phi();

                      } 
                      else if (j->pt()>secondPtf){
                        secondPtf=j->pt();
                      }
                    }
        
                    SLHCpt->Fill(j->pt());
                  }

              }

              LHCL1pt =0;          
              LHCL1eta = 0;
              LHCL1phi = 0;

              if(gotLHCisosrc||gotLHCsrc) {
                highPt = 0;
                highPhi= -30;
                highEta= -30;
                secondPtf=0;
                for(edm::View<reco::Candidate>::const_iterator l = LHCisosrc->begin(); l!= LHCisosrc->end();++l)
                  {
                    if(ROOT::Math::VectorUtil::DeltaR(electrons->at(i).p4(),l->p4())<DR_) {
                      if (l->pt()>highPt)
                        {
                          secondPtf = highPt;
                          highPt=l->pt();
                          LHCL1pt  = l->pt();
                          LHCL1eta = l->eta();
                          LHCL1phi = l->phi();
                          //printf("LHCiso_highpt=%f\n",highPt);
                        } 
                    }
                    //LHCpt->Fill(l->pt());
                    
                  }

                if(iso_==0){
                for(edm::View<reco::Candidate>::const_iterator j = LHCsrc->begin(); j!= LHCsrc->end();++j)
                  {
                    if(ROOT::Math::VectorUtil::DeltaR(electrons->at(i).p4(),j->p4())<DR_) {
                      if (j->pt()>highPt)
                        {
                          secondPtf = highPt;
                          highPt = j->pt();
                          LHCL1pt  = j->pt();
                          LHCL1eta = j->eta();
                          LHCL1phi = j->phi();
                          // printf("LHCnonIsohighpt=%f\n",highPt);
                        } 
                      else if (j->pt()>secondPtf){
                        secondPtf=j->pt();
                      }
                    }
                    LHCpt->Fill(j->pt());
                  }
                }
              }//gotLHCisosrc


              if(RecoEpt>0){
                //if(iso_==1){printf("Isolated Particles\n");}

                //printf("\n reco pt: %f \n reco eta: %f \n reco phi: %f \n LHC pt: %f \n LHC eta: %f \n LHC phi: %f \n SLHC pt: %f \n SLHC eta: %f \n SLHC phi: %f \n",RecoEpt,RecoEeta,RecoEphi,LHCL1pt,LHCL1eta,LHCL1phi,SLHCL1pt,SLHCL1eta,SLHCL1phi);
              }
              RRTree->Fill();         
            }//passID==true


            //printf("\n Filling!!\n");
    }//electron Cands

  }
  
  
  else
        RECOpt->Fill(0.0);
  
}
void CaloTriggerAnalyzerOnDataTrees::matchSLHC ( const reco::Candidate recoCAND) [private, virtual]

get reco particle and compare to SLHC L1 particles Find highest pt and best delta R matched

Definition at line 229 of file CaloTriggerAnalyzerOnDataTrees.cc.

                                                                            {
  // (To be completed)




}

Member Data Documentation

Definition at line 120 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 107 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 108 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 106 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 121 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 71 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 69 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 99 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 104 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 103 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 76 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 115 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 117 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 80 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 79 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 78 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 81 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 70 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 110 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 67 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 85 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 86 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 84 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 97 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 111 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 66 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 73 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 74 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 105 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 102 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 101 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 93 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 94 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 92 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 100 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 68 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 119 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 122 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 123 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 61 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 77 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 116 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 82 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 118 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 90 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 112 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 89 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 88 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 87 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 96 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze(), and CaloTriggerAnalyzerOnDataTrees().

Definition at line 113 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by CaloTriggerAnalyzerOnDataTrees().

Definition at line 65 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().

Definition at line 72 of file CaloTriggerAnalyzerOnDataTrees.h.

Definition at line 64 of file CaloTriggerAnalyzerOnDataTrees.h.

Referenced by analyze().