22 #include <CLHEP/Vector/LorentzVector.h> 66 for (collection::const_iterator ele = (*inputHandle).begin(); ele != (*inputHandle).end(); ++ele) {
68 DetId maxHitId =
findMaxHit((*ele).superCluster()->hitsAndFractions(), EBHitsColl, EEHitsColl);
70 if (maxHitId.
null()) {
81 std::vector<DetId> m5x5aroundMax = topology->
getWindow(maxHitId, WindowSize, WindowSize);
82 E5x5 =
EnergyNxN(m5x5aroundMax, EBHitsColl, EEHitsColl);
84 std::vector<DetId> m3x3aroundMax = topology->
getWindow(maxHitId, WindowSize, WindowSize);
85 E3x3 =
EnergyNxN(m3x3aroundMax, EBHitsColl, EEHitsColl);
87 double pin = ele->trackMomentumAtVtx().R();
88 double piMpoOpi = (pin - ele->trackMomentumOut().R()) / pin;
89 double E5x5OPout = E5x5 / ele->trackMomentumOut().R();
90 double E3x3OPin = E3x3 / pin;
91 double E3x3OE5x5 = E3x3 / E5x5;
92 double EseedOPout = ele->eSeedClusterOverPout();
93 double EoPin = ele->eSuperClusterOverP();
116 double currEnergy = 0.;
118 for (std::vector<std::pair<DetId, float> >::
const_iterator idsIt = v1.begin(); idsIt != v1.end(); ++idsIt) {
121 itrechit = EBhits->
find((*idsIt).first);
122 if (itrechit == EBhits->
end()) {
123 edm::LogInfo(
"reading") <<
"[findMaxHit] rechit not found! ";
127 if (itrechit->energy() > currEnergy) {
128 currEnergy = itrechit->energy();
129 maxHit = (*idsIt).first;
133 itrechit = EEhits->
find((*idsIt).first);
134 if (itrechit == EEhits->
end()) {
135 edm::LogInfo(
"reading") <<
"[findMaxHit] rechit not found! ";
139 if (itrechit->energy() > currEnergy) {
140 currEnergy = itrechit->energy();
141 maxHit = (*idsIt).first;
153 int window_size = vNxN.size();
154 for (
int ixtal = 0; ixtal < window_size; ixtal++) {
157 it_rechit = EBhits->
find(vNxN[ixtal]);
158 dummy += it_rechit->energy();
161 it_rechit = EEhits->
find(vNxN[ixtal]);
162 dummy += it_rechit->energy();
T getParameter(std::string const &) const
edm::ESHandle< CaloTopology > theCaloTopology
the selected collection
DetId findMaxHit(const std::vector< std::pair< DetId, float > > &v1, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
CaloTopology const * topology(0)
constexpr bool null() const
is this a null id ?
std::vector< EcalRecHit >::const_iterator const_iterator
void select(edm::Handle< collection >, const edm::Event &, const edm::EventSetup &)
~SingleEleCalibSelector()
dtor
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
container::const_iterator const_iterator
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const_iterator end() const
double EnergyNxN(const std::vector< DetId > &vNxN, const EBRecHitCollection *EBhits, const EERecHitCollection *EEhits)
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
T const * product() const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
iterator find(key_type k)
edm::InputTag EErecHitLabel_
SingleEleCalibSelector(const edm::ParameterSet &iConfig)
ctor
edm::InputTag EBrecHitLabel_