40 LogInfo(
"ContainmentCorrectionAnalyzer") <<
"Analyzing event " << evt.
id() <<
"\n";
43 std::vector<SimTrack> theSimTracks;
49 if (SimTk.
isValid() ) theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
50 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
52 std::vector<SimVertex> theSimVertexes;
58 if (SimVtx.
isValid()) theSimVertexes.insert(theSimVertexes.end(),SimVtx->begin(),SimVtx->end());
59 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
66 if (pHybridBarrelSuperClusters.
isValid()) { BarrelSuperClusters = pHybridBarrelSuperClusters.
product(); }
67 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
74 if (pMulti5x5EndcapSuperClusters.
isValid()) EndcapSuperClusters = pMulti5x5EndcapSuperClusters.
product();
75 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
83 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
91 else {
LogError(
"ContainmentCorrectionAnalyzer") <<
"Error! can't get collection with label " << l.module; }
103 int mc_size = photons.size();
105 mcEta.resize(mc_size);
106 mcPhi.resize(mc_size);
107 mcPt.resize(mc_size);
109 x_vtx.resize(mc_size);
110 y_vtx.resize(mc_size);
111 z_vtx.resize(mc_size);
125 for (
unsigned int ipho=0;ipho<photons.size();ipho++) {
128 double phiTrue = photons[ipho].fourMomentum().phi();
129 double vtxPerp =
sqrt(vtx.x()*vtx.x() + vtx.y()*vtx.y());
130 double etaTrue =
ecalEta(photons[ipho].fourMomentum().
eta(), vtx.z(), vtxPerp);
131 double etTrue = photons[ipho].fourMomentum().e()/cosh(etaTrue);
143 if(std::fabs(etaTrue) < 1.479) {
144 h_EB_eTrue ->Fill(photons[ipho].fourMomentum().
e());
147 if(std::fabs(etaTrue) >= 1.6) {
148 h_EE_eTrue ->Fill(photons[ipho].fourMomentum().
e());
153 if(std::fabs(etaTrue) < 1.479) {
159 double closestParticleDistance = 999;
160 for(reco::SuperClusterCollection::const_iterator aClus = BarrelSuperClusters->begin();
161 aClus != BarrelSuperClusters->end(); aClus++) {
162 etaCurrent = aClus->
position().eta();
163 phiCurrent = aClus->position().phi();
166 if(deltaR < closestParticleDistance) {
169 closestParticleDistance =
deltaR;
174 if(closestParticleDistance < 0.3) {
186 e9[
nRECOphotons-1] = EcalClusterTools::e3x3(*theSeed, ebRecHits, topology );
187 e25[
nRECOphotons-1] = EcalClusterTools::e5x5(*theSeed, ebRecHits, topology );
192 if(std::fabs(etaTrue) >= 1.6) {
198 double closestParticleDistance = 999;
199 for(reco::SuperClusterCollection::const_iterator aClus = EndcapSuperClusters->begin();
200 aClus != EndcapSuperClusters->end(); aClus++) {
201 etaCurrent = aClus->
position().eta();
202 phiCurrent = aClus->position().phi();
205 if(deltaR < closestParticleDistance) {
208 closestParticleDistance =
deltaR;
213 if(closestParticleDistance < 0.3) {
225 e1[
nRECOphotons-1] = EcalClusterTools::eMax(*theSeed, eeRecHits) + psEnergy;
226 e9[
nRECOphotons-1] = EcalClusterTools::e3x3(*theSeed, eeRecHits, topology ) + psEnergy;
227 e25[
nRECOphotons-1] = EcalClusterTools::e5x5(*theSeed, eeRecHits, topology ) + psEnergy;
241 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
edm::EDGetTokenT< SuperClusterCollection > EndcapSuperClusterCollection_
std::vector< int > isConverted
std::vector< float > z_vtx
edm::EDGetTokenT< 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
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
edm::EDGetTokenT< SimVertexContainer > SimVertexCollection_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< float > mcEta
edm::EDGetTokenT< SuperClusterCollection > BarrelSuperClusterCollection_
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollection_
T const * product() const
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
TH1F * h_EB_e9EtrueReference
const CaloClusterPtr & seed() const
seed BasicCluster
double preshowerEnergy() const
energy deposited in preshower
Power< A, B >::type pow(const A &a, const B &b)