File indexing completed on 2024-04-06 12:21:15
0001 #include "DataFormats/Common/interface/Handle.h"
0002 #include "L1Trigger/L1TNtuples/interface/L1AnalysisRecoCluster.h"
0003 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
0004
0005 L1Analysis::L1AnalysisRecoCluster::L1AnalysisRecoCluster() {}
0006
0007 L1Analysis::L1AnalysisRecoCluster::~L1AnalysisRecoCluster() {}
0008
0009 void L1Analysis::L1AnalysisRecoCluster::Set(const reco::CaloClusterCollection& caloClusters, unsigned maxCl) {
0010 recoCluster_.nClusters = recoCluster_.eta.size();
0011 for (reco::CaloClusterCollection::const_iterator it = caloClusters.begin();
0012 it != caloClusters.end() && recoCluster_.nClusters < maxCl;
0013 it++) {
0014 recoCluster_.eta.push_back(it->eta());
0015 recoCluster_.phi.push_back(it->phi());
0016 recoCluster_.et.push_back(it->energy() * sin(it->position().theta()));
0017 recoCluster_.e.push_back(it->energy());
0018 recoCluster_.nClusters++;
0019 }
0020 }
0021
0022 void L1Analysis::L1AnalysisRecoCluster::Set(const reco::SuperClusterCollection& superClusters, unsigned maxCl) {
0023 recoCluster_.nClusters = recoCluster_.eta.size();
0024
0025 for (reco::SuperClusterCollection::const_iterator it = superClusters.begin();
0026 it != superClusters.end() && recoCluster_.nClusters < maxCl;
0027 it++) {
0028 recoCluster_.eta.push_back(it->eta());
0029 recoCluster_.phi.push_back(it->phi());
0030 recoCluster_.et.push_back(it->energy() * sin(it->position().theta()));
0031 recoCluster_.e.push_back(it->energy());
0032 recoCluster_.nClusters++;
0033 }
0034 }