43 LogInfo(
"ContainmentCorrectionAnalyzer") <<
"Analyzing event " << evt.
id() <<
"\n";
46 std::vector<SimTrack> theSimTracks;
53 theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end());
55 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
58 std::vector<SimVertex> theSimVertexes;
64 theSimVertexes.insert(theSimVertexes.end(), SimVtx->begin(), SimVtx->end());
66 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
74 if (pHybridBarrelSuperClusters.
isValid()) {
75 BarrelSuperClusters = pHybridBarrelSuperClusters.
product();
77 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
85 if (pMulti5x5EndcapSuperClusters.
isValid())
86 EndcapSuperClusters = pMulti5x5EndcapSuperClusters.
product();
88 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
97 ebRecHits = pEBRecHits.
product();
99 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
108 eeRecHits = pEERecHits.
product();
110 LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module;
117 topology = pTopology.
product();
119 std::vector<EcalSimPhotonMCTruth>
photons =
findMcTruth(theSimTracks, theSimVertexes);
124 int mc_size = photons.size();
126 mcEta.resize(mc_size);
127 mcPhi.resize(mc_size);
128 mcPt.resize(mc_size);
130 x_vtx.resize(mc_size);
131 y_vtx.resize(mc_size);
132 z_vtx.resize(mc_size);
145 for (
unsigned int ipho = 0; ipho < photons.size(); ipho++) {
147 double phiTrue = photons[ipho].fourMomentum().phi();
148 double vtxPerp =
sqrt(vtx.x() * vtx.x() + vtx.y() * vtx.y());
149 double etaTrue =
ecalEta(photons[ipho].fourMomentum().
eta(), vtx.z(), vtxPerp);
150 double etTrue = photons[ipho].fourMomentum().e() / cosh(etaTrue);
162 if (std::fabs(etaTrue) < 1.479) {
163 h_EB_eTrue->Fill(photons[ipho].fourMomentum().
e());
166 if (std::fabs(etaTrue) >= 1.6) {
167 h_EE_eTrue->Fill(photons[ipho].fourMomentum().
e());
172 if (std::fabs(etaTrue) < 1.479) {
178 double closestParticleDistance = 999;
179 for (reco::SuperClusterCollection::const_iterator aClus = BarrelSuperClusters->begin();
180 aClus != BarrelSuperClusters->end();
182 etaCurrent = aClus->
position().eta();
183 phiCurrent = aClus->position().phi();
186 if (deltaR < closestParticleDistance) {
189 closestParticleDistance =
deltaR;
194 if (closestParticleDistance < 0.3) {
206 e9[
nRECOphotons - 1] = EcalClusterTools::e3x3(*theSeed, ebRecHits, topology);
207 e25[
nRECOphotons - 1] = EcalClusterTools::e5x5(*theSeed, ebRecHits, topology);
212 if (std::fabs(etaTrue) >= 1.6) {
218 double closestParticleDistance = 999;
219 for (reco::SuperClusterCollection::const_iterator aClus = EndcapSuperClusters->begin();
220 aClus != EndcapSuperClusters->end();
222 etaCurrent = aClus->
position().eta();
223 phiCurrent = aClus->position().phi();
226 if (deltaR < closestParticleDistance) {
229 closestParticleDistance =
deltaR;
234 if (closestParticleDistance < 0.3) {
247 e9[
nRECOphotons - 1] = EcalClusterTools::e3x3(*theSeed, eeRecHits, topology) + psEnergy;
248 e25[
nRECOphotons - 1] = EcalClusterTools::e5x5(*theSeed, eeRecHits, topology) + psEnergy;
260 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
CaloTopology const * topology(0)
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< float > y_vtx
std::vector< int > isConverted
std::vector< float > z_vtx
edm::EDGetTokenT< edm::SimTrackContainer > SimTrackCollection_
std::vector< float > mcPt
TH1F * h_EE_e9EtrueReference
std::vector< float > superClusterPhi
TH1F * h_EB_eRecoEtrueReference
std::vector< float > superClusterEnergy
std::vector< float > superClusterEta
edm::EDGetTokenT< reco::SuperClusterCollection > BarrelSuperClusterCollection_
float ecalEta(float EtaParticle, float Zvertex, float plane_Radius)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
edm::EDGetTokenT< edm::SimVertexContainer > SimVertexCollection_
TH1F * h_EE_e25EtrueReference
std::vector< float > mcEta
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollection_
T const * product() const
std::vector< float > superClusterEt
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
TH1F * h_EE_eRecoEtrueReference
TH1F * h_EB_e25EtrueReference
std::vector< float > mcPhi
std::vector< int > seedXtal
edm::EDGetTokenT< reco::SuperClusterCollection > EndcapSuperClusterCollection_
TH1F * h_EB_e9EtrueReference
const CaloClusterPtr & seed() const
seed BasicCluster
double preshowerEnergy() const
energy deposited in preshower
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)