42 LogInfo(
"ContainmentCorrectionAnalyzer") <<
"Analyzing event " << evt.
id() <<
"\n";
45 std::vector<SimTrack> theSimTracks;
48 if (SimTk.
isValid() ) theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
51 std::vector<SimVertex> theSimVertexes;
54 if (SimVtx.
isValid()) theSimVertexes.insert(theSimVertexes.end(),SimVtx->begin(),SimVtx->end());
60 if (pHybridBarrelSuperClusters.
isValid()) { BarrelSuperClusters = pHybridBarrelSuperClusters.
product(); }
66 if (pMulti5x5EndcapSuperClusters.
isValid()) EndcapSuperClusters = pMulti5x5EndcapSuperClusters.
product();
91 int mc_size = photons.size();
93 mcEta.resize(mc_size);
94 mcPhi.resize(mc_size);
97 x_vtx.resize(mc_size);
98 y_vtx.resize(mc_size);
99 z_vtx.resize(mc_size);
113 for (
unsigned int ipho=0;ipho<photons.size();ipho++) {
116 double phiTrue = photons[ipho].fourMomentum().phi();
117 double vtxPerp =
sqrt(vtx.x()*vtx.x() + vtx.y()*vtx.y());
118 double etaTrue =
ecalEta(photons[ipho].fourMomentum().
eta(), vtx.z(), vtxPerp);
119 double etTrue = photons[ipho].fourMomentum().e()/cosh(etaTrue);
131 if(std::fabs(etaTrue) < 1.479) {
132 h_EB_eTrue ->Fill(photons[ipho].fourMomentum().
e());
135 if(std::fabs(etaTrue) >= 1.6) {
136 h_EE_eTrue ->Fill(photons[ipho].fourMomentum().
e());
141 if(std::fabs(etaTrue) < 1.479) {
147 double closestParticleDistance = 999;
148 for(reco::SuperClusterCollection::const_iterator aClus = BarrelSuperClusters->begin();
149 aClus != BarrelSuperClusters->end(); aClus++) {
150 etaCurrent = aClus->
position().eta();
151 phiCurrent = aClus->position().phi();
154 if(deltaR < closestParticleDistance) {
157 closestParticleDistance =
deltaR;
162 if(closestParticleDistance < 0.3) {
174 e9[
nRECOphotons-1] = EcalClusterTools::e3x3(*theSeed, ebRecHits, topology );
175 e25[
nRECOphotons-1] = EcalClusterTools::e5x5(*theSeed, ebRecHits, topology );
180 if(std::fabs(etaTrue) >= 1.6) {
186 double closestParticleDistance = 999;
187 for(reco::SuperClusterCollection::const_iterator aClus = EndcapSuperClusters->begin();
188 aClus != EndcapSuperClusters->end(); aClus++) {
189 etaCurrent = aClus->
position().eta();
190 phiCurrent = aClus->position().phi();
193 if(deltaR < closestParticleDistance) {
196 closestParticleDistance =
deltaR;
201 if(closestParticleDistance < 0.3) {
214 e9[
nRECOphotons-1] = EcalClusterTools::e3x3(*theSeed, eeRecHits, topology ) + psEnergy;
215 e25[
nRECOphotons-1] = EcalClusterTools::e5x5(*theSeed, eeRecHits, topology ) + psEnergy;
229 if (ietaAbs > 5 && ietaAbs < 21 && ((iphi % 20) > 5) && ((iphi % 20) < 16) ) {
const math::XYZPoint & position() const
cluster centroid position
std::vector< float > mcEnergy
std::vector< EcalSimPhotonMCTruth > findMcTruth(std::vector< SimTrack > &theSimTracks, std::vector< SimVertex > &theSimVertices)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< float > x_vtx
std::vector< float > y_vtx
std::vector< int > isConverted
std::vector< float > z_vtx
std::vector< float > mcPt
TH1F * h_EE_e9EtrueReference
std::vector< float > superClusterPhi
TH1F * h_EB_eRecoEtrueReference
edm::InputTag reducedBarrelRecHitCollection_
std::vector< float > superClusterEnergy
std::vector< float > superClusterEta
edm::InputTag SimVertexCollection_
float ecalEta(float EtaParticle, float Zvertex, float plane_Radius)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
TH1F * h_EE_e25EtrueReference
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< float > mcEta
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
T const * product() const
T const * product() const
std::vector< float > superClusterEt
TH1F * h_EE_eRecoEtrueReference
TH1F * h_EB_e25EtrueReference
edm::InputTag SimTrackCollection_
edm::InputTag BarrelSuperClusterCollection_
std::vector< float > mcPhi
std::vector< int > seedXtal
edm::InputTag reducedEndcapRecHitCollection_
TH1F * h_EB_e9EtrueReference
const CaloClusterPtr & seed() const
seed BasicCluster
double preshowerEnergy() const
energy deposited in preshower
edm::InputTag EndcapSuperClusterCollection_
Power< A, B >::type pow(const A &a, const B &b)