CMS 3D CMS Logo

EgHLTOffHelper Class Reference

#include <DQMOffline/Trigger/interface/EgHLTOffHelper.h>

List of all members.

Public Member Functions

 EgHLTOffHelper ()
void fillEgHLTOffEleVec (edm::Handle< reco::GsfElectronCollection > gsfElectrons, std::vector< EgHLTOffEle > &egHLTOffEles)
const reco::ClusterShapegetClusterShape (const reco::GsfElectron *electron)
void getHandles (const edm::Event &event, const edm::EventSetup &setup)
const std::vector
< reco::CaloJet > * 
jets () const
void setup (const edm::ParameterSet &conf)
 ~EgHLTOffHelper ()

Private Attributes

const CaloGeometrycaloGeom_
edm::InputTag caloJetsTag_
const CaloTopologycaloTopology_
EgHLTOffEleSel cuts_
const EcalRecHitCollectionebRecHits_
edm::InputTag ecalRecHitsEBTag_
edm::InputTag ecalRecHitsEETag_
const EcalRecHitCollectioneeRecHits_
const std::vector
< reco::CaloJet > * 
jets_
EgHLTOffEleSel probeCuts_
EgHLTOffEleSel tagCuts_


Detailed Description

Definition at line 33 of file EgHLTOffHelper.h.


Constructor & Destructor Documentation

EgHLTOffHelper::EgHLTOffHelper (  )  [inline]

Definition at line 59 of file EgHLTOffHelper.h.

00059 :tagCuts_(),probeCuts_(),cuts_(){}

EgHLTOffHelper::~EgHLTOffHelper (  )  [inline]

Definition at line 60 of file EgHLTOffHelper.h.

00060 {}


Member Function Documentation

void EgHLTOffHelper::fillEgHLTOffEleVec ( edm::Handle< reco::GsfElectronCollection gsfElectrons,
std::vector< EgHLTOffEle > &  egHLTOffEles 
)

Definition at line 35 of file EgHLTOffHelper.cc.

References caloGeom_, caloTopology_, EcalClusterTools::covariances(), cuts_, ebRecHits_, EcalBarrel, eeRecHits_, EgHLTOffEle::IsolData::em, EgHLTOffEleSel::getCutCode(), reco::BasicCluster::getHitsByDetId(), EgHLTOffEle::IsolData::had, EgHLTOffEle::IsolData::nrTrks, probeCuts_, EgHLTOffEle::IsolData::ptTrks, EgHLTOffEle::setCutCode(), EgHLTOffEle::setProbeCutCode(), EgHLTOffEle::setTagCutCode(), EgHLTOffEle::ClusShapeData::sigmaEtaEta, EgHLTOffEle::ClusShapeData::sigmaPhiPhi, funct::sqrt(), DetId::subdetId(), and tagCuts_.

Referenced by EgammaHLTOffline::analyze().

00036 {
00037   egHLTOffEles.clear();
00038   egHLTOffEles.reserve(gsfElectrons->size());
00039   for(reco::PixelMatchGsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin(); gsfIter!=gsfElectrons->end();++gsfIter){
00040     //for now use dummy isolation data
00041     EgHLTOffEle::IsolData isolData;
00042     isolData.nrTrks=1;
00043     isolData.ptTrks=1.;
00044     isolData.em= 0.42;
00045     isolData.had=0.42;
00046     
00047     //get cluster shape and we're done construction 
00048     //edm::LogInfo("EgHLTOffHelper") << "getting clus shape "<<std::endl;
00049     //const reco::ClusterShape* clusShape = getClusterShape(&*gsfIter);
00050     //edm::LogInfo("EgHLTOffHelper") << "clus shape "<<clusShape<<std::endl;
00051     EgHLTOffEle::ClusShapeData clusShapeData;
00052     clusShapeData.sigmaEtaEta=999.;
00053     //    clusShapeData.sigmaIEtaIEta=999.;
00054     //clusShapeData.e2x5MaxOver5x5=-1.; //not defined in endcap yet
00055     //need to figure out if its in the barrel or endcap
00056     //classification variable is unrelyable so get the first hit of the cluster and figure out if its barrel or endcap
00057     const reco::BasicCluster& seedClus = *(gsfIter->superCluster()->seed());
00058     const DetId seedDetId = seedClus.getHitsByDetId()[0]; //note this may not actually be the seed hit but it doesnt matter because all hits will be in the barrel OR endcap (it is also incredably inefficient as it getHitsByDetId passes the vector by value not reference
00059     if(seedDetId.subdetId()==EcalBarrel){
00060       std::vector<float> stdCov = EcalClusterTools::covariances(seedClus,ebRecHits_,caloTopology_,caloGeom_);
00061       // std::vector<float> crysCov = EcalClusterTools::crystalCovariances(seedClus,ebRecHits_,caloTopology_,caloGeom_);
00062       clusShapeData.sigmaEtaEta = sqrt(stdCov[0]);
00063       //  clusShapeData.sigmaIEtaIEta =  sqrt(crysCov[0]);
00064       clusShapeData.sigmaPhiPhi = sqrt(stdCov[2]);
00065       //clusShapeData.sigmaIPhiIPhi =  sqrt(crysCov[2]);
00066        
00067       
00068      
00069     }else{
00070      std::vector<float> stdCov = EcalClusterTools::covariances(seedClus,eeRecHits_,caloTopology_,caloGeom_);
00071      clusShapeData.sigmaEtaEta = sqrt(stdCov[0]);  
00072      clusShapeData.sigmaPhiPhi = sqrt(stdCov[2]);
00073      
00074     }
00075 
00076     egHLTOffEles.push_back(EgHLTOffEle(*gsfIter,clusShapeData,isolData));
00077     
00078     //now we would like to set the cut results
00079     EgHLTOffEle& ele =  egHLTOffEles.back();
00080     ele.setTagCutCode(tagCuts_.getCutCode(ele));
00081     ele.setProbeCutCode(probeCuts_.getCutCode(ele));
00082     ele.setCutCode(cuts_.getCutCode(ele));
00083       
00084 
00085   }//end loop over gsf electron collection
00086 
00087 }

const reco::ClusterShape* EgHLTOffHelper::getClusterShape ( const reco::GsfElectron electron  ) 

void EgHLTOffHelper::getHandles ( const edm::Event event,
const edm::EventSetup setup 
)

Definition at line 89 of file EgHLTOffHelper.cc.

References caloGeom_, caloJetsTag_, caloTopology_, ebRecHits_, ecalRecHitsEBTag_, ecalRecHitsEETag_, eeRecHits_, edm::EventSetup::get(), jets_, edm::ESHandle< T >::product(), and edm::Handle< T >::product().

Referenced by EgammaHLTOffline::analyze().

00090 {
00091   // try{
00092 //     event.getByLabel(barrelShapeAssocProd_, clusterShapeHandleBarrel_) ;
00093 //   }catch(...){} //the worlds most pointless try, catch pair, damn you CMSSW framework,  DAMN you
00094   
00095 //   try{
00096 //     event.getByLabel(endcapShapeAssocProd_, clusterShapeHandleEndcap_) ;
00097 //   }catch(...){}
00098 
00099 //   if (!clusterShapeHandleBarrel_.isValid()) {
00100 //     edm::LogError ("EgHLTOffHelper") << "Can't get ECAL barrel Cluster Shape Collection" ; 
00101 //   }
00102 //   if (!clusterShapeHandleEndcap_.isValid()) {
00103 //     edm::LogError ("EgHLTOffHelper") << "Can't get ECAL endcap Cluster Shape Collection" ; 
00104 //   }
00105 
00106   //yay, now in 2_1 we dont have to program by exception
00107   edm::Handle<EcalRecHitCollection> ecalBarrelRecHitsHandle;
00108   event.getByLabel(ecalRecHitsEBTag_,ecalBarrelRecHitsHandle);
00109   ebRecHits_ = ecalBarrelRecHitsHandle.product();
00110 
00111   edm::Handle<EcalRecHitCollection> ecalEndcapRecHitsHandle;
00112   event.getByLabel(ecalRecHitsEETag_,ecalEndcapRecHitsHandle);
00113   eeRecHits_ = ecalEndcapRecHitsHandle.product();
00114 
00115   edm::Handle<reco::CaloJetCollection> caloJetsHandle;
00116   event.getByLabel(caloJetsTag_,caloJetsHandle);
00117   jets_ = caloJetsHandle.product();
00118   
00119   edm::ESHandle<CaloGeometry> geomHandle;
00120   setup.get<CaloGeometryRecord>().get(geomHandle);
00121   caloGeom_ = geomHandle.product();
00122 
00123   edm::ESHandle<CaloTopology> topologyHandle;
00124   setup.get<CaloTopologyRecord>().get(topologyHandle);
00125   caloTopology_ = topologyHandle.product();
00126 }

const std::vector<reco::CaloJet>* EgHLTOffHelper::jets (  )  const [inline]

Definition at line 66 of file EgHLTOffHelper.h.

References jets_.

Referenced by EgammaHLTOffline::analyze().

00066 {return jets_;}

void EgHLTOffHelper::setup ( const edm::ParameterSet conf  ) 

Definition at line 15 of file EgHLTOffHelper.cc.

References caloJetsTag_, cuts_, ecalRecHitsEBTag_, ecalRecHitsEETag_, edm::ParameterSet::getParameter(), probeCuts_, EgHLTOffEleSel::setHighNrgy(), EgHLTOffEleSel::setPreSel(), and tagCuts_.

Referenced by EgammaHLTOffline::EgammaHLTOffline().

00016 {
00017   // barrelShapeAssocProd_ = conf.getParameter<edm::InputTag>("barrelClusterShapeAssociation");
00018   //barrelShapeAssocProd_ = conf.getParameter<edm::InputTag>("barrelClusterShapeAssociation");
00019   //endcapShapeAssocProd_ = conf.getParameter<edm::InputTag>("endcapClusterShapeAssociation");
00020 
00021 
00022   ecalRecHitsEBTag_ = conf.getParameter<edm::InputTag>("BarrelRecHitCollection");
00023   ecalRecHitsEETag_ = conf.getParameter<edm::InputTag>("EndcapRecHitCollection");
00024   
00025   caloJetsTag_ = conf.getParameter<edm::InputTag>("CaloJetCollection");
00026  
00027 
00028   cuts_.setHighNrgy();
00029   tagCuts_.setHighNrgy();
00030   probeCuts_.setPreSel();
00031 }


Member Data Documentation

const CaloGeometry* EgHLTOffHelper::caloGeom_ [private]

Definition at line 51 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and getHandles().

edm::InputTag EgHLTOffHelper::caloJetsTag_ [private]

Definition at line 50 of file EgHLTOffHelper.h.

Referenced by getHandles(), and setup().

const CaloTopology* EgHLTOffHelper::caloTopology_ [private]

Definition at line 52 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and getHandles().

EgHLTOffEleSel EgHLTOffHelper::cuts_ [private]

Definition at line 38 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and setup().

const EcalRecHitCollection* EgHLTOffHelper::ebRecHits_ [private]

Definition at line 53 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and getHandles().

edm::InputTag EgHLTOffHelper::ecalRecHitsEBTag_ [private]

Definition at line 48 of file EgHLTOffHelper.h.

Referenced by getHandles(), and setup().

edm::InputTag EgHLTOffHelper::ecalRecHitsEETag_ [private]

Definition at line 49 of file EgHLTOffHelper.h.

Referenced by getHandles(), and setup().

const EcalRecHitCollection* EgHLTOffHelper::eeRecHits_ [private]

Definition at line 54 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and getHandles().

const std::vector<reco::CaloJet>* EgHLTOffHelper::jets_ [private]

Definition at line 55 of file EgHLTOffHelper.h.

Referenced by getHandles(), and jets().

EgHLTOffEleSel EgHLTOffHelper::probeCuts_ [private]

Definition at line 37 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and setup().

EgHLTOffEleSel EgHLTOffHelper::tagCuts_ [private]

Definition at line 36 of file EgHLTOffHelper.h.

Referenced by fillEgHLTOffEleVec(), and setup().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:12 2009 for CMSSW by  doxygen 1.5.4