CMS 3D CMS Logo

SingleEleCalibSelector Class Reference

#include <Calibration/Tools/plugins/SingleEleCalibSelector.h>

List of all members.

Public Types

typedef reco::GsfElectronCollection collection
typedef container::const_iterator const_iterator
typedef std::vector< const
reco::GsfElectron * > 
container
typedef reco::GsfElectronRef electron

Public Member Functions

const_iterator begin () const
const_iterator end () const
void select (edm::Handle< collection >, const edm::Event &, const edm::EventSetup &)
 SingleEleCalibSelector (const edm::ParameterSet &iConfig)
 ctor
 ~SingleEleCalibSelector ()
 dtor

Private Member Functions

double EnergyNxN (const std::vector< DetId > &vNxN, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
DetId findMaxHit (const std::vector< DetId > &v1, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)

Private Attributes

double E3x3OE5x5Max_
double E3x3OE5x5Min_
double E3x3OPinMax_
double E3x3OPinMin_
double E5x5OPoutMax_
double E5x5OPoutMin_
edm::InputTag EBrecHitLabel_
edm::InputTag EErecHitLabel_
double ESCOPinMax_
double ESCOPinMin_
double ESeedOPoutMax_
double ESeedOPoutMin_
double PinMPoutOPinMax_
double PinMPoutOPinMin_
container selected_
edm::ESHandle< CaloTopologytheCaloTopology
 the selected collection


Detailed Description

Definition at line 19 of file SingleEleCalibSelector.h.


Member Typedef Documentation

typedef reco::GsfElectronCollection SingleEleCalibSelector::collection

Definition at line 23 of file SingleEleCalibSelector.h.

typedef container::const_iterator SingleEleCalibSelector::const_iterator

Definition at line 26 of file SingleEleCalibSelector.h.

typedef std::vector<const reco::GsfElectron *> SingleEleCalibSelector::container

Definition at line 25 of file SingleEleCalibSelector.h.

typedef reco::GsfElectronRef SingleEleCalibSelector::electron

Definition at line 24 of file SingleEleCalibSelector.h.


Constructor & Destructor Documentation

SingleEleCalibSelector::SingleEleCalibSelector ( const edm::ParameterSet iConfig  ) 

ctor

Definition at line 27 of file SingleEleCalibSelector.cc.

References E3x3OE5x5Max_, E3x3OE5x5Min_, E3x3OPinMax_, E3x3OPinMin_, E5x5OPoutMax_, E5x5OPoutMin_, EBrecHitLabel_, EErecHitLabel_, ESCOPinMax_, ESCOPinMin_, ESeedOPoutMax_, ESeedOPoutMin_, edm::ParameterSet::getParameter(), PinMPoutOPinMax_, and PinMPoutOPinMin_.

00028  {
00029    ESCOPinMin_      = iConfig.getParameter<double>("ESCOPinMin");
00030    ESCOPinMax_      = iConfig.getParameter<double>("ESCOPinMax");
00031    ESeedOPoutMin_   = iConfig.getParameter<double>("ESeedOPoutMin");
00032    ESeedOPoutMax_   = iConfig.getParameter<double>("ESeedOPoutMax");  
00033    PinMPoutOPinMin_ = iConfig.getParameter<double>("PinMPoutOPinMin");
00034    PinMPoutOPinMax_ = iConfig.getParameter<double>("PinMPoutOPinMax");   
00035    E5x5OPoutMin_    = iConfig.getParameter<double>("E5x5OPoutMin");
00036    E5x5OPoutMax_    = iConfig.getParameter<double>("E5x5OPoutMax");
00037    E3x3OPinMin_     = iConfig.getParameter<double>("E3x3OPinMin");
00038    E3x3OPinMax_     = iConfig.getParameter<double>("E3x3OPinMax");
00039    E3x3OE5x5Min_    = iConfig.getParameter<double>("E3x3OE5x5Min");
00040    E3x3OE5x5Max_    = iConfig.getParameter<double>("E3x3OE5x5Max"); 
00041    EBrecHitLabel_   = iConfig.getParameter<edm::InputTag> ("alcaBarrelHitCollection"); 
00042    EErecHitLabel_   = iConfig.getParameter<edm::InputTag> ("alcaEndcapHitCollection"); 
00043  }

SingleEleCalibSelector::~SingleEleCalibSelector (  ) 

dtor

Definition at line 115 of file SingleEleCalibSelector.cc.

00116 {}


Member Function Documentation

const_iterator SingleEleCalibSelector::begin (  )  const [inline]

Definition at line 33 of file SingleEleCalibSelector.h.

References selected_.

00033 { return selected_.begin(); }

const_iterator SingleEleCalibSelector::end (  )  const [inline]

Definition at line 34 of file SingleEleCalibSelector.h.

References selected_.

00034 { return selected_.end(); }

double SingleEleCalibSelector::EnergyNxN ( const std::vector< DetId > &  vNxN,
const EBRecHitCollection EBhits,
const EERecHitCollection EEhits 
) [private]

Definition at line 169 of file SingleEleCalibSelector.cc.

References dummy, EcalBarrel, and edm::SortedCollection< T, SORT >::find().

Referenced by select().

00172 {
00173   double dummy = 0.;
00174   int window_size = vNxN.size(); 
00175   for (int ixtal = 0; ixtal < window_size; ixtal++){ 
00176     if (vNxN[ixtal].subdetId() == EcalBarrel) 
00177       { 
00178         EBRecHitCollection::const_iterator it_rechit; 
00179         it_rechit = EBhits->find(vNxN[ixtal]);
00180         dummy+= it_rechit->energy(); 
00181       } 
00182     else 
00183       { 
00184         EERecHitCollection::const_iterator it_rechit;
00185         it_rechit = EEhits->find(vNxN[ixtal]); 
00186         dummy+= it_rechit->energy(); 
00187       } 
00188   }
00189   
00190   return dummy;
00191 }

DetId SingleEleCalibSelector::findMaxHit ( const std::vector< DetId > &  v1,
const EBRecHitCollection EBhits,
const EERecHitCollection EEhits 
) [private]

Definition at line 123 of file SingleEleCalibSelector.cc.

References EcalBarrel, edm::SortedCollection< T, SORT >::end(), and edm::SortedCollection< T, SORT >::find().

Referenced by select().

00126 {
00127   double currEnergy = 0. ;
00128   DetId maxHit ;
00129   for (std::vector<DetId>::const_iterator idsIt = v1.begin () ; 
00130        idsIt != v1.end () ; ++idsIt)
00131     {
00132       if (idsIt->subdetId () == EcalBarrel) 
00133         {              
00134           EBRecHitCollection::const_iterator itrechit ;
00135           itrechit = EBhits->find (*idsIt) ;
00136           if (itrechit == EBhits->end () )
00137             {
00138               edm::LogInfo ("reading") << "[findMaxHit] rechit not found! " ;
00139               continue ;
00140             }
00141           if (itrechit->energy () > currEnergy)
00142             {
00143               currEnergy = itrechit->energy () ;
00144               maxHit= *idsIt ;
00145             }
00146         }
00147       else 
00148         {     
00149           EERecHitCollection::const_iterator itrechit ;
00150           itrechit = EEhits->find (*idsIt) ;
00151           if (itrechit == EEhits->end () )
00152             {
00153               edm::LogInfo ("reading")<< "[findMaxHit] rechit not found! " ;
00154               continue ;
00155             }
00156           
00157           if (itrechit->energy () > currEnergy)
00158             {
00159               currEnergy=itrechit->energy () ;
00160               maxHit= *idsIt ;
00161             }
00162         }
00163     }
00164   return maxHit ;
00165 }

void SingleEleCalibSelector::select ( edm::Handle< collection inputHandle,
const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 51 of file SingleEleCalibSelector.cc.

References GenMuonPlsPt100GeV_cfg::cout, E3x3OE5x5Max_, E3x3OE5x5Min_, E3x3OPinMax_, E3x3OPinMin_, E5x5OPoutMax_, E5x5OPoutMin_, EBrecHitLabel_, DetId::Ecal, EErecHitLabel_, lat::endl(), EnergyNxN(), ESCOPinMax_, ESCOPinMin_, ESeedOPoutMax_, ESeedOPoutMin_, findMaxHit(), edm::EventSetup::get(), edm::Event::getByLabel(), CaloSubdetectorTopology::getWindow(), DetId::null(), PinMPoutOPinMax_, PinMPoutOPinMin_, edm::Handle< T >::product(), selected_, DetId::subdetId(), and theCaloTopology.

00053 {
00054   selected_.clear();
00055 
00056   //Get the EB rechit collection
00057   edm::Handle<EBRecHitCollection> barrelRecHitsHandle ;
00058   iEvent.getByLabel (EBrecHitLabel_, barrelRecHitsHandle) ;
00059   const EBRecHitCollection* EBHitsColl = barrelRecHitsHandle.product () ; 
00060 
00061   //Get the EE rechit collection
00062   edm::Handle<EERecHitCollection> endcapRecHitsHandle ;
00063   iEvent.getByLabel (EErecHitLabel_, endcapRecHitsHandle) ;
00064   const EERecHitCollection* EEHitsColl = endcapRecHitsHandle.product () ; 
00065   
00066   //To deal with Geometry
00067   iSetup.get<CaloTopologyRecord>().get(theCaloTopology); 
00068 
00069   //Loop over electrons
00070   for( collection::const_iterator ele = (*inputHandle).begin(); ele != (*inputHandle).end(); ++ ele ){
00071      
00072     //Find DetID max hit
00073     DetId maxHitId = findMaxHit((*ele).superCluster()->getHitsByDetId(),EBHitsColl,EEHitsColl);
00074     
00075     if(maxHitId.null()){std::cout<<" Null Id"<<std::endl; continue;}
00076 
00077     // Find 3x3 and 5x5 windows around xtal max and compute E3x3,E5x5
00078     double E5x5 = 0.; 
00079     double E3x3 = 0.; 
00080   
00081     const CaloSubdetectorTopology* topology = theCaloTopology->getSubdetectorTopology(DetId::Ecal,maxHitId.subdetId()); 
00082     int WindowSize = 5;
00083     std::vector<DetId> m5x5aroundMax = topology->getWindow(maxHitId,WindowSize,WindowSize); 
00084     E5x5 = EnergyNxN(m5x5aroundMax,EBHitsColl,EEHitsColl);
00085     WindowSize = 3;
00086     std::vector<DetId> m3x3aroundMax = topology->getWindow(maxHitId,WindowSize,WindowSize); 
00087     E3x3 = EnergyNxN(m3x3aroundMax,EBHitsColl,EEHitsColl);
00088 
00089     double pin = ele->trackMomentumAtVtx ().R () ;
00090     double piMpoOpi = (pin - ele->trackMomentumOut ().R ()) / pin ;
00091     double E5x5OPout = E5x5/ele->trackMomentumOut ().R () ;
00092     double E3x3OPin = E3x3/pin;
00093     double E3x3OE5x5 = E3x3/E5x5;
00094     double EseedOPout = ele->eSeedClusterOverPout () ;
00095     double EoPin = ele->eSuperClusterOverP () ;      
00096   
00097     if ( piMpoOpi > PinMPoutOPinMin_ && piMpoOpi < PinMPoutOPinMax_ && 
00098          EseedOPout > ESeedOPoutMin_ && EseedOPout < ESeedOPoutMax_ &&
00099          EoPin > ESCOPinMin_ && EoPin < ESCOPinMax_ &&
00100          E5x5OPout > E5x5OPoutMin_ && E5x5OPout < E5x5OPoutMax_ && 
00101          E3x3OPin > E3x3OPinMin_ && E3x3OPin < E3x3OPinMax_ &&
00102          E3x3OE5x5 > E3x3OE5x5Min_ && E3x3OE5x5 < E3x3OE5x5Max_)
00103       {
00104         selected_.push_back( & (*ele) );
00105       }
00106   }
00107    
00108   return ;
00109 }       


Member Data Documentation

double SingleEleCalibSelector::E3x3OE5x5Max_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::E3x3OE5x5Min_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::E3x3OPinMax_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::E3x3OPinMin_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::E5x5OPoutMax_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::E5x5OPoutMin_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

edm::InputTag SingleEleCalibSelector::EBrecHitLabel_ [private]

Definition at line 54 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

edm::InputTag SingleEleCalibSelector::EErecHitLabel_ [private]

Definition at line 55 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::ESCOPinMax_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::ESCOPinMin_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::ESeedOPoutMax_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::ESeedOPoutMin_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::PinMPoutOPinMax_ [private]

Definition at line 53 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

double SingleEleCalibSelector::PinMPoutOPinMin_ [private]

Definition at line 52 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

container SingleEleCalibSelector::selected_ [private]

Definition at line 40 of file SingleEleCalibSelector.h.

Referenced by begin(), end(), and select().

edm::ESHandle<CaloTopology> SingleEleCalibSelector::theCaloTopology [private]

the selected collection

Definition at line 42 of file SingleEleCalibSelector.h.

Referenced by select().


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