23 #include <CLHEP/Vector/LorentzVector.h> 70 for( collection::const_iterator ele = (*inputHandle).begin(); ele != (*inputHandle).end(); ++ ele ){
73 DetId maxHitId =
findMaxHit((*ele).superCluster()->hitsAndFractions(),EBHitsColl,EEHitsColl);
75 if(maxHitId.
null()){
std::cout<<
" Null Id"<<std::endl;
continue;}
83 std::vector<DetId> m5x5aroundMax = topology->
getWindow(maxHitId,WindowSize,WindowSize);
84 E5x5 =
EnergyNxN(m5x5aroundMax,EBHitsColl,EEHitsColl);
86 std::vector<DetId> m3x3aroundMax = topology->
getWindow(maxHitId,WindowSize,WindowSize);
87 E3x3 =
EnergyNxN(m3x3aroundMax,EBHitsColl,EEHitsColl);
89 double pin = ele->trackMomentumAtVtx ().R () ;
90 double piMpoOpi = (pin - ele->trackMomentumOut ().R ()) / pin ;
91 double E5x5OPout = E5x5/ele->trackMomentumOut ().R () ;
92 double E3x3OPin = E3x3/pin;
93 double E3x3OE5x5 = E3x3/E5x5;
94 double EseedOPout = ele->eSeedClusterOverPout () ;
95 double EoPin = ele->eSuperClusterOverP () ;
127 double currEnergy = 0. ;
129 for (std::vector<std::pair<DetId,float> >::
const_iterator idsIt = v1.begin () ;
130 idsIt != v1.end () ; ++idsIt)
135 itrechit = EBhits->
find ((*idsIt).first) ;
136 if (itrechit == EBhits->
end () )
138 edm::LogInfo (
"reading") <<
"[findMaxHit] rechit not found! " ;
142 if (itrechit->energy () > currEnergy)
144 currEnergy = itrechit->energy () ;
145 maxHit= (*idsIt).first ;
151 itrechit = EEhits->
find ((*idsIt).first) ;
152 if (itrechit == EEhits->
end () )
154 edm::LogInfo (
"reading")<<
"[findMaxHit] rechit not found! " ;
158 if (itrechit->energy () > currEnergy)
160 currEnergy=itrechit->energy () ;
161 maxHit= (*idsIt).first ;
175 int window_size = vNxN.size();
176 for (
int ixtal = 0; ixtal < window_size; ixtal++){
180 it_rechit = EBhits->
find(vNxN[ixtal]);
181 dummy+= it_rechit->energy();
186 it_rechit = EEhits->
find(vNxN[ixtal]);
187 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)
std::vector< EcalRecHit >::const_iterator const_iterator
void select(edm::Handle< collection >, const edm::Event &, const edm::EventSetup &)
~SingleEleCalibSelector()
dtor
container::const_iterator const_iterator
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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
bool null() const
is this a null id ?
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
return(e1-e2)*(e1-e2)+dp *dp
iterator find(key_type k)
edm::InputTag EErecHitLabel_
SingleEleCalibSelector(const edm::ParameterSet &iConfig)
ctor
edm::InputTag EBrecHitLabel_