CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SingleEleCalibSelector Class Reference

#include <SingleEleCalibSelector.h>

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 More...
 
 ~SingleEleCalibSelector ()
 dtor More...
 

Private Member Functions

double EnergyNxN (const std::vector< DetId > &vNxN, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
 
DetId findMaxHit (const std::vector< std::pair< DetId, float > > &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 More...
 

Detailed Description

Definition at line 18 of file SingleEleCalibSelector.h.

Member Typedef Documentation

◆ collection

Definition at line 20 of file SingleEleCalibSelector.h.

◆ const_iterator

typedef container::const_iterator SingleEleCalibSelector::const_iterator

Definition at line 23 of file SingleEleCalibSelector.h.

◆ container

Definition at line 22 of file SingleEleCalibSelector.h.

◆ electron

Definition at line 21 of file SingleEleCalibSelector.h.

Constructor & Destructor Documentation

◆ SingleEleCalibSelector()

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

ctor

Definition at line 27 of file SingleEleCalibSelector.cc.

27  {
28  ESCOPinMin_ = iConfig.getParameter<double>("ESCOPinMin");
29  ESCOPinMax_ = iConfig.getParameter<double>("ESCOPinMax");
30  ESeedOPoutMin_ = iConfig.getParameter<double>("ESeedOPoutMin");
31  ESeedOPoutMax_ = iConfig.getParameter<double>("ESeedOPoutMax");
32  PinMPoutOPinMin_ = iConfig.getParameter<double>("PinMPoutOPinMin");
33  PinMPoutOPinMax_ = iConfig.getParameter<double>("PinMPoutOPinMax");
34  E5x5OPoutMin_ = iConfig.getParameter<double>("E5x5OPoutMin");
35  E5x5OPoutMax_ = iConfig.getParameter<double>("E5x5OPoutMax");
36  E3x3OPinMin_ = iConfig.getParameter<double>("E3x3OPinMin");
37  E3x3OPinMax_ = iConfig.getParameter<double>("E3x3OPinMax");
38  E3x3OE5x5Min_ = iConfig.getParameter<double>("E3x3OE5x5Min");
39  E3x3OE5x5Max_ = iConfig.getParameter<double>("E3x3OE5x5Max");
40  EBrecHitLabel_ = iConfig.getParameter<edm::InputTag>("alcaBarrelHitCollection");
41  EErecHitLabel_ = iConfig.getParameter<edm::InputTag>("alcaEndcapHitCollection");
42 }

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

◆ ~SingleEleCalibSelector()

SingleEleCalibSelector::~SingleEleCalibSelector ( )

dtor

Definition at line 109 of file SingleEleCalibSelector.cc.

109 {}

Member Function Documentation

◆ begin()

const_iterator SingleEleCalibSelector::begin ( ) const
inline

Definition at line 30 of file SingleEleCalibSelector.h.

30 { return selected_.begin(); }

References selected_.

◆ end()

const_iterator SingleEleCalibSelector::end ( ) const
inline

Definition at line 31 of file SingleEleCalibSelector.h.

31 { return selected_.end(); }

References selected_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

◆ EnergyNxN()

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

Definition at line 150 of file SingleEleCalibSelector.cc.

152  {
153  double dummy = 0.;
154  int window_size = vNxN.size();
155  for (int ixtal = 0; ixtal < window_size; ixtal++) {
156  if (vNxN[ixtal].subdetId() == EcalBarrel) {
158  it_rechit = EBhits->find(vNxN[ixtal]);
159  dummy += it_rechit->energy();
160  } else {
162  it_rechit = EEhits->find(vNxN[ixtal]);
163  dummy += it_rechit->energy();
164  }
165  }
166 
167  return dummy;
168 }

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

Referenced by select().

◆ findMaxHit()

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

Definition at line 114 of file SingleEleCalibSelector.cc.

116  {
117  double currEnergy = 0.;
118  DetId maxHit;
119  for (std::vector<std::pair<DetId, float> >::const_iterator idsIt = v1.begin(); idsIt != v1.end(); ++idsIt) {
120  if (idsIt->first.subdetId() == EcalBarrel) {
122  itrechit = EBhits->find((*idsIt).first);
123  if (itrechit == EBhits->end()) {
124  edm::LogInfo("reading") << "[findMaxHit] rechit not found! ";
125  continue;
126  }
127  //FIXME: use fraction ??
128  if (itrechit->energy() > currEnergy) {
129  currEnergy = itrechit->energy();
130  maxHit = (*idsIt).first;
131  }
132  } else {
134  itrechit = EEhits->find((*idsIt).first);
135  if (itrechit == EEhits->end()) {
136  edm::LogInfo("reading") << "[findMaxHit] rechit not found! ";
137  continue;
138  }
139 
140  if (itrechit->energy() > currEnergy) {
141  currEnergy = itrechit->energy();
142  maxHit = (*idsIt).first;
143  }
144  }
145  }
146  return maxHit;
147 }

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

Referenced by select().

◆ select()

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

Definition at line 48 of file SingleEleCalibSelector.cc.

50 {
51  selected_.clear();
52 
53  //Get the EB rechit collection
54  edm::Handle<EBRecHitCollection> barrelRecHitsHandle;
55  iEvent.getByLabel(EBrecHitLabel_, barrelRecHitsHandle);
56  const EBRecHitCollection* EBHitsColl = barrelRecHitsHandle.product();
57 
58  //Get the EE rechit collection
59  edm::Handle<EERecHitCollection> endcapRecHitsHandle;
60  iEvent.getByLabel(EErecHitLabel_, endcapRecHitsHandle);
61  const EERecHitCollection* EEHitsColl = endcapRecHitsHandle.product();
62 
63  //To deal with Geometry
65 
66  //Loop over electrons
67  for (collection::const_iterator ele = (*inputHandle).begin(); ele != (*inputHandle).end(); ++ele) {
68  //Find DetID max hit
69  DetId maxHitId = findMaxHit((*ele).superCluster()->hitsAndFractions(), EBHitsColl, EEHitsColl);
70 
71  if (maxHitId.null()) {
72  std::cout << " Null Id" << std::endl;
73  continue;
74  }
75 
76  // Find 3x3 and 5x5 windows around xtal max and compute E3x3,E5x5
77  double E5x5 = 0.;
78  double E3x3 = 0.;
79 
81  int WindowSize = 5;
82  std::vector<DetId> m5x5aroundMax = topology->getWindow(maxHitId, WindowSize, WindowSize);
83  E5x5 = EnergyNxN(m5x5aroundMax, EBHitsColl, EEHitsColl);
84  WindowSize = 3;
85  std::vector<DetId> m3x3aroundMax = topology->getWindow(maxHitId, WindowSize, WindowSize);
86  E3x3 = EnergyNxN(m3x3aroundMax, EBHitsColl, EEHitsColl);
87 
88  double pin = ele->trackMomentumAtVtx().R();
89  double piMpoOpi = (pin - ele->trackMomentumOut().R()) / pin;
90  double E5x5OPout = E5x5 / ele->trackMomentumOut().R();
91  double E3x3OPin = E3x3 / pin;
92  double E3x3OE5x5 = E3x3 / E5x5;
93  double EseedOPout = ele->eSeedClusterOverPout();
94  double EoPin = ele->eSuperClusterOverP();
95 
96  if (piMpoOpi > PinMPoutOPinMin_ && piMpoOpi < PinMPoutOPinMax_ && EseedOPout > ESeedOPoutMin_ &&
97  EseedOPout < ESeedOPoutMax_ && EoPin > ESCOPinMin_ && EoPin < ESCOPinMax_ && E5x5OPout > E5x5OPoutMin_ &&
98  E5x5OPout < E5x5OPoutMax_ && E3x3OPin > E3x3OPinMin_ && E3x3OPin < E3x3OPinMax_ && E3x3OE5x5 > E3x3OE5x5Min_ &&
99  E3x3OE5x5 < E3x3OE5x5Max_) {
100  selected_.push_back(&(*ele));
101  }
102  }
103 
104  return;
105 }

References gather_cfg::cout, E3x3OE5x5Max_, E3x3OE5x5Min_, E3x3OPinMin_, E5x5OPoutMin_, EBrecHitLabel_, DetId::Ecal, EErecHitLabel_, EnergyNxN(), ESCOPinMin_, ESeedOPoutMin_, findMaxHit(), edm::EventSetup::get(), get, CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), iEvent, DetId::null(), PinMPoutOPinMin_, edm::Handle< T >::product(), selected_, DetId::subdetId(), and theCaloTopology.

Member Data Documentation

◆ E3x3OE5x5Max_

double SingleEleCalibSelector::E3x3OE5x5Max_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ E3x3OE5x5Min_

double SingleEleCalibSelector::E3x3OE5x5Min_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ E3x3OPinMax_

double SingleEleCalibSelector::E3x3OPinMax_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by SingleEleCalibSelector().

◆ E3x3OPinMin_

double SingleEleCalibSelector::E3x3OPinMin_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ E5x5OPoutMax_

double SingleEleCalibSelector::E5x5OPoutMax_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by SingleEleCalibSelector().

◆ E5x5OPoutMin_

double SingleEleCalibSelector::E5x5OPoutMin_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ EBrecHitLabel_

edm::InputTag SingleEleCalibSelector::EBrecHitLabel_
private

Definition at line 48 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ EErecHitLabel_

edm::InputTag SingleEleCalibSelector::EErecHitLabel_
private

Definition at line 49 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ ESCOPinMax_

double SingleEleCalibSelector::ESCOPinMax_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by SingleEleCalibSelector().

◆ ESCOPinMin_

double SingleEleCalibSelector::ESCOPinMin_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ ESeedOPoutMax_

double SingleEleCalibSelector::ESeedOPoutMax_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by SingleEleCalibSelector().

◆ ESeedOPoutMin_

double SingleEleCalibSelector::ESeedOPoutMin_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ PinMPoutOPinMax_

double SingleEleCalibSelector::PinMPoutOPinMax_
private

Definition at line 47 of file SingleEleCalibSelector.h.

Referenced by SingleEleCalibSelector().

◆ PinMPoutOPinMin_

double SingleEleCalibSelector::PinMPoutOPinMin_
private

Definition at line 46 of file SingleEleCalibSelector.h.

Referenced by select(), and SingleEleCalibSelector().

◆ selected_

container SingleEleCalibSelector::selected_
private

Definition at line 36 of file SingleEleCalibSelector.h.

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

◆ theCaloTopology

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

the selected collection

Definition at line 38 of file SingleEleCalibSelector.h.

Referenced by select().

SingleEleCalibSelector::E5x5OPoutMin_
double E5x5OPoutMin_
Definition: SingleEleCalibSelector.h:46
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
edm::Handle::product
T const * product() const
Definition: Handle.h:70
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SingleEleCalibSelector::ESCOPinMin_
double ESCOPinMin_
Definition: SingleEleCalibSelector.h:46
SingleEleCalibSelector::EnergyNxN
double EnergyNxN(const std::vector< DetId > &vNxN, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
Definition: SingleEleCalibSelector.cc:150
SingleEleCalibSelector::PinMPoutOPinMax_
double PinMPoutOPinMax_
Definition: SingleEleCalibSelector.h:47
edm::SortedCollection< EcalRecHit >
DetId::null
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
SingleEleCalibSelector::E3x3OE5x5Max_
double E3x3OE5x5Max_
Definition: SingleEleCalibSelector.h:47
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
SingleEleCalibSelector::E5x5OPoutMax_
double E5x5OPoutMax_
Definition: SingleEleCalibSelector.h:47
EcalBarrel
Definition: EcalSubdetector.h:10
SingleEleCalibSelector::PinMPoutOPinMin_
double PinMPoutOPinMin_
Definition: SingleEleCalibSelector.h:46
SingleEleCalibSelector::EErecHitLabel_
edm::InputTag EErecHitLabel_
Definition: SingleEleCalibSelector.h:49
DetId
Definition: DetId.h:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
SingleEleCalibSelector::ESeedOPoutMax_
double ESeedOPoutMax_
Definition: SingleEleCalibSelector.h:47
SingleEleCalibSelector::E3x3OPinMin_
double E3x3OPinMin_
Definition: SingleEleCalibSelector.h:46
SingleEleCalibSelector::EBrecHitLabel_
edm::InputTag EBrecHitLabel_
Definition: SingleEleCalibSelector.h:48
MTVHistoProducerAlgoForTrackerBlock_cfi.maxHit
maxHit
Definition: MTVHistoProducerAlgoForTrackerBlock_cfi.py:37
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
SingleEleCalibSelector::theCaloTopology
edm::ESHandle< CaloTopology > theCaloTopology
the selected collection
Definition: SingleEleCalibSelector.h:38
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
iEvent
int iEvent
Definition: GenABIO.cc:224
SingleEleCalibSelector::selected_
container selected_
Definition: SingleEleCalibSelector.h:36
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
SingleEleCalibSelector::findMaxHit
DetId findMaxHit(const std::vector< std::pair< DetId, float > > &v1, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
Definition: SingleEleCalibSelector.cc:114
SingleEleCalibSelector::ESeedOPoutMin_
double ESeedOPoutMin_
Definition: SingleEleCalibSelector.h:46
DetId::Ecal
Definition: DetId.h:27
get
#define get
CaloSubdetectorTopology::getWindow
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Definition: CaloSubdetectorTopology.cc:4
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SingleEleCalibSelector::E3x3OPinMax_
double E3x3OPinMax_
Definition: SingleEleCalibSelector.h:47
dummy
Definition: DummySelector.h:38
SingleEleCalibSelector::E3x3OE5x5Min_
double E3x3OE5x5Min_
Definition: SingleEleCalibSelector.h:46
edm::InputTag
Definition: InputTag.h:15
SingleEleCalibSelector::ESCOPinMax_
double ESCOPinMax_
Definition: SingleEleCalibSelector.h:47
SingleEleCalibSelector::const_iterator
container::const_iterator const_iterator
Definition: SingleEleCalibSelector.h:23