CMS 3D CMS Logo

EcalIsolatedParticleCandidateProducer Class Reference

Description: <one line="" class="" summary>="">. More...

#include <Calibration/EcalIsolatedParticleCandidateProducer/src/EcalIsolatedParticleCandidateProducer.cc>

Inheritance diagram for EcalIsolatedParticleCandidateProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

edm::InputTag EBrecHitCollectionLabel_
edm::InputTag EErecHitCollectionLabel_
const CaloGeometrygeo
double hitCountEthr_
double hitEthr_
edm::InputTag hltGTseedlabel_
double InConeSize_
edm::InputTag l1tausource_
double OutConeSize_


Detailed Description

Description: <one line="" class="" summary>="">.

Implementation: <Notes on="" implementation>="">

Definition at line 19 of file EcalIsolatedParticleCandidateProducer.h.


Constructor & Destructor Documentation

EcalIsolatedParticleCandidateProducer::EcalIsolatedParticleCandidateProducer ( const edm::ParameterSet conf  )  [explicit]

Definition at line 42 of file EcalIsolatedParticleCandidateProducer.cc.

References EBrecHitCollectionLabel_, EErecHitCollectionLabel_, edm::ParameterSet::getParameter(), hitCountEthr_, hitEthr_, hltGTseedlabel_, InConeSize_, l1tausource_, and OutConeSize_.

00043 {
00044   InConeSize_ = conf.getParameter<double>("EcalInnerConeSize");
00045   OutConeSize_= conf.getParameter<double>("EcalOuterConeSize");
00046   hitCountEthr_= conf.getParameter<double>("ECHitCountEnergyThreshold");
00047   hitEthr_=conf.getParameter<double>("ECHitEnergyThreshold");
00048   l1tausource_=conf.getParameter<edm::InputTag>("L1eTauJetsSource");
00049   hltGTseedlabel_=conf.getParameter<edm::InputTag>("L1GTSeedLabel");
00050   EBrecHitCollectionLabel_=conf.getParameter<edm::InputTag>("EBrecHitCollectionLabel");
00051   EErecHitCollectionLabel_=conf.getParameter<edm::InputTag>("EErecHitCollectionLabel");
00052 
00053    //register your products
00054   produces< reco::IsolatedPixelTrackCandidateCollection >();
00055 
00056 }

EcalIsolatedParticleCandidateProducer::~EcalIsolatedParticleCandidateProducer (  ) 

Definition at line 59 of file EcalIsolatedParticleCandidateProducer.cc.

00060 {
00061  
00062    // do anything here that needs to be done at desctruction time
00063    // (e.g. close files, deallocate resources etc.)
00064 
00065 }


Member Function Documentation

void EcalIsolatedParticleCandidateProducer::beginJob ( const edm::EventSetup  )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 223 of file EcalIsolatedParticleCandidateProducer.cc.

00224 {
00225 }

void EcalIsolatedParticleCandidateProducer::endJob ( void   )  [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 229 of file EcalIsolatedParticleCandidateProducer.cc.

00229                                               {
00230 }

void EcalIsolatedParticleCandidateProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 74 of file EcalIsolatedParticleCandidateProducer.cc.

References EBrecHitCollectionLabel_, EErecHitCollectionLabel_, relval_parameters_module::energy, PV3DBase< T, PVType, FrameType >::eta(), geo, edm::EventSetup::get(), edm::Event::getByLabel(), CaloGeometry::getPosition(), hitCountEthr_, hitEthr_, hltGTseedlabel_, InConeSize_, l1tausource_, p, PV3DBase< T, PVType, FrameType >::phi(), funct::pow(), edm::Event::put(), dttmaxenums::R, funct::sqrt(), trigger::TriggerL1CenJet, and trigger::TriggerL1TauJet.

00075 {
00076  
00077   using namespace edm;
00078 
00079 //  std::cout<<"get tau"<<std::endl;
00080 
00081   Handle<l1extra::L1JetParticleCollection> l1Taus;
00082   iEvent.getByLabel(l1tausource_,l1Taus);
00083 
00084 //  std::cout<<"get geom"<<std::endl;
00085 
00086   ESHandle<CaloGeometry> pG;
00087   iSetup.get<CaloGeometryRecord>().get(pG);
00088   geo = pG.product();
00089 
00090 //  std::cout<<" get ec rechit"<<std::endl;
00091 
00092   Handle<EcalRecHitCollection> ecalEB;
00093   iEvent.getByLabel(EBrecHitCollectionLabel_,ecalEB);
00094 
00095   Handle<EcalRecHitCollection> ecalEE;
00096   iEvent.getByLabel(EErecHitCollectionLabel_,ecalEE);
00097 
00098 //  std::cout<<"get l1 trig obj"<<std::endl;
00099 
00100   Handle<trigger::TriggerFilterObjectWithRefs> l1trigobj;
00101   iEvent.getByLabel(hltGTseedlabel_, l1trigobj);
00102 
00103   std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
00104   std::vector< edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
00105 
00106   l1trigobj->getObjects(trigger::TriggerL1TauJet, l1tauobjref);
00107   l1trigobj->getObjects(trigger::TriggerL1CenJet, l1jetobjref);
00108    
00109   double ptTriggered=-10;
00110   double etaTriggered=-100;
00111   double phiTriggered=-100;
00112 
00113 //  std::cout<<"find highest pT triggered obj"<<std::endl;
00114 
00115   for (unsigned int p=0; p<l1tauobjref.size(); p++)
00116         {
00117         if (l1tauobjref[p]->pt()>ptTriggered)
00118                 {
00119                 ptTriggered=l1tauobjref[p]->pt();
00120                 phiTriggered=l1tauobjref[p]->phi();
00121                 etaTriggered=l1tauobjref[p]->eta();
00122                 }
00123         }
00124   for (unsigned int p=0; p<l1jetobjref.size(); p++)
00125         {
00126         if (l1jetobjref[p]->pt()>ptTriggered)
00127                 {
00128                 ptTriggered=l1jetobjref[p]->pt();
00129                 phiTriggered=l1jetobjref[p]->phi();
00130                 etaTriggered=l1jetobjref[p]->eta();
00131                 }
00132         }
00133 
00134   reco::IsolatedPixelTrackCandidateCollection * iptcCollection=new reco::IsolatedPixelTrackCandidateCollection;
00135 
00136 //  std::cout<<"loop over l1taus"<<std::endl;
00137 
00138   for (l1extra::L1JetParticleCollection::const_iterator tit=l1Taus->begin(); tit!=l1Taus->end(); tit++)
00139         {
00140         double dphi=fabs(tit->phi()-phiTriggered);
00141         if (dphi>3.1415926535) dphi=2*3.1415926535-dphi;
00142         double Rseed=sqrt(pow(etaTriggered-tit->eta(),2)+dphi*dphi);
00143         if (Rseed<1.2) continue;
00144         int nhitOut=0;
00145         int nhitIn=0;
00146         double OutEnergy=0;
00147         double InEnergy=0;
00148 //      std::cout<<" loops over rechits"<<std::endl;
00149         for (EcalRecHitCollection::const_iterator eItr=ecalEB->begin(); eItr!=ecalEB->end(); eItr++)
00150                 {
00151                 double phiD, R;
00152                 GlobalPoint pos = geo->getPosition(eItr->detid());
00153                 double phihit = pos.phi();
00154                 double etahit = pos.eta();
00155                 phiD=fabs(phihit-tit->phi());
00156                 if (phiD>3.1415926535) phiD=2*3.1415926535-phiD;
00157                 R=sqrt(pow(etahit-tit->eta(),2)+phiD*phiD);
00158                 
00159                 if (R<OutConeSize_&&R>InConeSize_&&eItr->energy()>hitCountEthr_)
00160                         {
00161                         nhitOut++;
00162                         }
00163                 if (R<InConeSize_&&eItr->energy()>hitCountEthr_)
00164                         {
00165                         nhitIn++;
00166                         }
00167 
00168                 if (R<OutConeSize_&&R>InConeSize_&&eItr->energy()>hitEthr_)
00169                         {
00170                         OutEnergy+=eItr->energy();
00171                         }
00172                 if (R<InConeSize_&&eItr->energy()>hitEthr_)
00173                         {
00174                         InEnergy+=eItr->energy();
00175                         }
00176 
00177                 }
00178 
00179         for (EcalRecHitCollection::const_iterator eItr=ecalEE->begin(); eItr!=ecalEE->end(); eItr++)
00180                 {
00181                 double phiD, R;
00182                 GlobalPoint pos = geo->getPosition(eItr->detid());
00183                 double phihit = pos.phi();
00184                 double etahit = pos.eta();
00185                 phiD=fabs(phihit-tit->phi());
00186                 if (phiD>3.1415926535) phiD=2*3.1415926535-phiD;
00187                 R=sqrt(pow(etahit-tit->eta(),2)+phiD*phiD);
00188                 if (R<OutConeSize_&&R>InConeSize_&&eItr->energy()>hitCountEthr_)
00189                         {
00190                         nhitOut++;
00191                         }
00192                 if (R<InConeSize_&&eItr->energy()>hitCountEthr_)
00193                         {
00194                         nhitIn++;
00195                         }
00196                 if (R<OutConeSize_&&R>InConeSize_&&eItr->energy()>hitEthr_)
00197                         {
00198                         OutEnergy+=eItr->energy();
00199                         }
00200                 if (R<InConeSize_&&eItr->energy()>hitEthr_)
00201                         {
00202                         InEnergy+=eItr->energy();
00203                         }
00204 
00205                 }
00206 //      std::cout<<"create and push_back candidate"<<std::endl;
00207         reco::IsolatedPixelTrackCandidate newca(l1extra::L1JetParticleRef(l1Taus,tit-l1Taus->begin()), InEnergy, OutEnergy, nhitIn, nhitOut);
00208         iptcCollection->push_back(newca);       
00209         }
00210 
00211 
00212   
00213   //Use the ExampleData to create an ExampleData2 which 
00214   // is put into the Event
00215   
00216 //  std::cout<<"put cand into event"<<std::endl;
00217   std::auto_ptr<reco::IsolatedPixelTrackCandidateCollection> pOut(iptcCollection);
00218   iEvent.put(pOut);
00219 
00220 }


Member Data Documentation

edm::InputTag EcalIsolatedParticleCandidateProducer::EBrecHitCollectionLabel_ [private]

Definition at line 34 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

edm::InputTag EcalIsolatedParticleCandidateProducer::EErecHitCollectionLabel_ [private]

Definition at line 35 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

const CaloGeometry* EcalIsolatedParticleCandidateProducer::geo [private]

Definition at line 26 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by produce().

double EcalIsolatedParticleCandidateProducer::hitCountEthr_ [private]

Definition at line 30 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

double EcalIsolatedParticleCandidateProducer::hitEthr_ [private]

Definition at line 31 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

edm::InputTag EcalIsolatedParticleCandidateProducer::hltGTseedlabel_ [private]

Definition at line 33 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

double EcalIsolatedParticleCandidateProducer::InConeSize_ [private]

Definition at line 28 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

edm::InputTag EcalIsolatedParticleCandidateProducer::l1tausource_ [private]

Definition at line 32 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer(), and produce().

double EcalIsolatedParticleCandidateProducer::OutConeSize_ [private]

Definition at line 29 of file EcalIsolatedParticleCandidateProducer.h.

Referenced by EcalIsolatedParticleCandidateProducer().


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